Created
February 12, 2015 02:40
-
-
Save jag3773/d39e1e8b58b86bc4441a to your computer and use it in GitHub Desktop.
Openssl Digital Signature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[jesse@jesse python-ecdsa]$ openssl ecparam -list_curves | |
secp384r1 : NIST/SECG curve over a 384 bit prime field | |
secp521r1 : NIST/SECG curve over a 521 bit prime field | |
prime256v1: X9.62/SECG curve over a 256 bit prime field | |
[jesse@jesse python-ecdsa]$ openssl ecparam -name secp384r1 -genkey -out sk.pem | |
[jesse@jesse python-ecdsa]$ openssl ec -in sk.pem -pubout -out vk.pem | |
read EC key | |
writing EC key | |
[jesse@jesse python-ecdsa]$ cat vk.pem | |
-----BEGIN PUBLIC KEY----- | |
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEPRmbGSh2XCBI8ZqgqczYahJuZOzFcid9 | |
87CJbihwCPjdSIjqkyEZy7Rw48pNnpA+96yT5LgNOqUqMsRoVCvN/tZzO3YA2GAs | |
NNXz2v/n8yeF9y1Tg+z9rRSxQN/PQLkE | |
-----END PUBLIC KEY----- | |
[jesse@jesse python-ecdsa]$ wget -q https://api.unfoldingword.org/obs/txt/1/en/obs-en.json | |
[jesse@jesse python-ecdsa]$ openssl dgst -ecdsa-with-SHA1 -sign sk.pem -out obs-en.sig obs-en.json | |
[jesse@jesse python-ecdsa]$ openssl dgst -ecdsa-with-SHA1 -verify vk.pem -signature obs-en.sig obs-en.json | |
Verified OK | |
[jesse@jesse python-ecdsa]$ openssl dgst -ecdsa-with-SHA1 -prverify sk.pem -signature obs-en.sig obs-en.json | |
Verified OK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment