mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Update MessageEncryptor guide to show that an exception is raised
swap order
This commit is contained in:
parent
fdf5e0054a
commit
4860d8534b
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue