Module: AsymmetricOpenSSL

Defined in:
lib/ruby-common/v4/AsymmetricOpenSSL.rb

Class Method Summary collapse

Class Method Details

.verify_data(data, token, public_key_pem) ⇒ Object



6
7
8
9
10
# File 'lib/ruby-common/v4/AsymmetricOpenSSL.rb', line 6

def self.verify_data(data, token, public_key_pem)
  pub_key = OpenSSL::PKey::EC.new(public_key_pem)
  digest = OpenSSL::Digest.new('sha256')
  pub_key.verify(digest,token, data)
end