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