instance method try_to_decrypt_with_each

Ruby on Rails 8.0.4

Since v7.0.10 Private

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

Signature

try_to_decrypt_with_each(encrypted_text, keys:)

No documentation comment.

Parameters

encrypted_text req
keys keyreq
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

Type at least 2 characters to search.

↑↓ navigate · open · esc close