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 outputs a
44 SEQUENCE of the public key component, p, q and g respectively.
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.
49 =item B<-outform DER|PEM>
51 This specifies the output format, the options have the same meaning as the
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
60 =item B<-passin password>
62 the input file password. Since certain utilities like "ps" make the command line
63 visible this option should be used with caution.
65 =item B<-envpassin var>
67 read the input file password from the environment variable B<var>.
69 =item B<-out filename>
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
76 =item B<-passout password>
78 the output file password. Since certain utilities like "ps" make the command line
79 visible this option should be used with caution.
81 =item B<-envpassout var>
83 read the output file password from the environment variable B<var>.
85 =item B<-des|-des3|-idea>
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.
97 prints out the public, private key components and parameters.
101 this option prevents output of the encoded version of the key.
105 this option prints out the value of the public key component of the key.
109 by default a private key is input file with this option a public key is input
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
122 The PEM private key format uses the header and footer lines:
124 -----BEGIN DSA PRIVATE KEY-----
125 -----END DSA PRIVATE KEY-----
129 To remove the pass phrase on a DSA private key:
131 C<openssl dsa -in key.pem -out keyout.pem>
133 To encrypt a private key using triple DES:
135 C<openssl dsa -in key.pem -des3 -out keyout.pem>
137 To convert a private key from PEM to DER format:
139 C<openssl dsa -in key.pem -outform DER -out keyout.der>
141 To print out the components of a private key to standard output:
143 C<openssl dsa -in key.pem -text -noout>
145 To just output the public part of a private key:
147 C<openssl dsa -in key.pem -pubout -out pubkey.pem>
151 dsaparam(1), gendsa(1), rsa(1), genrsa(1)