instance method
encryption_key
Ruby on Rails 7.1.6
Since v7.0.10Signature
encryption_key()
Returns the first 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
Source
# File activerecord/lib/active_record/encryption/key_provider.rb, line 20
def encryption_key
@encryption_key ||= @keys.last.tap do |key|
key.public_tags.encrypted_data_key_id = key.id if ActiveRecord::Encryption.config.store_key_references
end
@encryption_key
end
Defined in activerecord/lib/active_record/encryption/key_provider.rb line 20
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Encryption::KeyProvider