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