class ActiveRecord::Encryption::KeyProvider

def encryption_key

headers of the encrypted message
a public tag referencing the key itself. That key will be stored in the public
When +ActiveRecord::Encryption.config.store_key_references+ is true, the key will include

Returns the last key in the list as the active key to perform encryptions
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