mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #43334 from federicoaldunate/add-that-raises-exception-message-encryptor
Update MessageEncryptor guide to show that an exception is raised [ci-skip]
This commit is contained in:
commit
414e8dea59
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