Class: ActiveRecord::Encryption::DerivedSecretKeyProvider

Inherits:
KeyProvider
  • Object
show all
Defined in:
lib/active_record/encryption/derived_secret_key_provider.rb

Overview

A KeyProvider that derives keys from passwords.

Direct Known Subclasses

DeterministicKeyProvider

Instance Method Summary collapse

Methods inherited from KeyProvider

#decryption_keys, #encryption_key

Constructor Details

#initialize(passwords, key_generator: ActiveRecord::Encryption.key_generator) ⇒ DerivedSecretKeyProvider

Returns a new instance of DerivedSecretKeyProvider.



7
8
9
# File '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