Last active
March 17, 2020 07:21
-
-
Save alecguintu/60ccd8f0cc0c2ed5e8a1748b70897734 to your computer and use it in GitHub Desktop.
This file contains 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
def verify_response(response, response_signature) | |
public_key_pem = File.read(Rails.root.join('config', 'gcash-public-key2.pem')) | |
public_key = OpenSSL::PKey::RSA.new(public_key_pem) | |
signature_dest = Base64.strict_decode64(response_signature) | |
public_key.verify(OpenSSL::Digest::SHA256.new, signature_dest, response.to_json) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment