Skip to content

Instantly share code, notes, and snippets.

@lkdocs
Last active December 22, 2015 20:28
Show Gist options
  • Save lkdocs/6526453 to your computer and use it in GitHub Desktop.
Save lkdocs/6526453 to your computer and use it in GitHub Desktop.
require 'openssl'
def sign_data(key, data)
key.sign(OpenSSL::Digest::SHA256.new, data)
end
@jhjguxin
Copy link

jhjguxin commented Mar 6, 2014

NameError: undefined local variable or methodpackage' for main:Objectshould show me whatpackage` is?
Ths

@BryanStarbuck
Copy link

I'd also like to know what PACKAGE refers to. Can you let us know?

@jchysk
Copy link

jchysk commented Jun 17, 2014

package shouldn't be there it should be:
key.sign(OpenSSL::Digest::SHA256.new, data)
http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/PKey/PKey.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment