1EC(1) OpenSSL EC(1)
2
3
4
6 ec - EC key processing
7
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
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
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
41 format 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
57 specified the key is written in plain text. This means that using
58 the ec utility to read in an encrypted key with no encryption
59 option can be used to remove the pass phrase from a key, or by
60 setting the encryption options it can be use to add or change the
61 pass phrase. These options can only be used with PEM format output
62 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 -modulus
71 this option prints out the value of the public key component of the
72 key.
73
74 -pubin
75 by default a private key is read from the input file: with this
76 option a public key is read instead.
77
78 -pubout
79 by default a private key is output. With this option a public key
80 will be output instead. This option is automatically set if the
81 input is a public key.
82
83 -conv_form
84 This specifies how the points on the elliptic curve are converted
85 into octet strings. Possible values are: compressed (the default
86 value), uncompressed and hybrid. For more information regarding the
87 point conversion forms please read the X9.62 standard. Note Due to
88 patent issues the compressed option is disabled by default for
89 binary curves and can be enabled by defining the preprocessor macro
90 OPENSSL_EC_BIN_PT_COMP at compile time.
91
92 -param_enc arg
93 This specifies how the elliptic curve parameters are encoded.
94 Possible value are: named_curve, i.e. the ec parameters are
95 specified by a OID, or explicit where the ec parameters are
96 explicitly given (see RFC 3279 for the definition of the EC
97 parameters structures). The default value is named_curve. Note the
98 implicitlyCA alternative ,as specified in RFC 3279, is currently
99 not implemented in OpenSSL.
100
101 -engine id
102 specifying an engine (by its unique id string) will cause ec to
103 attempt to obtain a functional reference to the specified engine,
104 thus initialising it if needed. The engine will then be set as the
105 default for all available algorithms.
106
108 The PEM private key format uses the header and footer lines:
109
110 -----BEGIN EC PRIVATE KEY-----
111 -----END EC PRIVATE KEY-----
112
113 The PEM public key format uses the header and footer lines:
114
115 -----BEGIN PUBLIC KEY-----
116 -----END PUBLIC KEY-----
117
119 To encrypt a private key using triple DES:
120
121 openssl ec -in key.pem -des3 -out keyout.pem
122
123 To convert a private key from PEM to DER format:
124
125 openssl ec -in key.pem -outform DER -out keyout.der
126
127 To print out the components of a private key to standard output:
128
129 openssl ec -in key.pem -text -noout
130
131 To just output the public part of a private key:
132
133 openssl ec -in key.pem -pubout -out pubkey.pem
134
135 To change the parameters encoding to explicit:
136
137 openssl ec -in key.pem -param_enc explicit -out keyout.pem
138
139 To change the point conversion form to compressed:
140
141 openssl ec -in key.pem -conv_form compressed -out keyout.pem
142
144 ecparam(1), dsa(1), rsa(1)
145
147 The ec command was first introduced in OpenSSL 0.9.8.
148
150 Nils Larsch for the OpenSSL project (http://www.openssl.org).
151
152
153
1541.0.0e 2009-04-10 EC(1)