openssl pkey

The OpenSSL subcommand that reads a key file to display it, convert its format or extract the public key from a private key.

In more detail

The most common use is -pubout, which writes the public half of a private key so it can be shared safely. It can also print key details with -text, change the file encoding, and add or remove passphrase protection. It never creates a new key; that is the job of openssl genpkey.

Example

openssl pkey -in alice.key -pubout -out alice.pub

Related terms

Taught in

References