Skip to content

Instantly share code, notes, and snippets.

@ggrandes
Created March 3, 2014 13:37
Show Gist options
  • Save ggrandes/9325051 to your computer and use it in GitHub Desktop.
Save ggrandes/9325051 to your computer and use it in GitHub Desktop.
OpenSSL RSA file Signature / Verify
# Generate RSA Key-Pair
openssl genrsa -out test.key 2048
openssl rsa -pubout -in test.key -out test.pub
# Signature
openssl dgst -sha512 -sign test.key some-file.txt | openssl enc -a -e > some-file.txt.sign
# Verify
openssl enc -a -d < some-file.txt.sign | openssl dgst -sha512 -verify test.pub -signature /dev/stdin some-file.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment