LinuxCommandLibrary

openssl-genrsa

generates RSA private keys

TLDR

Generate 2048-bit RSA key

$ openssl genrsa -out [private.key] 2048
copy
Generate 4096-bit key
$ openssl genrsa -out [private.key] 4096
copy
Generate encrypted key
$ openssl genrsa -aes256 -out [private.key] 2048
copy
Generate key to stdout
$ openssl genrsa 2048
copy

SYNOPSIS

openssl genrsa [options] [bits]

DESCRIPTION

openssl genrsa generates RSA private keys. The key can optionally be encrypted with a passphrase. Common key sizes are 2048 and 4096 bits. Output is in PEM format by default.

PARAMETERS

-out file

Output file for private key.
-aes256, -aes128, -des3
Encrypt key with algorithm.
-passout arg
Password source for encryption.
bits
Key size in bits (default 2048).

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community