318 lines
8.4 KiB
HTML
318 lines
8.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of EC</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>EC</H1>
|
|
Section: OpenSSL (1SSL)<BR>Updated: 2021-03-22<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
openssl-ec, ec - EC key processing
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
<B>openssl</B> <B>ec</B>
|
|
[<B>-help</B>]
|
|
[<B>-inform PEM|DER</B>]
|
|
[<B>-outform PEM|DER</B>]
|
|
[<B>-in filename</B>]
|
|
[<B>-passin arg</B>]
|
|
[<B>-out filename</B>]
|
|
[<B>-passout arg</B>]
|
|
[<B>-des</B>]
|
|
[<B>-des3</B>]
|
|
[<B>-idea</B>]
|
|
[<B>-text</B>]
|
|
[<B>-noout</B>]
|
|
[<B>-param_out</B>]
|
|
[<B>-pubin</B>]
|
|
[<B>-pubout</B>]
|
|
[<B>-conv_form arg</B>]
|
|
[<B>-param_enc arg</B>]
|
|
[<B>-no_public</B>]
|
|
[<B>-check</B>]
|
|
[<B>-engine id</B>]
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
The <B>ec</B> command processes <FONT SIZE="-1">EC</FONT> keys. They can be converted between various
|
|
forms and their components printed out. <B>Note</B> OpenSSL uses the
|
|
private key format specified in '<FONT SIZE="-1">SEC 1:</FONT> Elliptic Curve Cryptography'
|
|
(<A HREF="http://www.secg.org/).">http://www.secg.org/).</A> To convert an OpenSSL <FONT SIZE="-1">EC</FONT> private key into the
|
|
PKCS#8 private key format use the <B>pkcs8</B> command.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-help</B><DD>
|
|
|
|
|
|
Print out a usage message.
|
|
<DT id="2"><B>-inform DER|PEM</B><DD>
|
|
|
|
|
|
This specifies the input format. The <B></B><FONT SIZE="-1"><B>DER</B></FONT><B></B> option with a private key uses
|
|
an <FONT SIZE="-1">ASN.1 DER</FONT> encoded <FONT SIZE="-1">SEC1</FONT> private key. When used with a public key it
|
|
uses the SubjectPublicKeyInfo structure as specified in <FONT SIZE="-1">RFC 3280.</FONT>
|
|
The <B></B><FONT SIZE="-1"><B>PEM</B></FONT><B></B> form is the default format: it consists of the <B></B><FONT SIZE="-1"><B>DER</B></FONT><B></B> format base64
|
|
encoded with additional header and footer lines. In the case of a private key
|
|
PKCS#8 format is also accepted.
|
|
<DT id="3"><B>-outform DER|PEM</B><DD>
|
|
|
|
|
|
This specifies the output format, the options have the same meaning and default
|
|
as the <B>-inform</B> option.
|
|
<DT id="4"><B>-in filename</B><DD>
|
|
|
|
|
|
This specifies the input filename to read a key from or standard input if this
|
|
option is not specified. If the key is encrypted a pass phrase will be
|
|
prompted for.
|
|
<DT id="5"><B>-passin arg</B><DD>
|
|
|
|
|
|
The input file password source. For more information about the format of <B>arg</B>
|
|
see the <B></B><FONT SIZE="-1"><B>PASS PHRASE ARGUMENTS</B></FONT><B></B> section in <B><A HREF="/cgi-bin/man/man2html?1+openssl">openssl</A></B>(1).
|
|
<DT id="6"><B>-out filename</B><DD>
|
|
|
|
|
|
This specifies the output filename to write a key to or standard output by
|
|
is not specified. If any encryption options are set then a pass phrase will be
|
|
prompted for. The output filename should <B>not</B> be the same as the input
|
|
filename.
|
|
<DT id="7"><B>-passout arg</B><DD>
|
|
|
|
|
|
The output file password source. For more information about the format of <B>arg</B>
|
|
see the <B></B><FONT SIZE="-1"><B>PASS PHRASE ARGUMENTS</B></FONT><B></B> section in <B><A HREF="/cgi-bin/man/man2html?1+openssl">openssl</A></B>(1).
|
|
<DT id="8"><B>-des|-des3|-idea</B><DD>
|
|
|
|
|
|
These options encrypt the private key with the <FONT SIZE="-1">DES,</FONT> triple <FONT SIZE="-1">DES, IDEA</FONT> or
|
|
any other cipher supported by OpenSSL before outputting it. A pass phrase is
|
|
prompted for.
|
|
If none of these options is specified the key is written in plain text. This
|
|
means that using the <B>ec</B> utility to read in an encrypted key with no
|
|
encryption option can be used to remove the pass phrase from a key, or by
|
|
setting the encryption options it can be use to add or change the pass phrase.
|
|
These options can only be used with <FONT SIZE="-1">PEM</FONT> format output files.
|
|
<DT id="9"><B>-text</B><DD>
|
|
|
|
|
|
Prints out the public, private key components and parameters.
|
|
<DT id="10"><B>-noout</B><DD>
|
|
|
|
|
|
This option prevents output of the encoded version of the key.
|
|
<DT id="11"><B>-pubin</B><DD>
|
|
|
|
|
|
By default, a private key is read from the input file. With this option a
|
|
public key is read instead.
|
|
<DT id="12"><B>-pubout</B><DD>
|
|
|
|
|
|
By default a private key is output. With this option a public
|
|
key will be output instead. This option is automatically set if the input is
|
|
a public key.
|
|
<DT id="13"><B>-conv_form</B><DD>
|
|
|
|
|
|
This specifies how the points on the elliptic curve are converted
|
|
into octet strings. Possible values are: <B>compressed</B> (the default
|
|
value), <B>uncompressed</B> and <B>hybrid</B>. For more information regarding
|
|
the point conversion forms please read the X9.62 standard.
|
|
<B>Note</B> Due to patent issues the <B>compressed</B> option is disabled
|
|
by default for binary curves and can be enabled by defining
|
|
the preprocessor macro <B></B><FONT SIZE="-1"><B>OPENSSL_EC_BIN_PT_COMP</B></FONT><B></B> at compile time.
|
|
<DT id="14"><B>-param_enc arg</B><DD>
|
|
|
|
|
|
This specifies how the elliptic curve parameters are encoded.
|
|
Possible value are: <B>named_curve</B>, i.e. the ec parameters are
|
|
specified by an <FONT SIZE="-1">OID,</FONT> or <B>explicit</B> where the ec parameters are
|
|
explicitly given (see <FONT SIZE="-1">RFC 3279</FONT> for the definition of the
|
|
<FONT SIZE="-1">EC</FONT> parameters structures). The default value is <B>named_curve</B>.
|
|
<B>Note</B> the <B>implicitlyCA</B> alternative, as specified in <FONT SIZE="-1">RFC 3279,</FONT>
|
|
is currently not implemented in OpenSSL.
|
|
<DT id="15"><B>-no_public</B><DD>
|
|
|
|
|
|
This option omits the public key components from the private key output.
|
|
<DT id="16"><B>-check</B><DD>
|
|
|
|
|
|
This option checks the consistency of an <FONT SIZE="-1">EC</FONT> private or public key.
|
|
<DT id="17"><B>-engine id</B><DD>
|
|
|
|
|
|
Specifying an engine (by its unique <B>id</B> string) will cause <B>ec</B>
|
|
to attempt to obtain a functional reference to the specified engine,
|
|
thus initialising it if needed. The engine will then be set as the default
|
|
for all available algorithms.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
|
|
|
|
The <FONT SIZE="-1">PEM</FONT> private key format uses the header and footer lines:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
-----BEGIN EC PRIVATE KEY-----
|
|
-----END EC PRIVATE KEY-----
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
The <FONT SIZE="-1">PEM</FONT> public key format uses the header and footer lines:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
-----BEGIN PUBLIC KEY-----
|
|
-----END PUBLIC KEY-----
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
|
|
|
|
To encrypt a private key using triple <FONT SIZE="-1">DES:</FONT>
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl ec -in key.pem -des3 -out keyout.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
To convert a private key from <FONT SIZE="-1">PEM</FONT> to <FONT SIZE="-1">DER</FONT> format:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl ec -in key.pem -outform DER -out keyout.der
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
To print out the components of a private key to standard output:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl ec -in key.pem -text -noout
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
To just output the public part of a private key:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl ec -in key.pem -pubout -out pubkey.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
To change the parameters encoding to <B>explicit</B>:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl ec -in key.pem -param_enc explicit -out keyout.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
To change the point conversion form to <B>compressed</B>:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl ec -in key.pem -conv_form compressed -out keyout.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ecparam">ecparam</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+dsa">dsa</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+rsa">rsa</A></B>(1)
|
|
<A NAME="lbAI"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright 2003-2019 The OpenSSL Project Authors. All Rights Reserved.
|
|
<P>
|
|
|
|
Licensed under the OpenSSL license (the ``License''). You may not use
|
|
this file except in compliance with the License. You can obtain a copy
|
|
in the file <FONT SIZE="-1">LICENSE</FONT> in the source distribution or at
|
|
<<A HREF="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</A>>.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="18"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="19"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="20"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="21"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="22"><A HREF="#lbAF">NOTES</A><DD>
|
|
<DT id="23"><A HREF="#lbAG">EXAMPLES</A><DD>
|
|
<DT id="24"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
<DT id="25"><A HREF="#lbAI">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:11 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|