4187ef4b49654783bc62ddb43a0aa9a81ae3bfae
[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 outputs a
44 SEQUENCE of the public key component, p, q and g respectively.
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.
48
49 =item B<-outform DER|PEM>
50
51 This specifies the output format, the options have the same meaning as the 
52 B<-inform> option.
53
54 =item B<-in filename>
55
56 This specifies the input filename to read a key from or standard input if this
57 option is not specified. If the key is encrypted a pass phrase will be
58 prompted for.
59
60 =item B<-passin password>
61
62 the input file password. Since certain utilities like "ps" make the command line
63 visible this option should be used with caution.
64
65 =item B<-envpassin var>
66
67 read the input file password from the environment variable B<var>.
68
69 =item B<-out filename>
70
71 This specifies the output filename to write a key to or standard output by
72 is not specified. If any encryption options are set then a pass phrase will be
73 prompted for. The output filename should B<not> be the same as the input
74 filename.
75
76 =item B<-passout password>
77
78 the output file password. Since certain utilities like "ps" make the command line
79 visible this option should be used with caution.
80
81 =item B<-envpassout var>
82
83 read the output file password from the environment variable B<var>.
84
85 =item B<-des|-des3|-idea>
86
87 These options encrypt the private key with the DES, triple DES, or the 
88 IDEA ciphers respectively before outputting it. A pass phrase is prompted for.
89 If none of these options is specified the key is written in plain text. This
90 means that using the B<rsa> utility to read in an encrypted key with no
91 encryption option can be used to remove the pass phrase from a key, or by
92 setting the encryption options it can be use to add or change the pass phrase.
93 These options can only be used with PEM format output files.
94
95 =item B<-text>
96
97 prints out the public, private key components and parameters.
98
99 =item B<-noout>
100
101 this option prevents output of the encoded version of the key.
102
103 =item B<-modulus>
104
105 this option prints out the value of the public key component of the key.
106
107 =item B<-pubin>
108
109 by default a private key is input file with this option a public key is input
110 instead.
111
112 =item B<-pubout>
113
114 by default a private key is output. With this option a public
115 key will be output instead. This option is automatically set if the input is
116 a public key.
117
118 =back
119
120 =head1 NOTES
121
122 The PEM private key format uses the header and footer lines:
123
124  -----BEGIN DSA PRIVATE KEY-----
125  -----END DSA PRIVATE KEY-----
126
127 =head1 EXAMPLES
128
129 To remove the pass phrase on a DSA private key:
130
131 C<openssl dsa -in key.pem -out keyout.pem>
132
133 To encrypt a private key using triple DES:
134
135 C<openssl dsa -in key.pem -des3 -out keyout.pem>
136
137 To convert a private key from PEM to DER format: 
138
139 C<openssl dsa -in key.pem -outform DER -out keyout.der>
140
141 To print out the components of a private key to standard output:
142
143 C<openssl dsa -in key.pem -text -noout>
144
145 To just output the public part of a private key:
146
147 C<openssl dsa -in key.pem -pubout -out pubkey.pem>
148
149 =head1 SEE ALSO
150
151 dsaparam(1), gendsa(1), rsa(1), genrsa(1)
152
153 =cut