Very preliminary POD format documentation for some
[openssl.git] / doc / man / 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<-out filename>]
15 [B<-des>]
16 [B<-des3>]
17 [B<-idea>]
18 [B<-text>]
19 [B<-noout>]
20 [B<-modulus>]
21 [B<-check>]
22 [B<-pubin>]
23 [B<-pubout>]
24
25 =head1 DESCRIPTION
26
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>
31 utility.
32
33 =head1 COMMAND OPTIONS
34
35 =over 4
36
37 =item B<-inform DER|NET|PEM>
38
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.
45
46 =item B<-outform DER|NET|PEM>
47
48 This specifies the output format, the options have the same meaning as the 
49 B<-inform> option.
50
51 =item B<-in filename>
52
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
55 prompted for.
56
57 =item B<-out filename>
58
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
62 filename.
63
64 =item B<-des|-des3|-idea>
65
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.
73
74 =item B<-text>
75
76 prints out the various public or private key components in
77 plain text in addition to the encoded version. 
78
79 =item B<-noout>
80
81 this option prevents output of the encoded version of the key.
82
83 =item B<-modulus>
84
85 this option prints out the value of the modulus of the key.
86
87 =item B<-check>
88
89 this option checks the consistency of an RSA private key.
90
91 =item B<-pubin>
92
93 by default a private key is input file with this option a public key is input
94 instead.
95
96 =item B<-pubout>
97
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
100 a public key.
101
102 =back
103
104 =head1 EXAMPLES
105
106 To remove the pass phrase on an RSA private key:
107
108 C<openssl rsa -in key.pem -out keyout.pem>
109
110 To encrypt a private key using triple DES:
111
112 C<openssl rsa -in key.pem -des3 -out keyout.pem>
113
114 To convert a private key from PEM to DER format: 
115
116 C<openssl rsa -in key.pem -outform DER -out keyout.der>
117
118 To print out the components of a private key to standard output:
119
120 C<openssl rsa -in key.pem -text -noout>
121
122 To just output the public part of a private key:
123
124 C<openssl rsa -in key.pem -pubout -out pubkey.pem>
125
126 =head1 CAVEATS
127
128 It should be possible to read or produce PKCS#8 format encrypted RSA keys:
129 at present it isn't.
130
131 =head1 SEE ALSO
132
133 pkcs8(1), dsa(1), genrsa(1), gendsa(1)
134
135 =cut