1DSA(1) OpenSSL DSA(1)
2
3
4
6 openssl-dsa, dsa - DSA key processing
7
9 openssl dsa [-help] [-inform PEM|DER] [-outform PEM|DER] [-in filename]
10 [-passin arg] [-out filename] [-passout arg] [-aes128] [-aes192]
11 [-aes256] [-aria128] [-aria192] [-aria256] [-camellia128]
12 [-camellia192] [-camellia256] [-des] [-des3] [-idea] [-text] [-noout]
13 [-modulus] [-pubin] [-pubout] [-engine id]
14
16 The dsa command processes DSA keys. They can be converted between
17 various forms and their components printed out. Note This command uses
18 the traditional SSLeay compatible format for private key encryption:
19 newer applications should use the more secure PKCS#8 format using the
20 pkcs8
21
23 -help
24 Print out a usage message.
25
26 -inform DER|PEM
27 This specifies the input format. The DER option with a private key
28 uses an ASN1 DER encoded form of an ASN.1 SEQUENCE consisting of
29 the values of version (currently zero), p, q, g, the public and
30 private key components respectively as ASN.1 INTEGERs. When used
31 with a public key it uses a SubjectPublicKeyInfo structure: it is
32 an error if the key is not DSA.
33
34 The PEM form is the default format: it consists of the DER format
35 base64 encoded with additional header and footer lines. In the case
36 of a private key PKCS#8 format is also accepted.
37
38 -outform DER|PEM
39 This specifies the output format, the options have the same meaning
40 and default as the -inform option.
41
42 -in filename
43 This specifies the input filename to read a key from or standard
44 input if this option is not specified. If the key is encrypted a
45 pass phrase will be prompted for.
46
47 -passin arg
48 The input file password source. For more information about the
49 format of arg see "Pass Phrase Options" in openssl(1).
50
51 -out filename
52 This specifies the output filename to write a key to or standard
53 output by is not specified. If any encryption options are set then
54 a pass phrase will be prompted for. The output filename should not
55 be the same as the input filename.
56
57 -passout arg
58 The output file password source. For more information about the
59 format of arg see "Pass Phrase Options" in openssl(1).
60
61 -aes128, -aes192, -aes256, -aria128, -aria192, -aria256, -camellia128,
62 -camellia192, -camellia256, -des, -des3, -idea
63 These options encrypt the private key with the specified cipher
64 before outputting it. A pass phrase is prompted for. If none of
65 these options is specified the key is written in plain text. This
66 means that using the dsa utility to read in an encrypted key with
67 no encryption option can be used to remove the pass phrase from a
68 key, or by setting the encryption options it can be use to add or
69 change the pass phrase. These options can only be used with PEM
70 format output files.
71
72 -text
73 Prints out the public, private key components and parameters.
74
75 -noout
76 This option prevents output of the encoded version of the key.
77
78 -modulus
79 This option prints out the value of the public key component of the
80 key.
81
82 -pubin
83 By default, a private key is read from the input file. With this
84 option a public key is read instead.
85
86 -pubout
87 By default, a private key is output. With this option a public key
88 will be output instead. This option is automatically set if the
89 input is a public key.
90
91 -engine id
92 Specifying an engine (by its unique id string) will cause dsa to
93 attempt to obtain a functional reference to the specified engine,
94 thus initialising it if needed. The engine will then be set as the
95 default for all available algorithms.
96
98 The PEM private key format uses the header and footer lines:
99
100 -----BEGIN DSA PRIVATE KEY-----
101 -----END DSA PRIVATE KEY-----
102
103 The PEM public key format uses the header and footer lines:
104
105 -----BEGIN PUBLIC KEY-----
106 -----END PUBLIC KEY-----
107
109 To remove the pass phrase on a DSA private key:
110
111 openssl dsa -in key.pem -out keyout.pem
112
113 To encrypt a private key using triple DES:
114
115 openssl dsa -in key.pem -des3 -out keyout.pem
116
117 To convert a private key from PEM to DER format:
118
119 openssl dsa -in key.pem -outform DER -out keyout.der
120
121 To print out the components of a private key to standard output:
122
123 openssl dsa -in key.pem -text -noout
124
125 To just output the public part of a private key:
126
127 openssl dsa -in key.pem -pubout -out pubkey.pem
128
130 dsaparam(1), gendsa(1), rsa(1), genrsa(1)
131
133 Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
134
135 Licensed under the OpenSSL license (the "License"). You may not use
136 this file except in compliance with the License. You can obtain a copy
137 in the file LICENSE in the source distribution or at
138 <https://www.openssl.org/source/license.html>.
139
140
141
1421.1.1k 2021-03-26 DSA(1)