openssl-ec.pod.in 5.8 KB

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