Name

rsa

Synopsis

The rsa command is used modify RSA private keys or examine their contents. The command may be used to remove encryption from a private key, add it to a private key, or change the encryption that is used on a private key. The command can also be used to compute a public key from a private key.

Options

-in filename

Specify the name of a file from which an RSA private key will be read. If no file is specified, stdin is used.

-inform DER|NET|PEM

Specify the format—DER, NET, or PEM—of the key that is read as input. If this option is omitted, the default format is PEM.

-out filename

Specify the name of a file to which the output from this command will be written. If this option is omitted, stdout will be used.

-outform DER|NET|PEM

Specify the format—DER, NET or PEM—of the key that is written. If this option is omitted, the default format is PEM.

-pubin

Cause the input key to be interpreted as a public key.

-pubout

Cause the output key to be interpreted as a public key.

-passin password

Specify the password to use to decrypt the input key. This option follows the password and passphrase guidelines outlined in Chapter 2.

-passout password

Specify the password to use to encrypt the output key. This option follows the password and passphrase guidelines outlined in Chapter 2.

-des, -des3, -idea

Specify the cipher to use to encrypt the private key. If this option is omitted, the private key that is written out by this command will not be encrypted.

-noout

Cause the output of the key in DER or PEM format to be suppressed.

-text

Cause the input key, public or private, to be output in a human-readable form.

-modulus

Cause the modulus of the public key to be written to the output destination.

-check

Specify this option to check the consistency of an RSA private key.

-sgckey

Cause a modified form of the NET format used by some versions of Microsoft IIS and old Netscape servers to be used for the output key. This format is not very secure, so it should be used only if necessary.

Notes

When producing private keys using the sgckey option, the passout option is currently ignored. The command will not read some forms of an unmodified NET format private key because they contain additional data. To use these keys with this command, try editing the key with a binary editor and removing all of the data in the file prior to the byte sequence 0x30, 0x82. Do not remove this byte sequence; it should be included in the resulting file.