openssl pkeyutl

The OpenSSL subcommand that performs one public-key operation with a key file: sign, verify, encrypt, decrypt or derive a shared secret.

In more detail

You pick the operation with a flag such as -sign or -verify and the key with -inkey, adding -pubin when that key is a public key. For Ed25519 you also pass -rawin, because that algorithm signs the whole message rather than a precomputed hash. A successful check prints Signature Verified Successfully and a failed one prints Signature Verification Failure.

Examples

openssl pkeyutl -sign -rawin -inkey alice.key -in order.txt -out order.sig
openssl pkeyutl -verify -rawin -pubin -inkey alice.pub -in order.txt -sigfile order.sig

Related terms

Taught in

References