Created
January 15, 2020 18:17
-
-
Save danielflira/502a5e70733422e76c44c69c6f0689dd to your computer and use it in GitHub Desktop.
Assinando arquivos com 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 | |
# gerando chaves | |
openssl genrsa -out private.pem 4096 | |
openssl rsa -in private.pem -out public.pem -pubout | |
# gerando assinatura | |
openssl dgst -sign private.pem -sha256 -out sign.sha256 /bin/ls | |
# verificando assinatura | |
openssl dgst -verify public.pem -signature sign.sha256 /bin/ls; echo $? | |
openssl dgst -verify public.pem -signature sign.sha256 /bin/cat; echo $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment