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