Class: AndBilling::Security

Inherits:
Object
  • Object
show all
Defined in:
lib/andbilling.rb

Class Method Summary collapse

Class Method Details

.verify(base64_encoded_public_key, data, signature) ⇒ Object



17
18
19
20
# File 'lib/andbilling.rb', line 17

def self.verify(base64_encoded_public_key , data , signature)
  key = OpenSSL::PKey::RSA.new(Base64.decode64(base64_encoded_public_key))
  key.verify( OpenSSL::Digest::SHA1.new, Base64.decode64(signature), data )
end