RT1941: c_rehash.pod is missing
[openssl.git] / doc / apps / dsa.pod
1 =pod
2
3 =head1 NAME
4
5 dsa - DSA key processing
6
7 =head1 SYNOPSIS
8
9 B<openssl> B<dsa>
10 [B<-inform PEM|DER>]
11 [B<-outform PEM|DER>]
12 [B<-in filename>]
13 [B<-passin arg>]
14 [B<-out filename>]
15 [B<-passout arg>]
16 [B<-aes128>]
17 [B<-aes192>]
18 [B<-aes256>]
19 [B<-camellia128>]
20 [B<-camellia192>]
21 [B<-camellia256>]
22 [B<-des>]
23 [B<-des3>]
24 [B<-idea>]
25 [B<-text>]
26 [B<-noout>]
27 [B<-modulus>]
28 [B<-pubin>]
29 [B<-pubout>]
30 [B<-engine id>]
31
32 =head1 DESCRIPTION
33
34 The B<dsa> command processes DSA keys. They can be converted between various
35 forms and their components printed out. B<Note> This command uses the
36 traditional SSLeay compatible format for private key encryption: newer
37 applications should use the more secure PKCS#8 format using the B<pkcs8>
38
39 =head1 COMMAND OPTIONS
40
41 =over 4
42
43 =item B<-inform DER|PEM>
44
45 This specifies the input format. The B<DER> option with a private key uses
46 an ASN1 DER encoded form of an ASN.1 SEQUENCE consisting of the values of
47 version (currently zero), p, q, g, the public and private key components
48 respectively as ASN.1 INTEGERs. When used with a public key it uses a
49 SubjectPublicKeyInfo structure: it is an error if the key is not DSA.
50
51 The B<PEM> form is the default format: it consists of the B<DER> format base64
52 encoded with additional header and footer lines. In the case of a private key
53 PKCS#8 format is also accepted.
54
55 =item B<-outform DER|PEM>
56
57 This specifies the output format, the options have the same meaning as the 
58 B<-inform> option.
59
60 =item B<-in filename>
61
62 This specifies the input filename to read a key from or standard input if this
63 option is not specified. If the key is encrypted a pass phrase will be
64 prompted for.
65
66 =item B<-passin arg>
67
68 the input file password source. For more information about the format of B<arg>
69 see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
70
71 =item B<-out filename>
72
73 This specifies the output filename to write a key to or standard output by
74 is not specified. If any encryption options are set then a pass phrase will be
75 prompted for. The output filename should B<not> be the same as the input
76 filename.
77
78 =item B<-passout arg>
79
80 the output file password source. For more information about the format of B<arg>
81 see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
82
83 =item B<-aes128|-aes192|-aes256|-camellia128|-camellia192|-camellia256|-des|-des3|-idea>
84
85 These options encrypt the private key with the specified
86 cipher before outputting it. A pass phrase is prompted for.
87 If none of these options is specified the key is written in plain text. This
88 means that using the B<dsa> utility to read in an encrypted key with no
89 encryption option can be used to remove the pass phrase from a key, or by
90 setting the encryption options it can be use to add or change the pass phrase.
91 These options can only be used with PEM format output files.
92
93 =item B<-text>
94
95 prints out the public, private key components and parameters.
96
97 =item B<-noout>
98
99 this option prevents output of the encoded version of the key.
100
101 =item B<-modulus>
102
103 this option prints out the value of the public key component of the key.
104
105 =item B<-pubin>
106
107 by default a private key is read from the input file: with this option a
108 public key is read instead.
109
110 =item B<-pubout>
111
112 by default a private key is output. With this option a public
113 key will be output instead. This option is automatically set if the input is
114 a public key.
115
116 =item B<-engine id>
117
118 specifying an engine (by its unique B<id> string) will cause B<dsa>
119 to attempt to obtain a functional reference to the specified engine,
120 thus initialising it if needed. The engine will then be set as the default
121 for all available algorithms.
122
123 =back
124
125 =head1 NOTES
126
127 The PEM private key format uses the header and footer lines:
128
129  -----BEGIN DSA PRIVATE KEY-----
130  -----END DSA PRIVATE KEY-----
131
132 The PEM public key format uses the header and footer lines:
133
134  -----BEGIN PUBLIC KEY-----
135  -----END PUBLIC KEY-----
136
137 =head1 EXAMPLES
138
139 To remove the pass phrase on a DSA private key:
140
141  openssl dsa -in key.pem -out keyout.pem
142
143 To encrypt a private key using triple DES:
144
145  openssl dsa -in key.pem -des3 -out keyout.pem
146
147 To convert a private key from PEM to DER format: 
148
149  openssl dsa -in key.pem -outform DER -out keyout.der
150
151 To print out the components of a private key to standard output:
152
153  openssl dsa -in key.pem -text -noout
154
155 To just output the public part of a private key:
156
157  openssl dsa -in key.pem -pubout -out pubkey.pem
158
159 =head1 SEE ALSO
160
161 L<dsaparam(1)|dsaparam(1)>, L<gendsa(1)|gendsa(1)>, L<rsa(1)|rsa(1)>,
162 L<genrsa(1)|genrsa(1)>
163
164 =cut