Class: ActiveRecord::Encryption::DerivedSecretKeyProvider
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
KeyProvider
|
|
Instance Chain:
self,
KeyProvider
|
|
Inherits: |
ActiveRecord::Encryption::KeyProvider
|
Defined in: | activerecord/lib/active_record/encryption/derived_secret_key_provider.rb |
Overview
A KeyProvider that derives keys from passwords.
Class Method Summary
- .new(passwords, key_generator: ActiveRecord::Encryption.key_generator) ⇒ DerivedSecretKeyProvider constructor
KeyProvider
- Inherited
Instance Method Summary
KeyProvider
- Inherited
#decryption_keys | Returns the list of decryption keys. |
#encryption_key | Returns the first key in the list as the active key to perform encryptions. |
Constructor Details
.new(passwords, key_generator: ActiveRecord::Encryption.key_generator) ⇒ DerivedSecretKeyProvider
# File 'activerecord/lib/active_record/encryption/derived_secret_key_provider.rb', line 7
def initialize(passwords, key_generator: ActiveRecord::Encryption.key_generator) super(Array(passwords).collect { |password| derive_key_from(password, using: key_generator) }) end