When the component is installed, you will be able to define your keys in your application configuration and load your keys from several sources or formats. All these methods have the following option:
is_public: set the service public or private.
The key configuration will look like as follow:
jose:# Configuration of the JWT Frameworkkeys:# Configuration of the keyskey_name:# Unique key namemethod_name:# Name of the method...is_public:true
The key will be available as a container service with the ID jose.key.key_name where key_name is the unique name of your key. Each key service will be an instance of the Jose\Component\Core\JWK class.
As any other configuration values, you can use environment variables.
From A Shared Secret
This feature was introduced in version 1.1.
This method will directly get a shared secret.
jose:keys:key_name:secret:# Methodsecret:'This is my shared secret'additional_values:use:'sig'alg:'RS512'
This method will load a key from a PKCS#1 or PKCS#8 key file.
jose:keys:key_name:file:# Methodpath:'/path/to/your/key/file'password:'secret'# Optional. Only if the key is encryptedadditional_values:# Optional values.use:'sig'alg:'RS256'
From A Key In A Key Set
This method will retrieve a key from a JWKSet service.
jose:keys:key_name:jwkset:# Methodkey_set:'jose.key_set.my_key_set'# JWKSet serviceindex:0# Use key at index 0
Custom Tags
This feature was introduced in version 1.1.
You can add custom tags and attributes to the services you create.