Skip to content

Instantly share code, notes, and snippets.

@divoxx
Created September 4, 2009 18:22
Show Gist options
  • Save divoxx/181019 to your computer and use it in GitHub Desktop.
Save divoxx/181019 to your computer and use it in GitHub Desktop.
key = PKey::RSA.new(@certificate, passphrase)
data = "foobar"
signed = key.sign(OpenSSL::Digest::SHA1.new, data)
key.verify(OpenSSL::Digest::SHA1.new, signed, data) # => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment