1EC(1)                               OpenSSL                              EC(1)
2
3
4

NAME

6       openssl-ec, ec - EC key processing
7

SYNOPSIS

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

DESCRIPTION

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

OPTIONS

22       -help
23           Print out a usage message.
24
25       -inform DER|PEM
26           This specifies the input format. The DER option with a private key
27           uses an ASN.1 DER encoded SEC1 private key. When used with a public
28           key it uses the SubjectPublicKeyInfo structure as specified in RFC
29           3280.  The PEM form is the default format: it consists of the DER
30           format base64 encoded with additional header and footer lines. In
31           the case of a private key PKCS#8 format is also accepted.
32
33       -outform DER|PEM
34           This specifies the output format, the options have the same meaning
35           and default as the -inform option.
36
37       -in filename
38           This specifies the input filename to read a key from or standard
39           input if this option is not specified. If the key is encrypted a
40           pass phrase will be prompted for.
41
42       -passin arg
43           The input file password source. For more information about the
44           format of arg see the PASS PHRASE ARGUMENTS section in openssl(1).
45
46       -out filename
47           This specifies the output filename to write a key to or standard
48           output by is not specified. If any encryption options are set then
49           a pass phrase will be prompted for. The output filename should not
50           be the same as the input filename.
51
52       -passout arg
53           The output file password source. For more information about the
54           format of arg see the PASS PHRASE ARGUMENTS section in openssl(1).
55
56       -des|-des3|-idea
57           These options encrypt the private key with the DES, triple DES,
58           IDEA or any other cipher supported by OpenSSL before outputting it.
59           A pass phrase is prompted for.  If none of these options is
60           specified the key is written in plain text. This means that using
61           the ec utility to read in an encrypted key with no encryption
62           option can be used to remove the pass phrase from a key, or by
63           setting the encryption options it can be use to add or change the
64           pass phrase.  These options can only be used with PEM format output
65           files.
66
67       -text
68           Prints out the public, private key components and parameters.
69
70       -noout
71           This option prevents output of the encoded version of the key.
72
73       -modulus
74           This option prints out the value of the public key component of the
75           key.
76
77       -pubin
78           By default, a private key is read from the input file. With this
79           option a public key is read instead.
80
81       -pubout
82           By default a private key is output. With this option a public key
83           will be output instead. This option is automatically set if the
84           input is a public key.
85
86       -conv_form
87           This specifies how the points on the elliptic curve are converted
88           into octet strings. Possible values are: compressed (the default
89           value), uncompressed and hybrid. For more information regarding the
90           point conversion forms please read the X9.62 standard.  Note Due to
91           patent issues the compressed option is disabled by default for
92           binary curves and can be enabled by defining the preprocessor macro
93           OPENSSL_EC_BIN_PT_COMP at compile time.
94
95       -param_enc arg
96           This specifies how the elliptic curve parameters are encoded.
97           Possible value are: named_curve, i.e. the ec parameters are
98           specified by an OID, or explicit where the ec parameters are
99           explicitly given (see RFC 3279 for the definition of the EC
100           parameters structures). The default value is named_curve.  Note the
101           implicitlyCA alternative, as specified in RFC 3279, is currently
102           not implemented in OpenSSL.
103
104       -no_public
105           This option omits the public key components from the private key
106           output.
107
108       -check
109           This option checks the consistency of an EC private or public key.
110
111       -engine id
112           Specifying an engine (by its unique id string) will cause ec to
113           attempt to obtain a functional reference to the specified engine,
114           thus initialising it if needed. The engine will then be set as the
115           default for all available algorithms.
116

NOTES

118       The PEM private key format uses the header and footer lines:
119
120        -----BEGIN EC PRIVATE KEY-----
121        -----END EC PRIVATE KEY-----
122
123       The PEM public key format uses the header and footer lines:
124
125        -----BEGIN PUBLIC KEY-----
126        -----END PUBLIC KEY-----
127

EXAMPLES

129       To encrypt a private key using triple DES:
130
131        openssl ec -in key.pem -des3 -out keyout.pem
132
133       To convert a private key from PEM to DER format:
134
135        openssl ec -in key.pem -outform DER -out keyout.der
136
137       To print out the components of a private key to standard output:
138
139        openssl ec -in key.pem -text -noout
140
141       To just output the public part of a private key:
142
143        openssl ec -in key.pem -pubout -out pubkey.pem
144
145       To change the parameters encoding to explicit:
146
147        openssl ec -in key.pem -param_enc explicit -out keyout.pem
148
149       To change the point conversion form to compressed:
150
151        openssl ec -in key.pem -conv_form compressed -out keyout.pem
152

SEE ALSO

154       ecparam(1), dsa(1), rsa(1)
155
157       Copyright 2003-2017 The OpenSSL Project Authors. All Rights Reserved.
158
159       Licensed under the OpenSSL license (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
1661.1.1                             2018-09-11                             EC(1)
Impressum