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