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.pubRelated terms
- openssl genpkey — The OpenSSL subcommand that generates a new private key, such as an Ed25519 or RSA key, and writes it to a file.
- public key — The shareable half of a key pair, used by others to verify your signatures or encrypt data only you can read.
- OpenSSL — A widely used toolkit and library for cryptography and TLS, including the openssl command-line tool.
- PEM — A text format for storing keys and certificates, where the binary data is written as Base64 between labelled begin and end lines.
Taught in
- CIA Triad, Non-Repudiation & Parkerian Hexad — Cybersecurity Fundamentals, GRC & Cryptography