Skip to content

Instantly share code, notes, and snippets.

@danielflira
Created January 15, 2020 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielflira/502a5e70733422e76c44c69c6f0689dd to your computer and use it in GitHub Desktop.
Save danielflira/502a5e70733422e76c44c69c6f0689dd to your computer and use it in GitHub Desktop.
Assinando arquivos com OpenSSL
#!/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