Add support for Compaq Atalla crypto accelerator.
[openssl.git] / doc / apps / rsa.pod
1
2 =pod
3
4 =head1 NAME
5
6 rsa - RSA key processing tool
7
8 =head1 SYNOPSIS
9
10 B<openssl> B<rsa>
11 [B<-inform PEM|NET|DER>]
12 [B<-outform PEM|NET|DER>]
13 [B<-in filename>]
14 [B<-passin password>]
15 [B<-envpassin var>]
16 [B<-out filename>]
17 [B<-passout password>]
18 [B<-envpassout var>]
19 [B<-des>]
20 [B<-des3>]
21 [B<-idea>]
22 [B<-text>]
23 [B<-noout>]
24 [B<-modulus>]
25 [B<-check>]
26 [B<-pubin>]
27 [B<-pubout>]
28
29 =head1 DESCRIPTION
30
31 The B<rsa> command processes RSA keys. They can be converted between various
32 forms and their components printed out. B<Note> this command uses the
33 traditional SSLeay compatible format for private key encryption: newer
34 applications should use the more secure PKCS#8 format using the B<pkcs8>
35 utility.
36
37 =head1 COMMAND OPTIONS
38
39 =over 4
40
41 =item B<-inform DER|NET|PEM>
42
43 This specifies the input format. The B<DER> option uses an ASN1 DER encoded
44 form compatible with the PKCS#1 RSAPrivateKey or SubjectPublicKeyInfo format.
45 The B<PEM> form is the default format: it consists of the B<DER> format base64
46 encoded with additional header and footer lines. On input PKCS#8 format private
47 keys are also accepted. The B<NET> form is a format compatible with older Netscape
48 servers and MS IIS, this uses unsalted RC4 for its encryption. It is not very
49 secure and so should only be used when necessary.
50
51 =item B<-outform DER|NET|PEM>
52
53 This specifies the output format, the options have the same meaning as the 
54 B<-inform> option.
55
56 =item B<-in filename>
57
58 This specifies the input filename to read a key from or standard input if this
59 option is not specified. If the key is encrypted a pass phrase will be
60 prompted for.
61
62 =item B<-passin password>
63
64 the input file password. Since certain utilities like "ps" make the command line
65 visible this option should be used with caution.
66
67 =item B<-envpassin var>
68
69 read the input file password from the environment variable B<var>.
70
71 =item B<-out filename>
72
73 This specifies the output filename to write a key to or standard output if this
74 option is not specified. If any encryption options are set then a pass phrase
75 will be prompted for. The output filename should B<not> be the same as the input
76 filename.
77
78 =item B<-passout password>
79
80 the output file password. Since certain utilities like "ps" make the command line
81 visible this option should be used with caution.
82
83 =item B<-envpassout var>
84
85 read the output file password from the environment variable B<var>.
86
87 =item B<-des|-des3|-idea>
88
89 These options encrypt the private key with the DES, triple DES, or the 
90 IDEA ciphers respectively before outputting it. A pass phrase is prompted for.
91 If none of these options is specified the key is written in plain text. This
92 means that using the B<rsa> utility to read in an encrypted key with no
93 encryption option can be used to remove the pass phrase from a key, or by
94 setting the encryption options it can be use to add or change the pass phrase.
95 These options can only be used with PEM format output files.
96
97 =item B<-text>
98
99 prints out the various public or private key components in
100 plain text in addition to the encoded version. 
101
102 =item B<-noout>
103
104 this option prevents output of the encoded version of the key.
105
106 =item B<-modulus>
107
108 this option prints out the value of the modulus of the key.
109
110 =item B<-check>
111
112 this option checks the consistency of an RSA private key.
113
114 =item B<-pubin>
115
116 by default a private key is read from the input file: with this
117 option a public key is read instead.
118
119 =item B<-pubout>
120
121 by default a private key is output: with this option a public
122 key will be output instead. This option is automatically set if
123 the input is a public key.
124
125 =back
126
127 =head1 NOTES
128
129 The PEM private key format uses the header and footer lines:
130
131  -----BEGIN RSA PRIVATE KEY-----
132  -----END RSA PRIVATE KEY-----
133
134 The PEM public key format uses the header and footer lines:
135
136  -----BEGIN PUBLIC KEY-----
137  -----END PUBLIC KEY-----
138
139 =head1 EXAMPLES
140
141 To remove the pass phrase on an RSA private key:
142
143  openssl rsa -in key.pem -out keyout.pem
144
145 To encrypt a private key using triple DES:
146
147  openssl rsa -in key.pem -des3 -out keyout.pem
148
149 To convert a private key from PEM to DER format: 
150
151  openssl rsa -in key.pem -outform DER -out keyout.der
152
153 To print out the components of a private key to standard output:
154
155  openssl rsa -in key.pem -text -noout
156
157 To just output the public part of a private key:
158
159  openssl rsa -in key.pem -pubout -out pubkey.pem
160
161 =head1 SEE ALSO
162
163 L<pkcs8(1)|pkcs8(1)>, L<dsa(1)|dsa(1)>, L<genrsa(1)|genrsa(1)>,
164 L<gendsa(1)|gendsa(1)> 
165
166 =cut