5 dsa - DSA key processing
27 The B<dsa> command processes DSA keys. They can be converted between various
28 forms and their components printed out. B<Note> This command uses the
29 traditional SSLeay compatible format for private key encryption: newer
30 applications should use the more secure PKCS#8 format using the B<pkcs8>
32 =head1 COMMAND OPTIONS
36 =item B<-inform DER|PEM>
38 This specifies the input format. The B<DER> option with a private key uses
39 an ASN1 DER encoded form of an ASN.1 SEQUENCE consisting of the values of
40 version (currently zero), p, q, g, the public and private key components
41 respectively as ASN.1 INTEGERs. When used with a public key it uses a
42 SubjectPublicKeyInfo structure: it is an error if the key is not DSA.
44 The B<PEM> form is the default format: it consists of the B<DER> format base64
45 encoded with additional header and footer lines. In the case of a private key
46 PKCS#8 format is also accepted.
48 =item B<-outform DER|PEM>
50 This specifies the output format, the options have the same meaning as the
55 This specifies the input filename to read a key from or standard input if this
56 option is not specified. If the key is encrypted a pass phrase will be
61 the input file password source. For more information about the format of B<arg>
62 see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
64 =item B<-out filename>
66 This specifies the output filename to write a key to or standard output by
67 is not specified. If any encryption options are set then a pass phrase will be
68 prompted for. The output filename should B<not> be the same as the input
73 the output file password source. For more information about the format of B<arg>
74 see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
76 =item B<-des|-des3|-idea>
78 These options encrypt the private key with the DES, triple DES, or the
79 IDEA ciphers respectively before outputting it. A pass phrase is prompted for.
80 If none of these options is specified the key is written in plain text. This
81 means that using the B<dsa> utility to read in an encrypted key with no
82 encryption option can be used to remove the pass phrase from a key, or by
83 setting the encryption options it can be use to add or change the pass phrase.
84 These options can only be used with PEM format output files.
88 prints out the public, private key components and parameters.
92 this option prevents output of the encoded version of the key.
96 this option prints out the value of the public key component of the key.
100 by default a private key is read from the input file: with this option a
101 public key is read instead.
105 by default a private key is output. With this option a public
106 key will be output instead. This option is automatically set if the input is
113 The PEM private key format uses the header and footer lines:
115 -----BEGIN DSA PRIVATE KEY-----
116 -----END DSA PRIVATE KEY-----
118 The PEM public key format uses the header and footer lines:
120 -----BEGIN PUBLIC KEY-----
121 -----END PUBLIC KEY-----
125 To remove the pass phrase on a DSA private key:
127 openssl dsa -in key.pem -out keyout.pem
129 To encrypt a private key using triple DES:
131 openssl dsa -in key.pem -des3 -out keyout.pem
133 To convert a private key from PEM to DER format:
135 openssl dsa -in key.pem -outform DER -out keyout.der
137 To print out the components of a private key to standard output:
139 openssl dsa -in key.pem -text -noout
141 To just output the public part of a private key:
143 openssl dsa -in key.pem -pubout -out pubkey.pem
147 L<dsaparam(1)|dsaparam(1)>, L<gendsa(1)|gendsa(1)>, L<rsa(1)|rsa(1)>,
148 L<genrsa(1)|genrsa(1)>