Class: ActiveRecord::Encryption::DeterministicKeyProvider
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
ActiveRecord::Encryption::DerivedSecretKeyProvider
|
Defined in: | activerecord/lib/active_record/encryption/deterministic_key_provider.rb |
Overview
A KeyProvider that derives keys from passwords.
Class Method Summary
- .new(password) ⇒ DeterministicKeyProvider constructor
DerivedSecretKeyProvider
- Inherited
KeyProvider
- Inherited
Instance Method Summary
KeyProvider
- Inherited
#decryption_keys | Returns the list of decryption keys. |
#encryption_key | Returns the last key in the list as the active key to perform encryptions. |
Constructor Details
.new(password) ⇒ DeterministicKeyProvider
# File 'activerecord/lib/active_record/encryption/deterministic_key_provider.rb', line 7
def initialize(password) passwords = Array(password) raise ActiveRecord::Encryption::Errors::Configuration, "Deterministic encryption keys can't be rotated" if passwords.length > 1 super(passwords) end