instance method
decrypt
Ruby on Rails 2.3.18
Since v2.3.18Signature
decrypt(encrypted_message)
No documentation comment.
Parameters
-
encrypted_messagereq
Source
# File activesupport/lib/active_support/message_encryptor.rb, line 35
def decrypt(encrypted_message)
cipher = new_cipher
encrypted_data, iv = encrypted_message.split("--").map {|v| ActiveSupport::Base64.decode64(v)}
cipher.decrypt
cipher.key = @secret
cipher.iv = iv
decrypted_data = cipher.update(encrypted_data)
decrypted_data << cipher.final
Marshal.load(decrypted_data)
rescue OpenSSLCipherError, TypeError
raise InvalidMessage
end
Defined in activesupport/lib/active_support/message_encryptor.rb line 35
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::MessageEncryptor