How to sign and verify a signature on the command line
OpenSSL provides several subcommands for signing and verifying signatures. Let’s take a look:
- The deprecated RSA-specific
openssl rsautl
subcommand. - The
openssl dgst
subcommand: This is usually used for message digest calculation but can also be used to sign the produced digests. This means that it cannot be used to sign PureEdDSA because that signature algorithm does not sign digests. - The
openssl pkeyutl
subcommand: This subcommand can be used to sign with any signature algorithm supported by OpenSSL. Before OpenSSL 3.0,openssl pkeyutl
did not support signing long inputs; the user had to make the message digest before signing. Since OpenSSL 3.0,openssl pkeyutl
supports both “raw input,” as it is called in the documentation, and a message digest as input.
We are going to use the openssl pkeyutl
subcommand for our examples. Its documentation can be found on the openssl-pkeyutl
man page...