Sha256: 2ff52ee40caeca7ff4ec3542e94d02cc68776ae24fcf994c24ed11e5ea915e91
Contents?: true
Size: 384 Bytes
Versions: 5
Compression:
Stored size: 384 Bytes
Contents
require 'openssl' require 'base64' module Alipay module Sign class RSA def self.sign(key, string) rsa = OpenSSL::PKey::RSA.new(key) Base64.encode64(rsa.sign('sha1', string)) end def self.verify?(key, string, sign) rsa = OpenSSL::PKey::RSA.new(key) rsa.verify('sha1', Base64.decode64(sign), string) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems