openssl-dsa.1ossl 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "OPENSSL-DSA 1ossl"
  58. .TH OPENSSL-DSA 1ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. openssl\-dsa \- DSA key processing
  65. .SH SYNOPSIS
  66. .IX Header "SYNOPSIS"
  67. \&\fBopenssl\fR \fBdsa\fR
  68. [\fB\-help\fR]
  69. [\fB\-inform\fR \fBDER\fR|\fBPEM\fR]
  70. [\fB\-outform\fR \fBDER\fR|\fBPEM\fR]
  71. [\fB\-in\fR \fIfilename\fR]
  72. [\fB\-passin\fR \fIarg\fR]
  73. [\fB\-out\fR \fIfilename\fR]
  74. [\fB\-passout\fR \fIarg\fR]
  75. [\fB\-aes128\fR]
  76. [\fB\-aes192\fR]
  77. [\fB\-aes256\fR]
  78. [\fB\-aria128\fR]
  79. [\fB\-aria192\fR]
  80. [\fB\-aria256\fR]
  81. [\fB\-camellia128\fR]
  82. [\fB\-camellia192\fR]
  83. [\fB\-camellia256\fR]
  84. [\fB\-des\fR]
  85. [\fB\-des3\fR]
  86. [\fB\-idea\fR]
  87. [\fB\-text\fR]
  88. [\fB\-noout\fR]
  89. [\fB\-modulus\fR]
  90. [\fB\-pubin\fR]
  91. [\fB\-pubout\fR]
  92. [\fB\-pvk\-strong\fR]
  93. [\fB\-pvk\-weak\fR]
  94. [\fB\-pvk\-none\fR]
  95. [\fB\-engine\fR \fIid\fR]
  96. [\fB\-provider\fR \fIname\fR]
  97. [\fB\-provider\-path\fR \fIpath\fR]
  98. [\fB\-propquery\fR \fIpropq\fR]
  99. .SH DESCRIPTION
  100. .IX Header "DESCRIPTION"
  101. This command processes DSA keys. They can be converted between various
  102. forms and their components printed out. \fBNote\fR This command uses the
  103. traditional SSLeay compatible format for private key encryption: newer
  104. applications should use the more secure PKCS#8 format using the \fBpkcs8\fR
  105. .SH OPTIONS
  106. .IX Header "OPTIONS"
  107. .IP \fB\-help\fR 4
  108. .IX Item "-help"
  109. Print out a usage message.
  110. .IP "\fB\-inform\fR \fBDER\fR|\fBPEM\fR" 4
  111. .IX Item "-inform DER|PEM"
  112. The key input format; unspecified by default.
  113. See \fBopenssl\-format\-options\fR\|(1) for details.
  114. .IP "\fB\-outform\fR \fBDER\fR|\fBPEM\fR" 4
  115. .IX Item "-outform DER|PEM"
  116. The key output format; the default is \fBPEM\fR.
  117. See \fBopenssl\-format\-options\fR\|(1) for details.
  118. .Sp
  119. Private keys are a sequence of \fBASN.1 INTEGERS\fR: the version (zero), \fBp\fR,
  120. \&\fBq\fR, \fBg\fR, and the public and private key components. Public keys
  121. are a \fBSubjectPublicKeyInfo\fR structure with the \fBDSA\fR type.
  122. .Sp
  123. The \fBPEM\fR format also accepts PKCS#8 data.
  124. .IP "\fB\-in\fR \fIfilename\fR" 4
  125. .IX Item "-in filename"
  126. This specifies the input filename to read a key from or standard input if this
  127. option is not specified. If the key is encrypted a pass phrase will be
  128. prompted for.
  129. .IP "\fB\-out\fR \fIfilename\fR" 4
  130. .IX Item "-out filename"
  131. This specifies the output filename to write a key to or standard output by
  132. is not specified. If any encryption options are set then a pass phrase will be
  133. prompted for. The output filename should \fBnot\fR be the same as the input
  134. filename.
  135. .IP "\fB\-passin\fR \fIarg\fR, \fB\-passout\fR \fIarg\fR" 4
  136. .IX Item "-passin arg, -passout arg"
  137. The password source for the input and output file.
  138. For more information about the format of \fBarg\fR
  139. see \fBopenssl\-passphrase\-options\fR\|(1).
  140. .IP "\fB\-aes128\fR, \fB\-aes192\fR, \fB\-aes256\fR, \fB\-aria128\fR, \fB\-aria192\fR, \fB\-aria256\fR, \fB\-camellia128\fR, \fB\-camellia192\fR, \fB\-camellia256\fR, \fB\-des\fR, \fB\-des3\fR, \fB\-idea\fR" 4
  141. .IX Item "-aes128, -aes192, -aes256, -aria128, -aria192, -aria256, -camellia128, -camellia192, -camellia256, -des, -des3, -idea"
  142. These options encrypt the private key with the specified
  143. cipher before outputting it. A pass phrase is prompted for.
  144. If none of these options is specified the key is written in plain text. This
  145. means that this command can be used to remove the pass phrase from a key
  146. by not giving any encryption option is given, or to add or change the pass
  147. phrase by setting them.
  148. These options can only be used with PEM format output files.
  149. .IP \fB\-text\fR 4
  150. .IX Item "-text"
  151. Prints out the public, private key components and parameters.
  152. .IP \fB\-noout\fR 4
  153. .IX Item "-noout"
  154. This option prevents output of the encoded version of the key.
  155. .IP \fB\-modulus\fR 4
  156. .IX Item "-modulus"
  157. This option prints out the value of the public key component of the key.
  158. .IP \fB\-pubin\fR 4
  159. .IX Item "-pubin"
  160. By default, a private key is read from the input.
  161. With this option a public key is read instead.
  162. If the input contains no public key but a private key, its public part is used.
  163. .IP \fB\-pubout\fR 4
  164. .IX Item "-pubout"
  165. By default, a private key is output. With this option a public
  166. key will be output instead. This option is automatically set if the input is
  167. a public key.
  168. .IP \fB\-pvk\-strong\fR 4
  169. .IX Item "-pvk-strong"
  170. Enable 'Strong' PVK encoding level (default).
  171. .IP \fB\-pvk\-weak\fR 4
  172. .IX Item "-pvk-weak"
  173. Enable 'Weak' PVK encoding level.
  174. .IP \fB\-pvk\-none\fR 4
  175. .IX Item "-pvk-none"
  176. Don't enforce PVK encoding.
  177. .IP "\fB\-engine\fR \fIid\fR" 4
  178. .IX Item "-engine id"
  179. See "Engine Options" in \fBopenssl\fR\|(1).
  180. This option is deprecated.
  181. .IP "\fB\-provider\fR \fIname\fR" 4
  182. .IX Item "-provider name"
  183. .PD 0
  184. .IP "\fB\-provider\-path\fR \fIpath\fR" 4
  185. .IX Item "-provider-path path"
  186. .IP "\fB\-propquery\fR \fIpropq\fR" 4
  187. .IX Item "-propquery propq"
  188. .PD
  189. See "Provider Options" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
  190. .PP
  191. The \fBopenssl\-pkey\fR\|(1) command is capable of performing all the operations
  192. this command can, as well as supporting other public key types.
  193. .SH EXAMPLES
  194. .IX Header "EXAMPLES"
  195. The documentation for the \fBopenssl\-pkey\fR\|(1) command contains examples
  196. equivalent to the ones listed here.
  197. .PP
  198. To remove the pass phrase on a DSA private key:
  199. .PP
  200. .Vb 1
  201. \& openssl dsa \-in key.pem \-out keyout.pem
  202. .Ve
  203. .PP
  204. To encrypt a private key using triple DES:
  205. .PP
  206. .Vb 1
  207. \& openssl dsa \-in key.pem \-des3 \-out keyout.pem
  208. .Ve
  209. .PP
  210. To convert a private key from PEM to DER format:
  211. .PP
  212. .Vb 1
  213. \& openssl dsa \-in key.pem \-outform DER \-out keyout.der
  214. .Ve
  215. .PP
  216. To print out the components of a private key to standard output:
  217. .PP
  218. .Vb 1
  219. \& openssl dsa \-in key.pem \-text \-noout
  220. .Ve
  221. .PP
  222. To just output the public part of a private key:
  223. .PP
  224. .Vb 1
  225. \& openssl dsa \-in key.pem \-pubout \-out pubkey.pem
  226. .Ve
  227. .SH "SEE ALSO"
  228. .IX Header "SEE ALSO"
  229. \&\fBopenssl\fR\|(1),
  230. \&\fBopenssl\-pkey\fR\|(1),
  231. \&\fBopenssl\-dsaparam\fR\|(1),
  232. \&\fBopenssl\-gendsa\fR\|(1),
  233. \&\fBopenssl\-rsa\fR\|(1),
  234. \&\fBopenssl\-genrsa\fR\|(1)
  235. .SH HISTORY
  236. .IX Header "HISTORY"
  237. The \fB\-engine\fR option was deprecated in OpenSSL 3.0.
  238. .SH COPYRIGHT
  239. .IX Header "COPYRIGHT"
  240. Copyright 2000\-2023 The OpenSSL Project Authors. All Rights Reserved.
  241. .PP
  242. Licensed under the Apache License 2.0 (the "License"). You may not use
  243. this file except in compliance with the License. You can obtain a copy
  244. in the file LICENSE in the source distribution or at
  245. <https://www.openssl.org/source/license.html>.