instance method
try_to_decrypt_with_each
Ruby on Rails 8.0.4
Since v7.0.10 PrivateSignature
try_to_decrypt_with_each(encrypted_text, keys:)
No documentation comment.
Parameters
-
encrypted_textreq -
keyskeyreq
Source
# File activerecord/lib/active_record/encryption/cipher.rb, line 40
def try_to_decrypt_with_each(encrypted_text, keys:)
keys.each.with_index do |key, index|
return cipher_for(key).decrypt(encrypted_text)
rescue ActiveRecord::Encryption::Errors::Decryption
raise if index == keys.length - 1
end
end
Defined in activerecord/lib/active_record/encryption/cipher.rb line 40
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Encryption::Cipher