Flowdock
method

valid_message?

Importance_1
Ruby on Rails latest stable (v5.2.3) - 0 notes - Class: ActiveSupport::MessageVerifier
valid_message?(signed_message) public

Checks if a signed message could have been generated by signing an object with the MessageVerifier's secret.

verifier = ActiveSupport::MessageVerifier.new 's3Krit'
signed_message = verifier.generate 'a private message'
verifier.valid_message?(signed_message) # => true

tampered_message = signed_message.chop # editing the message invalidates the signature
verifier.valid_message?(tampered_message) # => false
Show source
Register or log in to add new notes.