Skip to content

Commit

Permalink
Update MessageEncryptor guide to show that an exception is raised
Browse files Browse the repository at this point in the history
swap order
  • Loading branch information
federicoaldunate committed Sep 29, 2021
1 parent fdf5e00 commit 4860d85
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions activesupport/lib/active_support/message_encryptor.rb
Expand Up @@ -22,6 +22,11 @@ module ActiveSupport
# crypt = ActiveSupport::MessageEncryptor.new(key) # => #<ActiveSupport::MessageEncryptor ...>
# encrypted_data = crypt.encrypt_and_sign('my secret data') # => "NlFBTTMwOUV5UlA1QlNEN2xkY2d6eThYWWh..."
# crypt.decrypt_and_verify(encrypted_data) # => "my secret data"
# The +decrypt_and_verify+ method will raise an
# <tt>ActiveSupport::MessageEncryptor::InvalidMessage</tt> exception if the data
# provided cannot be decrypted or verified.
#
# crypt.decrypt_and_verify('not encrypted data') # => ActiveSupport::MessageEncryptor::InvalidMessage
#
# === Confining messages to a specific purpose
#
Expand Down

0 comments on commit 4860d85

Please sign in to comment.