6 rsa - RSA key processing tool
11 [B<-inform PEM|NET|DER>]
12 [B<-outform PEM|NET|DER>]
27 The B<rsa> command processes RSA keys. They can be converted between various
28 forms and their components printed out. B<Note> this command uses the
29 traditional SSLeay compatible format for private key encryption: newer
30 applications should use the more secure PKCS#8 format using the B<pkcs8>
33 =head1 COMMAND OPTIONS
37 =item B<-inform DER|NET|PEM>
39 This specifies the input format. The B<DER> option uses an ASN1 DER encoded
40 form compatible with the PKCS#1 RSAPrivateKey or RSAPublicKey format. The B<PEM>
41 form is the default format: it consists of the B<DER> format base64 encoded with
42 additional header and footer lines. The B<NET> form is a format compatible
43 with older Netscape servers and MS IIS, this uses unsalted RC4 for its
44 encryption It is not very secure and so should only be used when necessary.
46 =item B<-outform DER|NET|PEM>
48 This specifies the output format, the options have the same meaning as the
53 This specifies the input filename to read a key from or standard input if this
54 option is not specified. If the key is encrypted a pass phrase will be
57 =item B<-out filename>
59 This specifies the output filename to write a key to or standard output by
60 is not specified. If any encryption options are set then a pass phrase will be
61 prompted for. The output filename should B<not> be the same as the input
64 =item B<-des|-des3|-idea>
66 These options encrypt the private key with the DES, triple DES, or the
67 IDEA ciphers respectively before outputting it. A pass phrase is prompted for.
68 If none of these options is specified the key is written in plain text. This
69 means that using the B<rsa> utility to read in an encrypted key with no
70 encryption option can be used to remove the pass phrase from a key, or by
71 setting the encryption options it can be use to add or change the pass phrase.
72 These options can only be used with PEM format output files.
76 prints out the various public or private key components in
77 plain text in addition to the encoded version.
81 this option prevents output of the encoded version of the key.
85 this option prints out the value of the modulus of the key.
89 this option checks the consistency of an RSA private key.
93 by default a private key is input file with this option a public key is input
98 by default a private key is output with this option a public
99 key will be output instead. This option is automatically set if the input is
106 To remove the pass phrase on an RSA private key:
108 C<openssl rsa -in key.pem -out keyout.pem>
110 To encrypt a private key using triple DES:
112 C<openssl rsa -in key.pem -des3 -out keyout.pem>
114 To convert a private key from PEM to DER format:
116 C<openssl rsa -in key.pem -outform DER -out keyout.der>
118 To print out the components of a private key to standard output:
120 C<openssl rsa -in key.pem -text -noout>
122 To just output the public part of a private key:
124 C<openssl rsa -in key.pem -pubout -out pubkey.pem>
128 It should be possible to read or produce PKCS#8 format encrypted RSA keys:
133 pkcs8(1), dsa(1), genrsa(1), gendsa(1)