Created
November 28, 2020 14:10
-
-
Save christianascone/6a6da40080d2f7ba8c4af123c9f9eeaa to your computer and use it in GitHub Desktop.
RSA sign and verify using Openssl
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
#!/bin/bash | |
#https://medium.com/@bn121rajesh/rsa-sign-and-verify-using-openssl-behind-the-scene-bf3cac0aade2 | |
openssl genrsa -out myprivate.pem 1024 | |
openssl rsa -in myprivate.pem -pubout > mypublic.pem | |
openssl dgst -sha1 -sign myprivate.pem -out sha1.sign toSign | |
openssl dgst -sha1 -verify mypublic.pem -signature sha1.sign toSign |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment