A KeyProvider
serves keys:
-
An encryption key
-
A list of potential decryption keys. Serving multiple decryption keys supports rotation-schemes where new keys are added but old keys need to continue working
Methods
- D
- E
- N
Class Public methods
new(keys) Link
Instance Public methods
decryption_keys(encrypted_message) Link
Returns the list of decryption keys
When the message holds a reference to its encryption key, it will return an array with that key. If not, it will return the list of keys.
encryption_key() Link
Returns the last key in the list as the active key to perform encryptions
When ActiveRecord::Encryption.config.store_key_references
is true, the key will include a public tag referencing the key itself. That key will be stored in the public headers of the encrypted message