skip book previous and next navigation links
go up to top of book: HP Open Source Security for OpenVMS Volume 2:... HP Open Source Security for OpenVMS Volume 2:...
go to beginning of reference: OpenSSL Command Line Interface (CLI) Reference OpenSSL Command Line Interface (CLI) Reference
go to previous page: req req
go to next page: rsautlrsautl
end of book navigation links


rsa
Description
Notes
Restrictions
 Command Options
Examples
See Also

NAME

rsa - RSA key processing tool

Synopsis  

openssl rsa [-inform PEM|NET|DER] [-outform PEM|NET|DER] [-in filename] [-passin arg] [-out filename] [-passout arg] [-sgckey] [-des] [-des3] [-idea] [-text] [-noout] [-modulus] [-check] [-pubin] [-pubout] [-engine id]


return to top DESCRIPTION  

The rsa command processes RSA keys. They can be converted between various forms and their components printed out.

Note: This command uses the traditional SSLeay compatible format for private key encryption: newer applications should use the more secure PKCS#8 format using the pkcs8 utility.


return to top COMMAND OPTIONS  


return to top NOTES  

The PEM private key format uses the header and footer lines:
 -----BEGIN RSA PRIVATE KEY-----
 -----END RSA PRIVATE KEY-----
The PEM public key format uses the header and footer lines:
 -----BEGIN PUBLIC KEY-----
 -----END PUBLIC KEY-----
The NET form is a format compatible with older Netscape servers and Microsoft IIS .key files, this uses unsalted RC4 for its encryption. It is not very secure and so should only be used when necessary.

Some newer version of IIS have additional data in the exported .key files. To use these with the utility, view the file with a binary editor and look for the string "private-key", then trace back to the byte sequence 0x30, 0x82 (this is an ASN1 SEQUENCE). Copy all the data from this point onwards to another file and use that as the input to the rsa utility with the -inform NET option. If you get an error after entering the password try the -sgckey option.


return to top EXAMPLES  

To remove the pass phrase on an RSA private key:
 openssl rsa -in key.pem -out keyout.pem
To encrypt a private key using triple DES:
 openssl rsa -in key.pem -des3 -out keyout.pem
To convert a private key from PEM to DER format:
 openssl rsa -in key.pem -outform DER -out keyout.der
To print out the components of a private key to standard output:
 openssl rsa -in key.pem -text -noout
To just output the public part of a private key:
 openssl rsa -in key.pem -pubout -out pubkey.pem


return to top Restrictions  

The command line password arguments don't currently work with NET format.

There should be an option that automatically handles .key files, without having to manually edit them.


return to top SEE ALSO  

pkcs8(1), dsa(1) , genrsa(1) , gendsa(1)
go to previous page: req req
go to next page: rsautlrsautl