]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man1/ec.pod
Add a test for the bug fixed in the previous commit
[thirdparty/openssl.git] / doc / man1 / ec.pod
CommitLineData
2c789c82
BM
1=pod
2
3=head1 NAME
4
5ec - EC key processing
6
7=head1 SYNOPSIS
8
9B<openssl> B<ec>
169394d4 10[B<-help>]
2c789c82
BM
11[B<-inform PEM|DER>]
12[B<-outform PEM|DER>]
13[B<-in filename>]
14[B<-passin arg>]
15[B<-out filename>]
16[B<-passout arg>]
17[B<-des>]
18[B<-des3>]
19[B<-idea>]
20[B<-text>]
21[B<-noout>]
22[B<-param_out>]
23[B<-pubin>]
24[B<-pubout>]
25[B<-conv_form arg>]
26[B<-param_enc arg>]
16754806 27[B<-no_public>]
7565cbc4 28[B<-check>]
2c789c82
BM
29[B<-engine id>]
30
31=head1 DESCRIPTION
32
33The B<ec> command processes EC keys. They can be converted between various
1bc74519 34forms and their components printed out. B<Note> OpenSSL uses the
2c789c82 35private key format specified in 'SEC 1: Elliptic Curve Cryptography'
35ed393e 36(http://www.secg.org/). To convert an OpenSSL EC private key into the
2c789c82
BM
37PKCS#8 private key format use the B<pkcs8> command.
38
3dfda1a6 39=head1 OPTIONS
2c789c82
BM
40
41=over 4
42
169394d4
MR
43=item B<-help>
44
45Print out a usage message.
46
2c789c82
BM
47=item B<-inform DER|PEM>
48
49This specifies the input format. The B<DER> option with a private key uses
50an ASN.1 DER encoded SEC1 private key. When used with a public key it
2b4ffc65 51uses the SubjectPublicKeyInfo structure as specified in RFC 3280.
2c789c82
BM
52The B<PEM> form is the default format: it consists of the B<DER> format base64
53encoded with additional header and footer lines. In the case of a private key
54PKCS#8 format is also accepted.
55
56=item B<-outform DER|PEM>
57
1bc74519 58This specifies the output format, the options have the same meaning as the
2c789c82
BM
59B<-inform> option.
60
61=item B<-in filename>
62
63This specifies the input filename to read a key from or standard input if this
64option is not specified. If the key is encrypted a pass phrase will be
65prompted for.
66
67=item B<-passin arg>
68
69the input file password source. For more information about the format of B<arg>
9b86974e 70see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
2c789c82
BM
71
72=item B<-out filename>
73
74This specifies the output filename to write a key to or standard output by
75is not specified. If any encryption options are set then a pass phrase will be
76prompted for. The output filename should B<not> be the same as the input
77filename.
78
79=item B<-passout arg>
80
81the output file password source. For more information about the format of B<arg>
9b86974e 82see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
2c789c82
BM
83
84=item B<-des|-des3|-idea>
85
1bc74519 86These options encrypt the private key with the DES, triple DES, IDEA or
2c789c82
BM
87any other cipher supported by OpenSSL before outputting it. A pass phrase is
88prompted for.
89If none of these options is specified the key is written in plain text. This
90means that using the B<ec> utility to read in an encrypted key with no
91encryption option can be used to remove the pass phrase from a key, or by
92setting the encryption options it can be use to add or change the pass phrase.
93These options can only be used with PEM format output files.
94
95=item B<-text>
96
97prints out the public, private key components and parameters.
98
99=item B<-noout>
100
101this option prevents output of the encoded version of the key.
102
103=item B<-modulus>
104
105this option prints out the value of the public key component of the key.
106
107=item B<-pubin>
108
109by default a private key is read from the input file: with this option a
110public key is read instead.
111
112=item B<-pubout>
113
114by default a private key is output. With this option a public
115key will be output instead. This option is automatically set if the input is
116a public key.
117
118=item B<-conv_form>
119
120This specifies how the points on the elliptic curve are converted
121into octet strings. Possible values are: B<compressed> (the default
122value), B<uncompressed> and B<hybrid>. For more information regarding
123the point conversion forms please read the X9.62 standard.
124B<Note> Due to patent issues the B<compressed> option is disabled
125by default for binary curves and can be enabled by defining
126the preprocessor macro B<OPENSSL_EC_BIN_PT_COMP> at compile time.
127
128=item B<-param_enc arg>
129
130This specifies how the elliptic curve parameters are encoded.
131Possible value are: B<named_curve>, i.e. the ec parameters are
35ed393e 132specified by an OID, or B<explicit> where the ec parameters are
1bc74519 133explicitly given (see RFC 3279 for the definition of the
2c789c82 134EC parameters structures). The default value is B<named_curve>.
aebb9aac 135B<Note> the B<implicitlyCA> alternative, as specified in RFC 3279,
2c789c82
BM
136is currently not implemented in OpenSSL.
137
16754806
DSH
138=item B<-no_public>
139
140This option omits the public key components from the private key output.
141
7565cbc4
DSH
142=item B<-check>
143
144this option checks the consistency of an EC private or public key.
145
2c789c82
BM
146=item B<-engine id>
147
e5fa864f 148specifying an engine (by its unique B<id> string) will cause B<ec>
2c789c82
BM
149to attempt to obtain a functional reference to the specified engine,
150thus initialising it if needed. The engine will then be set as the default
151for all available algorithms.
152
153=back
154
155=head1 NOTES
156
157The PEM private key format uses the header and footer lines:
158
159 -----BEGIN EC PRIVATE KEY-----
160 -----END EC PRIVATE KEY-----
161
162The PEM public key format uses the header and footer lines:
163
164 -----BEGIN PUBLIC KEY-----
165 -----END PUBLIC KEY-----
166
167=head1 EXAMPLES
168
169To encrypt a private key using triple DES:
170
171 openssl ec -in key.pem -des3 -out keyout.pem
172
1bc74519 173To convert a private key from PEM to DER format:
2c789c82
BM
174
175 openssl ec -in key.pem -outform DER -out keyout.der
176
177To print out the components of a private key to standard output:
178
179 openssl ec -in key.pem -text -noout
180
181To just output the public part of a private key:
182
183 openssl ec -in key.pem -pubout -out pubkey.pem
184
185To change the parameters encoding to B<explicit>:
186
187 openssl ec -in key.pem -param_enc explicit -out keyout.pem
188
189To change the point conversion form to B<compressed>:
190
191 openssl ec -in key.pem -conv_form compressed -out keyout.pem
192
193=head1 SEE ALSO
194
9b86974e 195L<ecparam(1)>, L<dsa(1)>, L<rsa(1)>
2c789c82 196
e2f92610
RS
197=head1 COPYRIGHT
198
199Copyright 2003-2016 The OpenSSL Project Authors. All Rights Reserved.
200
201Licensed under the OpenSSL license (the "License"). You may not use
202this file except in compliance with the License. You can obtain a copy
203in the file LICENSE in the source distribution or at
204L<https://www.openssl.org/source/license.html>.
205
206=cut