OpenSSL 3 · Converting, hashing and encrypting

Sign and verify a file

Create a signature with a private key, then check it with the public key.

openssl dgst -sha256 -sign private.key -out file.sig file.txt
openssl dgst -sha256 -verify public.key -signature file.sig file.txt

Official OpenSSL 3 documentation

More converting, hashing and encrypting commands

All converting, hashing and encrypting commands · OpenSSL 3 cheatsheet

Was this page helpful?