1OPENSSL-EC(1ossl)                   OpenSSL                  OPENSSL-EC(1ossl)
2
3
4

NAME

6       openssl-ec - EC key processing
7

SYNOPSIS

9       openssl ec [-help] [-inform DER|PEM|P12|ENGINE] [-outform DER|PEM] [-in
10       filename|uri] [-passin arg] [-out filename] [-passout arg] [-des]
11       [-des3] [-idea] [-text] [-noout] [-param_out] [-pubin] [-pubout]
12       [-conv_form arg] [-param_enc arg] [-no_public] [-check] [-engine id]
13       [-provider name] [-provider-path path] [-propquery propq]
14

DESCRIPTION

16       The openssl-ec(1) command processes EC keys. They can be converted
17       between various forms and their components printed out. Note OpenSSL
18       uses the private key format specified in 'SEC 1: Elliptic Curve
19       Cryptography' (http://www.secg.org/). To convert an OpenSSL EC private
20       key into the PKCS#8 private key format use the openssl-pkcs8(1)
21       command.
22

OPTIONS

24       -help
25           Print out a usage message.
26
27       -inform DER|PEM|P12|ENGINE
28           The key input format; unspecified by default.  See
29           openssl-format-options(1) for details.
30
31       -outform DER|PEM
32           The key output format; the default is PEM.  See
33           openssl-format-options(1) for details.
34
35           Private keys are an SEC1 private key or PKCS#8 format.  Public keys
36           are a SubjectPublicKeyInfo as specified in IETF RFC 3280.
37
38       -in filename|uri
39           This specifies the input to read a key from or standard input if
40           this option is not specified. If the key is encrypted a pass phrase
41           will be prompted for.
42
43       -out filename
44           This specifies the output filename to write a key to or standard
45           output by is not specified. If any encryption options are set then
46           a pass phrase will be prompted for. The output filename should not
47           be the same as the input filename.
48
49       -passin arg, -passout arg
50           The password source for the input and output file.  For more
51           information about the format of arg see
52           openssl-passphrase-options(1).
53
54       -des|-des3|-idea
55           These options encrypt the private key with the DES, triple DES,
56           IDEA or any other cipher supported by OpenSSL before outputting it.
57           A pass phrase is prompted for.  If none of these options is
58           specified the key is written in plain text. This means that using
59           this command to read in an encrypted key with no encryption option
60           can be used to remove the pass phrase from a key, or by setting the
61           encryption options it can be use to add or change the pass phrase.
62           These options can only be used with PEM format output files.
63
64       -text
65           Prints out the public, private key components and parameters.
66
67       -noout
68           This option prevents output of the encoded version of the key.
69
70       -param_out
71           Print the elliptic curve parameters.
72
73       -pubin
74           By default, a private key is read from the input file. With this
75           option a public key is read instead.
76
77       -pubout
78           By default a private key is output. With this option a public key
79           will be output instead. This option is automatically set if the
80           input is a public key.
81
82       -conv_form arg
83           This specifies how the points on the elliptic curve are converted
84           into octet strings. Possible values are: compressed, uncompressed
85           (the default value) and hybrid. For more information regarding the
86           point conversion forms please read the X9.62 standard.  Note Due to
87           patent issues the compressed option is disabled by default for
88           binary curves and can be enabled by defining the preprocessor macro
89           OPENSSL_EC_BIN_PT_COMP at compile time.
90
91       -param_enc arg
92           This specifies how the elliptic curve parameters are encoded.
93           Possible value are: named_curve, i.e. the ec parameters are
94           specified by an OID, or explicit where the ec parameters are
95           explicitly given (see RFC 3279 for the definition of the EC
96           parameters structures). The default value is named_curve.  Note the
97           implicitlyCA alternative, as specified in RFC 3279, is currently
98           not implemented in OpenSSL.
99
100       -no_public
101           This option omits the public key components from the private key
102           output.
103
104       -check
105           This option checks the consistency of an EC private or public key.
106
107       -engine id
108           See "Engine Options" in openssl(1).  This option is deprecated.
109
110       -provider name
111       -provider-path path
112       -propquery propq
113           See "Provider Options" in openssl(1), provider(7), and property(7).
114
115       The openssl-pkey(1) command is capable of performing all the operations
116       this command can, as well as supporting other public key types.
117

EXAMPLES

119       The documentation for the openssl-pkey(1) command contains examples
120       equivalent to the ones listed here.
121
122       To encrypt a private key using triple DES:
123
124        openssl ec -in key.pem -des3 -out keyout.pem
125
126       To convert a private key from PEM to DER format:
127
128        openssl ec -in key.pem -outform DER -out keyout.der
129
130       To print out the components of a private key to standard output:
131
132        openssl ec -in key.pem -text -noout
133
134       To just output the public part of a private key:
135
136        openssl ec -in key.pem -pubout -out pubkey.pem
137
138       To change the parameters encoding to explicit:
139
140        openssl ec -in key.pem -param_enc explicit -out keyout.pem
141
142       To change the point conversion form to compressed:
143
144        openssl ec -in key.pem -conv_form compressed -out keyout.pem
145

SEE ALSO

147       openssl(1), openssl-pkey(1), openssl-ecparam(1), openssl-dsa(1),
148       openssl-rsa(1)
149

HISTORY

151       The -engine option was deprecated in OpenSSL 3.0.
152
153       The -conv_form and -no_public options are no longer supported with keys
154       loaded from an engine in OpenSSL 3.0.
155
157       Copyright 2003-2022 The OpenSSL Project Authors. All Rights Reserved.
158
159       Licensed under the Apache License 2.0 (the "License").  You may not use
160       this file except in compliance with the License.  You can obtain a copy
161       in the file LICENSE in the source distribution or at
162       <https://www.openssl.org/source/license.html>.
163
164
165
1663.1.1                             2023-08-31                 OPENSSL-EC(1ossl)
Impressum