instance method encryption_key

Ruby on Rails 7.2.3

Since v7.0.10

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

encryption_key()

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

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

Type at least 2 characters to search.

↑↓ navigate · open · esc close