Method: ActiveSupport::MessageVerifier#valid_message?
- Defined in:
- lib/active_support/message_verifier.rb
#valid_message?(message) ⇒ Boolean
Checks if a signed message could have been generated by signing an object with the MessageVerifier
‘s secret.
verifier = ActiveSupport::MessageVerifier.new("secret")
= verifier.generate("signed message")
verifier.() # => true
= .chop # editing the message invalidates the signature
verifier.() # => false
169 170 171 |
# File 'lib/active_support/message_verifier.rb', line 169 def () !!catch_and_ignore(:invalid_message_format) { extract_encoded() } end |