-
-
Save epitron/453657e1ae31501d51f171754693aa7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: /home/epi/.gem/ruby/2.3.0/gems/paypal-sdk-rest-1.4.7/lib/paypal-sdk/rest/data_types.rb @ line 1300: | |
Owner: #<Class:PayPal::SDK::REST::DataTypes::WebhookEvent> | |
Visibility: public | |
Number of lines: 9 | |
def verify_signature(transmission_id, timestamp, webhook_id, event_body, cert, actual_sig_encoded, algo) | |
expected_sig = get_expected_sig(transmission_id, timestamp, webhook_id, event_body) | |
digest = OpenSSL::Digest.new(algo) | |
digest.update(expected_sig) | |
actual_sig = Base64.decode64(actual_sig_encoded).force_encoding('UTF-8') | |
cert.public_key.verify(digest, actual_sig, expected_sig) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment