openssl-ec.1ossl 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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-EC 1ossl"
  58. .TH OPENSSL-EC 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\-ec \- EC key processing
  65. .SH SYNOPSIS
  66. .IX Header "SYNOPSIS"
  67. \&\fBopenssl\fR \fBec\fR
  68. [\fB\-help\fR]
  69. [\fB\-inform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR|\fBENGINE\fR]
  70. [\fB\-outform\fR \fBDER\fR|\fBPEM\fR]
  71. [\fB\-in\fR \fIfilename\fR|\fIuri\fR]
  72. [\fB\-passin\fR \fIarg\fR]
  73. [\fB\-out\fR \fIfilename\fR]
  74. [\fB\-passout\fR \fIarg\fR]
  75. [\fB\-des\fR]
  76. [\fB\-des3\fR]
  77. [\fB\-idea\fR]
  78. [\fB\-text\fR]
  79. [\fB\-noout\fR]
  80. [\fB\-param_out\fR]
  81. [\fB\-pubin\fR]
  82. [\fB\-pubout\fR]
  83. [\fB\-conv_form\fR \fIarg\fR]
  84. [\fB\-param_enc\fR \fIarg\fR]
  85. [\fB\-no_public\fR]
  86. [\fB\-check\fR]
  87. [\fB\-engine\fR \fIid\fR]
  88. [\fB\-provider\fR \fIname\fR]
  89. [\fB\-provider\-path\fR \fIpath\fR]
  90. [\fB\-propquery\fR \fIpropq\fR]
  91. .SH DESCRIPTION
  92. .IX Header "DESCRIPTION"
  93. The \fBopenssl\-ec\fR\|(1) command processes EC keys. They can be converted between
  94. various forms and their components printed out. \fBNote\fR OpenSSL uses the
  95. private key format specified in 'SEC 1: Elliptic Curve Cryptography'
  96. (http://www.secg.org/). To convert an OpenSSL EC private key into the
  97. PKCS#8 private key format use the \fBopenssl\-pkcs8\fR\|(1) command.
  98. .SH OPTIONS
  99. .IX Header "OPTIONS"
  100. .IP \fB\-help\fR 4
  101. .IX Item "-help"
  102. Print out a usage message.
  103. .IP "\fB\-inform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR|\fBENGINE\fR" 4
  104. .IX Item "-inform DER|PEM|P12|ENGINE"
  105. The key input format; unspecified by default.
  106. See \fBopenssl\-format\-options\fR\|(1) for details.
  107. .IP "\fB\-outform\fR \fBDER\fR|\fBPEM\fR" 4
  108. .IX Item "-outform DER|PEM"
  109. The key output format; the default is \fBPEM\fR.
  110. See \fBopenssl\-format\-options\fR\|(1) for details.
  111. .Sp
  112. Private keys are an SEC1 private key or PKCS#8 format.
  113. Public keys are a \fBSubjectPublicKeyInfo\fR as specified in IETF RFC 3280.
  114. .IP "\fB\-in\fR \fIfilename\fR|\fIuri\fR" 4
  115. .IX Item "-in filename|uri"
  116. This specifies the input to read a key from or standard input if this
  117. option is not specified. If the key is encrypted a pass phrase will be
  118. prompted for.
  119. .IP "\fB\-out\fR \fIfilename\fR" 4
  120. .IX Item "-out filename"
  121. This specifies the output filename to write a key to or standard output by
  122. is not specified. If any encryption options are set then a pass phrase will be
  123. prompted for. The output filename should \fBnot\fR be the same as the input
  124. filename.
  125. .IP "\fB\-passin\fR \fIarg\fR, \fB\-passout\fR \fIarg\fR" 4
  126. .IX Item "-passin arg, -passout arg"
  127. The password source for the input and output file.
  128. For more information about the format of \fBarg\fR
  129. see \fBopenssl\-passphrase\-options\fR\|(1).
  130. .IP \fB\-des\fR|\fB\-des3\fR|\fB\-idea\fR 4
  131. .IX Item "-des|-des3|-idea"
  132. These options encrypt the private key with the DES, triple DES, IDEA or
  133. any other cipher supported by OpenSSL before outputting it. A pass phrase is
  134. prompted for.
  135. If none of these options is specified the key is written in plain text. This
  136. means that using this command to read in an encrypted key with no
  137. encryption option can be used to remove the pass phrase from a key, or by
  138. setting the encryption options it can be use to add or change the pass phrase.
  139. These options can only be used with PEM format output files.
  140. .IP \fB\-text\fR 4
  141. .IX Item "-text"
  142. Prints out the public, private key components and parameters.
  143. .IP \fB\-noout\fR 4
  144. .IX Item "-noout"
  145. This option prevents output of the encoded version of the key.
  146. .IP \fB\-param_out\fR 4
  147. .IX Item "-param_out"
  148. Print the elliptic curve parameters.
  149. .IP \fB\-pubin\fR 4
  150. .IX Item "-pubin"
  151. By default a private key is read from the input.
  152. With this option a public key is read instead.
  153. If the input contains no public key but a private key, its public part is used.
  154. .IP \fB\-pubout\fR 4
  155. .IX Item "-pubout"
  156. By default a private key is output. With this option a public
  157. key will be output instead. This option is automatically set if the input is
  158. a public key.
  159. .IP "\fB\-conv_form\fR \fIarg\fR" 4
  160. .IX Item "-conv_form arg"
  161. This specifies how the points on the elliptic curve are converted
  162. into octet strings. Possible values are: \fBcompressed\fR, \fBuncompressed\fR (the
  163. default value) and \fBhybrid\fR. For more information regarding
  164. the point conversion forms please read the X9.62 standard.
  165. \&\fBNote\fR Due to patent issues the \fBcompressed\fR option is disabled
  166. by default for binary curves and can be enabled by defining
  167. the preprocessor macro \fBOPENSSL_EC_BIN_PT_COMP\fR at compile time.
  168. .IP "\fB\-param_enc\fR \fIarg\fR" 4
  169. .IX Item "-param_enc arg"
  170. This specifies how the elliptic curve parameters are encoded.
  171. Possible value are: \fBnamed_curve\fR, i.e. the ec parameters are
  172. specified by an OID, or \fBexplicit\fR where the ec parameters are
  173. explicitly given (see RFC 3279 for the definition of the
  174. EC parameters structures). The default value is \fBnamed_curve\fR.
  175. \&\fBNote\fR the \fBimplicitlyCA\fR alternative, as specified in RFC 3279,
  176. is currently not implemented in OpenSSL.
  177. .IP \fB\-no_public\fR 4
  178. .IX Item "-no_public"
  179. This option omits the public key components from the private key output.
  180. .IP \fB\-check\fR 4
  181. .IX Item "-check"
  182. This option checks the consistency of an EC private or public key.
  183. .IP "\fB\-engine\fR \fIid\fR" 4
  184. .IX Item "-engine id"
  185. See "Engine Options" in \fBopenssl\fR\|(1).
  186. This option is deprecated.
  187. .IP "\fB\-provider\fR \fIname\fR" 4
  188. .IX Item "-provider name"
  189. .PD 0
  190. .IP "\fB\-provider\-path\fR \fIpath\fR" 4
  191. .IX Item "-provider-path path"
  192. .IP "\fB\-propquery\fR \fIpropq\fR" 4
  193. .IX Item "-propquery propq"
  194. .PD
  195. See "Provider Options" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
  196. .PP
  197. The \fBopenssl\-pkey\fR\|(1) command is capable of performing all the operations
  198. this command can, as well as supporting other public key types.
  199. .SH EXAMPLES
  200. .IX Header "EXAMPLES"
  201. The documentation for the \fBopenssl\-pkey\fR\|(1) command contains examples
  202. equivalent to the ones listed here.
  203. .PP
  204. To encrypt a private key using triple DES:
  205. .PP
  206. .Vb 1
  207. \& openssl ec \-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 ec \-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 ec \-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 ec \-in key.pem \-pubout \-out pubkey.pem
  226. .Ve
  227. .PP
  228. To change the parameters encoding to \fBexplicit\fR:
  229. .PP
  230. .Vb 1
  231. \& openssl ec \-in key.pem \-param_enc explicit \-out keyout.pem
  232. .Ve
  233. .PP
  234. To change the point conversion form to \fBcompressed\fR:
  235. .PP
  236. .Vb 1
  237. \& openssl ec \-in key.pem \-conv_form compressed \-out keyout.pem
  238. .Ve
  239. .SH "SEE ALSO"
  240. .IX Header "SEE ALSO"
  241. \&\fBopenssl\fR\|(1),
  242. \&\fBopenssl\-pkey\fR\|(1),
  243. \&\fBopenssl\-ecparam\fR\|(1),
  244. \&\fBopenssl\-dsa\fR\|(1),
  245. \&\fBopenssl\-rsa\fR\|(1)
  246. .SH HISTORY
  247. .IX Header "HISTORY"
  248. The \fB\-engine\fR option was deprecated in OpenSSL 3.0.
  249. .PP
  250. The \fB\-conv_form\fR and \fB\-no_public\fR options are no longer supported
  251. with keys loaded from an engine in OpenSSL 3.0.
  252. .SH COPYRIGHT
  253. .IX Header "COPYRIGHT"
  254. Copyright 2003\-2023 The OpenSSL Project Authors. All Rights Reserved.
  255. .PP
  256. Licensed under the Apache License 2.0 (the "License"). You may not use
  257. this file except in compliance with the License. You can obtain a copy
  258. in the file LICENSE in the source distribution or at
  259. <https://www.openssl.org/source/license.html>.