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