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