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

NAME

6       ec - EC key processing
7

SYNOPSIS

9       openssl ec [-inform PEM⎪DER] [-outform PEM⎪DER] [-in filename] [-passin
10       arg] [-out filename] [-passout arg] [-des] [-des3] [-idea] [-text]
11       [-noout] [-param_out] [-pubin] [-pubout] [-conv_form arg] [-param_enc
12       arg] [-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 a OpenSSL EC private key into the
19       PKCS#8 private key format use the pkcs8 command.
20

COMMAND OPTIONS

22       -inform DER⎪PEM
23           This specifies the input format. The DER option with a private key
24           uses an ASN.1 DER encoded SEC1 private key. When used with a public
25           key it uses the SubjectPublicKeyInfo structur as specified in RFC
26           3280.  The PEM form is the default format: it consists of the DER
27           format base64 encoded with additional header and footer lines. In
28           the case of a private key PKCS#8 format is also accepted.
29
30       -outform DER⎪PEM
31           This specifies the output format, the options have the same meaning
32           as the -inform option.
33
34       -in filename
35           This specifies the input filename to read a key from or standard
36           input if this option is not specified. If the key is encrypted a
37           pass phrase will be prompted for.
38
39       -passin arg
40           the input file password source. For more information about the for‐
41           mat of arg see the PASS PHRASE ARGUMENTS section in openssl(1).
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       -passout arg
50           the output file password source. For more information about the
51           format of arg see the PASS PHRASE ARGUMENTS section in openssl(1).
52
53       -des⎪-des3⎪-idea
54           These options encrypt the private key with the DES, triple DES,
55           IDEA or any other cipher supported by OpenSSL before outputting it.
56           A pass phrase is prompted for.  If none of these options is speci‐
57           fied the key is written in plain text. This means that using the ec
58           utility to read in an encrypted key with no encryption option can
59           be used to remove the pass phrase from a key, or by setting the
60           encryption options it can be use to add or change the pass phrase.
61           These options can only be used with PEM format output files.
62
63       -text
64           prints out the public, private key components and parameters.
65
66       -noout
67           this option prevents output of the encoded version of the key.
68
69       -modulus
70           this option prints out the value of the public key component of the
71           key.
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
83           This specifies how the points on the elliptic curve are converted
84           into octet strings. Possible values are: compressed (the default
85           value), uncompressed 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.  Pos‐
93           sible value are: named_curve, i.e. the ec parameters are specified
94           by a OID, or explicit where the ec parameters are explicitly given
95           (see RFC 3279 for the definition of the EC parameters structures).
96           The default value is named_curve.  Note the implicitlyCA alterna‐
97           tive ,as specified in RFC 3279, is currently not implemented in
98           OpenSSL.
99
100       -engine id
101           specifying an engine (by it's unique id string) will cause req to
102           attempt to obtain a functional reference to the specified engine,
103           thus initialising it if needed. The engine will then be set as the
104           default for all available algorithms.
105

NOTES

107       The PEM private key format uses the header and footer lines:
108
109        -----BEGIN EC PRIVATE KEY-----
110        -----END EC PRIVATE KEY-----
111
112       The PEM public key format uses the header and footer lines:
113
114        -----BEGIN PUBLIC KEY-----
115        -----END PUBLIC KEY-----
116

EXAMPLES

118       To encrypt a private key using triple DES:
119
120        openssl ec -in key.pem -des3 -out keyout.pem
121
122       To convert a private key from PEM to DER format:
123
124        openssl ec -in key.pem -outform DER -out keyout.der
125
126       To print out the components of a private key to standard output:
127
128        openssl ec -in key.pem -text -noout
129
130       To just output the public part of a private key:
131
132        openssl ec -in key.pem -pubout -out pubkey.pem
133
134       To change the parameters encoding to explicit:
135
136        openssl ec -in key.pem -param_enc explicit -out keyout.pem
137
138       To change the point conversion form to compressed:
139
140        openssl ec -in key.pem -conv_form compressed -out keyout.pem
141

SEE ALSO

143       ecparam(1), dsa(1), rsa(1)
144

HISTORY

146       The ec command was first introduced in OpenSSL 0.9.8.
147

AUTHOR

149       Nils Larsch for the OpenSSL project (http://www.openssl.org).
150
151
152
1530.9.8b                            2003-07-21                             EC(1)
Impressum