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