class ActiveRecord::Encryption::KeyProvider

def decryption_keys(encrypted_message)

with that key. If not, it will return the list of keys.
When the message holds a reference to its encryption key, it will return an array

Returns the list of decryption keys
def decryption_keys(encrypted_message)
  if encrypted_message.headers.encrypted_data_key_id
    keys_grouped_by_id[encrypted_message.headers.encrypted_data_key_id]
  else
    @keys
  end
end