LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

openssl-pkey

general-purpose key processing tool

TLDR

View private key details
$ openssl pkey -in [private.key] -text -noout
copy
Extract public key
$ openssl pkey -in [private.key] -pubout -out [public.key]
copy
Convert to DER format
$ openssl pkey -in [private.key] -outform DER -out [private.der]
copy
Encrypt private key
$ openssl pkey -in [private.key] -aes256 -out [encrypted.key]
copy
Remove encryption
$ openssl pkey -in [encrypted.key] -out [decrypted.key]
copy
Check key validity
$ openssl pkey -in [private.key] -check
copy

SYNOPSIS

openssl pkey [options] [-in file] [-out file]

DESCRIPTION

openssl pkey is a general-purpose key processing tool. It can convert between formats, extract public keys, encrypt/decrypt private keys, and display key information.Works with RSA, EC, ED25519, and other key types.

PARAMETERS

-in file

Input file.
-out file
Output file.
-inform format
Input format (PEM, DER).
-outform format
Output format.
-pubout
Output public key.
-text
Print text form.
-noout
Don't output key.
-check
Check key.
-aes256
Encrypt output.

KEY FORMATS

$ PEM - Base64 encoded (-----BEGIN...)
DER - Binary format
copy

INSTALL

sudo apt install openssl
copy
sudo dnf install openssl
copy
sudo pacman -S openssl
copy
sudo apk add openssl
copy
sudo zypper install openssl
copy
brew install openssl
copy
nix profile install nixpkgs#openssl
copy

CAVEATS

-nodes or no encryption outputs unprotected key. Always protect private keys.

HISTORY

The pkey command provides unified key handling across different algorithms in OpenSSL.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid