5 dsa - DSA key processing
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>
39 =head1 COMMAND OPTIONS
43 =item B<-inform DER|PEM>
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.
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.
55 =item B<-outform DER|PEM>
57 This specifies the output format, the options have the same meaning as the
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
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)>.
71 =item B<-out filename>
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
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)>.
83 =item B<-aes128|-aes192|-aes256|-camellia128|-camellia192|-camellia256|-des|-des3|-idea>
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.
95 prints out the public, private key components and parameters.
99 this option prevents output of the encoded version of the key.
103 this option prints out the value of the public key component of the key.
107 by default a private key is read from the input file: with this option a
108 public key is read instead.
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
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.
127 The PEM private key format uses the header and footer lines:
129 -----BEGIN DSA PRIVATE KEY-----
130 -----END DSA PRIVATE KEY-----
132 The PEM public key format uses the header and footer lines:
134 -----BEGIN PUBLIC KEY-----
135 -----END PUBLIC KEY-----
139 To remove the pass phrase on a DSA private key:
141 openssl dsa -in key.pem -out keyout.pem
143 To encrypt a private key using triple DES:
145 openssl dsa -in key.pem -des3 -out keyout.pem
147 To convert a private key from PEM to DER format:
149 openssl dsa -in key.pem -outform DER -out keyout.der
151 To print out the components of a private key to standard output:
153 openssl dsa -in key.pem -text -noout
155 To just output the public part of a private key:
157 openssl dsa -in key.pem -pubout -out pubkey.pem
161 L<dsaparam(1)|dsaparam(1)>, L<gendsa(1)|gendsa(1)>, L<rsa(1)|rsa(1)>,
162 L<genrsa(1)|genrsa(1)>