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