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