5 dsa - DSA key processing
16 [B<-passout password>]
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>
34 =head1 COMMAND OPTIONS
38 =item B<-inform DER|PEM>
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.
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.
50 =item B<-outform DER|PEM>
52 This specifies the output format, the options have the same meaning as the
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
61 =item B<-passin password>
63 the input file password. Since certain utilities like "ps" make the command line
64 visible this option should be used with caution.
66 =item B<-envpassin var>
68 read the input file password from the environment variable B<var>.
70 =item B<-out filename>
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
77 =item B<-passout password>
79 the output file password. Since certain utilities like "ps" make the command line
80 visible this option should be used with caution.
82 =item B<-envpassout var>
84 read the output file password from the environment variable B<var>.
86 =item B<-des|-des3|-idea>
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.
98 prints out the public, private key components and parameters.
102 this option prevents output of the encoded version of the key.
106 this option prints out the value of the public key component of the key.
110 by default a private key is input file with this option a public key is input
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
123 The PEM private key format uses the header and footer lines:
125 -----BEGIN DSA PRIVATE KEY-----
126 -----END DSA PRIVATE KEY-----
130 To remove the pass phrase on a DSA private key:
132 C<openssl dsa -in key.pem -out keyout.pem>
134 To encrypt a private key using triple DES:
136 C<openssl dsa -in key.pem -des3 -out keyout.pem>
138 To convert a private key from PEM to DER format:
140 C<openssl dsa -in key.pem -outform DER -out keyout.der>
142 To print out the components of a private key to standard output:
144 C<openssl dsa -in key.pem -text -noout>
146 To just output the public part of a private key:
148 C<openssl dsa -in key.pem -pubout -out pubkey.pem>
152 dsaparam(1), gendsa(1), rsa(1), genrsa(1)