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