<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openssl.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DDvO</id>
	<title>OpenSSLWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openssl.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DDvO"/>
	<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php/Special:Contributions/DDvO"/>
	<updated>2026-04-10T04:26:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Command_Line_Utilities&amp;diff=3217</id>
		<title>Command Line Utilities</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Command_Line_Utilities&amp;diff=3217"/>
		<updated>2022-06-24T11:56:05Z</updated>

		<summary type="html">&lt;p&gt;DDvO: /* Commands */ remove pretty useless reference to Standard commands and non-existing ones to other types of commands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''openssl''' program provides a rich variety of commands, each of which often has a wealth of options and arguments. Many commands use an external configuration file for some or all of their arguments and have a &amp;lt;code&amp;gt;-config&amp;lt;/code&amp;gt; option to specify that file. The environment variable [[OPENSSL_CONF]] can be used to specify the location of the configuration file. If the environment variable is not specified, a default file is created in the default certificate storage area called '''openssl.cnf'''. The settings in this default configuration file depend on the flags set when the version of OpenSSL being used was built.&lt;br /&gt;
&lt;br /&gt;
This article is an overview of the available tools provided by OpenSSL. For all of the details on usage and implementation, you can find the [https://www.openssl.org/docs/manmaster/man1/ manpages], which are automatically generated from the source code at the [https://www.openssl.org/ official OpenSSL project home]. Likewise, the source code itself may be found on the [https://www.openssl.org/source/ OpenSSL project home page], as well as on the [https://github.com/openssl/openssl OpenSSL Github]. The main OpenSSL site also includes an [https://www.openssl.org/docs/manmaster/man1/openssl.html overview of the command-line utilities], as well as links to all of their respective documentation.&lt;br /&gt;
&lt;br /&gt;
=Getting Started=&lt;br /&gt;
&lt;br /&gt;
The entry point for the OpenSSL library is the '''openssl''' binary, usually &amp;lt;tt&amp;gt;/usr/bin/openssl&amp;lt;/tt&amp;gt; on Linux. The general syntax for calling '''openssl''' is as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl command [ command_options ] [ command_arguments ]&lt;br /&gt;
&lt;br /&gt;
Before OpenSSL 3.0, you could call '''openssl''' without arguments to enter the interactive mode prompt and then enter commands directly, exiting with either a &amp;lt;code&amp;gt;quit&amp;lt;/code&amp;gt; command or by issuing a termination signal with either &amp;lt;tt&amp;gt;Ctrl+C&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Ctrl+D&amp;lt;/tt&amp;gt;. The following is a sample interactive session in which the user invokes the [[prime]] command twice before using the &amp;lt;tt&amp;gt;quit&amp;lt;/tt&amp;gt; command to terminate the session.&lt;br /&gt;
&lt;br /&gt;
 OpenSSL&amp;gt; prime -generate -bits 24&lt;br /&gt;
 13467269&lt;br /&gt;
 OpenSSL&amp;gt; prime -generate -bits 24&lt;br /&gt;
 16651079&lt;br /&gt;
 OpenSSL&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
=Basic Tasks=&lt;br /&gt;
&lt;br /&gt;
This section is a brief tutorial on performing the most basic tasks using OpenSSL. For a detailed explanation of the rationale behind the syntax and semantics of the commands shown here, see the section on [[#Commands|Commands]].&lt;br /&gt;
&lt;br /&gt;
==Getting Help==&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, the general syntax of a command is &amp;lt;code&amp;gt;openssl command [ command_options ] [ command_arguments ]&amp;lt;/code&amp;gt;. The '''help''' command is no different, but it does have its idiosyncrasies. To view the top-level help menu, you can call '''openssl''' as follows.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help&lt;br /&gt;
&lt;br /&gt;
Since OpenSSL 3.0, there are equivalent invocations such as:&lt;br /&gt;
&lt;br /&gt;
 $ openssl --help&lt;br /&gt;
 $ openssl -h&lt;br /&gt;
&lt;br /&gt;
This query will print all of the available commands, like so:&lt;br /&gt;
&lt;br /&gt;
 Standard commands&lt;br /&gt;
 asn1parse         ca                ciphers           cmp               &lt;br /&gt;
 cms               crl               crl2pkcs7         dgst              &lt;br /&gt;
 dhparam           dsa               dsaparam          ec &lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Note the above output was truncated, so only the first four lines of output are shown.&lt;br /&gt;
&lt;br /&gt;
The same output is obtained also with&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -standard-commands&lt;br /&gt;
&lt;br /&gt;
A help menu for each command may be requested in two different ways. First, the same command used above may be repeated, followed by the name of the command to print help for.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help genpkey&lt;br /&gt;
&lt;br /&gt;
The program will then display the valid options for the given command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help genpkey&lt;br /&gt;
 General options:&lt;br /&gt;
  -help               Display this summary&lt;br /&gt;
  -engine val         Use engine, possibly a hardware device&lt;br /&gt;
  -paramfile infile   Parameters file&lt;br /&gt;
  -algorithm val      The public key algorithm&lt;br /&gt;
  -quiet              Do not output status while generating keys&lt;br /&gt;
  -pkeyopt val        Set the public key algorithm option as opt:value&lt;br /&gt;
  -config infile      Load a configuration file (this may load modules)&lt;br /&gt;
 Output options:&lt;br /&gt;
  -out outfile        Output file&lt;br /&gt;
  -outform PEM|DER    output format (DER or PEM)&lt;br /&gt;
  -pass val           Output file pass phrase source&lt;br /&gt;
  -genparam           Generate parameters, not key&lt;br /&gt;
  -text               Print the in text&lt;br /&gt;
  -*                  Cipher to use to encrypt the key&lt;br /&gt;
 Provider options:&lt;br /&gt;
  -provider-path val  Provider load path (must be before 'provider' argument if required)&lt;br /&gt;
  -provider val       Provider to load (can be specified multiple times)&lt;br /&gt;
  -propquery val      Property query used when fetching algorithms&lt;br /&gt;
 Order of options may be important!  See the documentation.&lt;br /&gt;
&lt;br /&gt;
The second way of requesting the help menu for a particular command is by using the first option in the output shown above, namely &amp;lt;code&amp;gt;openssl command -help&amp;lt;/code&amp;gt;. Both commands will yield the same output; the help menu displayed will be exactly the same.&lt;br /&gt;
&lt;br /&gt;
For additional information on the usage of a particular command, the project [https://www.openssl.org/docs/manmaster/man1/ manpages] are the definite source of information.&lt;br /&gt;
The manpages may be views in a shell as usual, e.g.&lt;br /&gt;
&lt;br /&gt;
 $ man openssl&lt;br /&gt;
 $ man openssl-genpkey&lt;br /&gt;
 $ man genpkey&lt;br /&gt;
&lt;br /&gt;
Another way of accessing the manpages is via the project perldocs. [https://perldoc.perl.org/perldoc perldoc] is a utility included with most if not all [https://www.perl.org/ Perl] distributions, and it's capable of displaying documentation information in a variety of formats, one of which is as manpages. Not surprisingly, the project documentation is generated from the '''pod''' files located in the &amp;lt;tt&amp;gt;doc&amp;lt;/tt&amp;gt; directory of the source code.&lt;br /&gt;
&lt;br /&gt;
==Getting Library Version Information==&lt;br /&gt;
&lt;br /&gt;
 $ openssl version&lt;br /&gt;
 OpenSSL 3.0.4 21 Jun 2022 (Library: OpenSSL 3.0.4 21 Jun 2022)&lt;br /&gt;
&lt;br /&gt;
As mentioned above, the &amp;lt;tt&amp;gt;version&amp;lt;/tt&amp;gt; command's help menu may be queried for additional options like so:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -help&lt;br /&gt;
 Usage: version [options]&lt;br /&gt;
 General options:&lt;br /&gt;
  -help  Display this summary&lt;br /&gt;
 Output options:&lt;br /&gt;
  -a     Show all data&lt;br /&gt;
  -b     Show build date&lt;br /&gt;
  -d     Show configuration directory&lt;br /&gt;
  -e     Show engines directory&lt;br /&gt;
  -m     Show modules directory&lt;br /&gt;
  -f     Show compiler flags used&lt;br /&gt;
  -o     Show some internal datatype options&lt;br /&gt;
  -p     Show target build platform&lt;br /&gt;
  -r     Show random seeding options&lt;br /&gt;
  -v     Show library version&lt;br /&gt;
  -c     Show CPU settings info&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;tt&amp;gt;-a&amp;lt;/tt&amp;gt; option to show all version information yields the following output on my current machine:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -a&lt;br /&gt;
 OpenSSL 3.0.4 21 Jun 2022 (Library: OpenSSL 3.0.4 21 Jun 2022)&lt;br /&gt;
 built on: Fri Jun 24 08:58:53 2022 UTC&lt;br /&gt;
 platform: linux-x86_64&lt;br /&gt;
 options:  bn(64,64)&lt;br /&gt;
 compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
 ENGINESDIR: &amp;quot;/usr/local/lib64/engines-3&amp;quot;&lt;br /&gt;
 MODULESDIR: &amp;quot;/usr/local/lib64/ossl-modules&amp;quot;&lt;br /&gt;
 Seeding source: os-specific&lt;br /&gt;
 CPUINFO: OPENSSL_ia32cap=0x7ffaf3ffffebffff:0x29c67af&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Commands=&lt;br /&gt;
&lt;br /&gt;
There are three different kinds of commands. These are standard commands, cipher commands, and message digest commands. Calling the OpenSSL top-level &amp;lt;tt&amp;gt;help&amp;lt;/tt&amp;gt; command with no arguments will result in openssl printing all available commands by group, sorted alphabetically.&lt;br /&gt;
&lt;br /&gt;
==Standard Commands==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto; text-align: center; width: 65%;&amp;quot;&lt;br /&gt;
|+ Overview of OpenSSL's command line utilities&lt;br /&gt;
! style=&amp;quot;width: 25%; padding: 4px;&amp;quot; | Command&lt;br /&gt;
! style=&amp;quot;width: 75%; padding: 4px;&amp;quot; | Description&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-asn1parse.html asn1parse]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Parse an ASN.1 sequence.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ca.html ca]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Authority (CA) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html ciphers]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Cipher Suite Description Determination.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-cmp.html cmp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Management Protocol (CMP, RFC 4210) application.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-cms.html cms]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  CMS (Cryptographic Message Syntax) utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-crl.html crl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Revocation List (CRL) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-crl2pkcs7.html crl2pkcs7]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  CRL to PKCS#7 Conversion.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dgst.html dgst]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Message Digest calculation. MAC calculations are superseded by mac(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dhparam.html dhparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation and Management of Diffie-Hellman Parameters. Superseded by genpkey(1) and pkeyparam(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dsa.html dsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  DSA Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dsaparam.html dsaparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  DSA Parameter Generation and Management. Superseded by genpkey(1) and pkeyparam(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ec.html ec]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  EC (Elliptic curve) key processing.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ecparam.html ecparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  EC parameter manipulation and generation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-enc.html enc]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Symmetric cipher routines.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-engine.html engine]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Engine (loadable module) information and manipulation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-errstr.html errstr]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Error Number to Error String Conversion.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-fipsinstall.html fipsinstall]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  IPS configuration installation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-gendsa.html gendsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of DSA Private Key from Parameters. Superseded by genpkey(1) and pkey(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html genpkey]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of Private Key or Parameters.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-genrsa.html genrsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of RSA Private Key. Superseded by genpkey(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-help.html help]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Display information about a command's options.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-info.html info]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Display diverse information built into the OpenSSL libraries.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-kdf.html kdf]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Key Derivation Functions.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-list.html list]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  List algorithms and features.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-mac.html mac]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Message Authentication Code Calculation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-nseq.html nseq]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Create or examine a Netscape certificate sequence.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ocsp.html ocsp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Online Certificate Status Protocol utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-passwd.html passwd]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of hashed passwords.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs12.html pkcs12]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#12 Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs7.html pkcs7]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#7 Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs8.html pkcs8]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#8 format private key conversion tool.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkey.html pkey]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public and private key management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkeyparam.html pkeyparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public key algorithm parameter management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkeyutl.html pkeyutl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public key algorithm cryptographic operation utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-prime.html prime]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Compute prime numbers.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rand.html rand]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generate pseudo-random bytes -- see [[Random Numbers]]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rehash.html rehash]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Create symbolic links to certificate and CRL files named by the hash values.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-req.html req]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#10 X.509 Certificate Signing Request (CSR) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rsa.html rsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  RSA key management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rsautl.html rsautl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  RSA utility for signing, verification, encryption, and decryption. Superseded by pkeyutl(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_client.html s_client]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  This implements a generic SSL/TLS client which can establish a transparent connection to a remote server speaking SSL/TLS.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_server.html s_server]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  This implements a generic SSL/TLS server which accepts connections from remote clients speaking SSL/TLS. &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_time.html s_time]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SSL Connection Timer.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-sess_id.html sess_id]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SSL Session Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-smime.html smime]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  S/MIME mail processing.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-openssl-speed.html speed]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Algorithm Speed Measurement.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-spkac.html spkac]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SPKAC printing and generating utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-srp.html srp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Maintain SRP password file.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-storeutl.html storeutl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Utility to list and display certificates, keys, CRLs, etc.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ts.html ts]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Time Stamping Authority tool (client/server).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-verify.html verify]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  X.509 Certificate Verification.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-version.html version]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  OpenSSL Version Information.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-x509.html x509]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  X.509 Certificate Data Management.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Generating an RSA Private Key==&lt;br /&gt;
&lt;br /&gt;
Generating a private key can be done in a variety of different ways depending on the type of key, algorithm, bits, and other options your specific use case may require. In this example, we are generating a private key using RSA and a key size of 2048 bits.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem&lt;br /&gt;
&lt;br /&gt;
To generate a password protected private key, the previous command may be slightly amended as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem&lt;br /&gt;
&lt;br /&gt;
The addition of the &amp;lt;tt&amp;gt;-aes256&amp;lt;/tt&amp;gt; option specifies the cipher to use to encrypt the private key file. For a list of available ciphers in the library, you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -cipher-algorithms&lt;br /&gt;
&lt;br /&gt;
With your private key in hand, you can use the following command to see the key's details, such as its modulus and its constituent primes. Remember to change the name of the input file to the file name of your private key.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -text&lt;br /&gt;
&lt;br /&gt;
The above command yields the following output in my specific case. Your output will differ but should be structurally similar.&lt;br /&gt;
&lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDZD6IMLRFk4CaF&lt;br /&gt;
 w0rhRienwuE5EZ6xFE8e3C5TVi1+d9Enhi38RgkwD7UlWxPE6AWhp5T3kfrFWdak&lt;br /&gt;
 1lZFVPp7/btOKLjKUru15nLoA4AKYtz9W9PhsM0dyzLc6FQ6K4ReQam5pHCqI2zF&lt;br /&gt;
 82MwE+eIAduvuqyoQLKiI608EArWZqDtMUpBJzv0UVEYvRdnMWpCwfzpI+hPJywV&lt;br /&gt;
 CcTlNCT/ctGgBKyIx+dDuZ7bR9MNmSW7GreJEbTH+R13xT3dd/JCka1+LYCl4h0q&lt;br /&gt;
 oWhFPhOkvQzmmSzUmZlAlTDQLv2eAdJIrQcsnKZ3SsIOCC/3IpqwSzpid38Ill4O&lt;br /&gt;
 xH6XIrVFAgMBAAECggEBAJ2MC0JrM8TULSHJrf/0u7O4b2DMuTIuW386sSUr17mD&lt;br /&gt;
 nfviGF6TNvf7bq++e4rgHbZHvIg1HJ9Bpdne+J86HtUARYNlazru8fAFZEGiyLzB&lt;br /&gt;
 JUV/8TpO6ZJGepR8zSWrkFgZsOddw6i6LalADy5GRDcjoiDajZdR3lZxLrv5qOQU&lt;br /&gt;
 I1vKTf4Zs2Tl3gnaJ/Il1gBHIQ9W9xUH8jPBIwj51iXwCh8H0BiDPvFkU7cHIFCP&lt;br /&gt;
 sJhGsGp6OS3uSwwQuSE+NqbuPfVilysCcwgZduknyio0QO1YfMBL6+XoKE/bFHsn&lt;br /&gt;
 N+FzzczQg9sWyiwVR+3EeI9kp4JSElNh2nqG96i4QAECgYEA76OLUGrShHb4saoP&lt;br /&gt;
 aYnBAKLEdWj5K483JdY6BSbdd5RkDbJG8ExmcbfTas/BGdKc4iVCkxV3ysxKnX18&lt;br /&gt;
 PfxATHDLL8NMa+gGgZY5oTKUsrXEpS132HhCJ9T9LoesQjRb4kOZH8POVqm6O4Xf&lt;br /&gt;
 lCt0y1+M1eQHI1NPO9CmPBgouEUCgYEA5+F4SS8RMyYRkU/kx195fwh0hhaOElzr&lt;br /&gt;
 E8mZou3NFL/XT6/9t+2+7sMTuiQCP9zIa6s+/rrXdjWtrTcDp4WlDITas0UUgZhv&lt;br /&gt;
 YVBQBF4vhHxIVwJxnT9Gwi4XM1JlFmVHofWD71P6DRe7jSWRS3CujP3AE9vmpWMx&lt;br /&gt;
 tE1D9qLiWQECgYB445LzFYBvrKjWz4iI4CJKFNJwvGz+iXfzkXehg7KzkVtMAYSB&lt;br /&gt;
 0rjXYzm3J2ktgq778nn8Qxc0agy2GEil6GvzY+9MgAQ8Z0do9gTKif6zjLjP7vkH&lt;br /&gt;
 bdtJxsuWPoEqwMkdgqZrfNbJp0O4pVddovJ/agtdF3R2YJ+W+DH0HOfl1QKBgFnM&lt;br /&gt;
 c2zEEYEhaQRBUHP1gXO0rouPCI4L9e2/0QPL2/QBJzzxBuzH4X1NhsI7V7OrqOIp&lt;br /&gt;
 e0fiy7Y3q369I2ko1HY4rQln4z0c72VcWOCYKQbBqrInfCBNdPWWK93wNr2pk0gh&lt;br /&gt;
 cGqqtteDLVrIBbCVfsOTMWN/cZ7y/zi4A23sPoQBAoGAEPzcIjOyoB97Pzd7iNim&lt;br /&gt;
 Gin8RkwXIiFGSHo8vAh74CKBNokThM50OUNm5T2eJ4huzPpowQ+ID1mB5EjEai9n&lt;br /&gt;
 JY9ll3cUpawiIIW/6uGTHyXfvZWNtqEYXrVJ6fcDaKcW4y3cplNj/SJaBW8HXsW7&lt;br /&gt;
 YGHW3zHsgy7EOAOzPwlm9oE=&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
 RSA Private-Key: (2048 bit, 2 primes)&lt;br /&gt;
 modulus:&lt;br /&gt;
     00:d9:0f:a2:0c:2d:11:64:e0:26:85:c3:4a:e1:46:&lt;br /&gt;
     27:a7:c2:e1:39:11:9e:b1:14:4f:1e:dc:2e:53:56:&lt;br /&gt;
     2d:7e:77:d1:27:86:2d:fc:46:09:30:0f:b5:25:5b:&lt;br /&gt;
     13:c4:e8:05:a1:a7:94:f7:91:fa:c5:59:d6:a4:d6:&lt;br /&gt;
     56:45:54:fa:7b:fd:bb:4e:28:b8:ca:52:bb:b5:e6:&lt;br /&gt;
     72:e8:03:80:0a:62:dc:fd:5b:d3:e1:b0:cd:1d:cb:&lt;br /&gt;
     32:dc:e8:54:3a:2b:84:5e:41:a9:b9:a4:70:aa:23:&lt;br /&gt;
     6c:c5:f3:63:30:13:e7:88:01:db:af:ba:ac:a8:40:&lt;br /&gt;
     b2:a2:23:ad:3c:10:0a:d6:66:a0:ed:31:4a:41:27:&lt;br /&gt;
     3b:f4:51:51:18:bd:17:67:31:6a:42:c1:fc:e9:23:&lt;br /&gt;
     e8:4f:27:2c:15:09:c4:e5:34:24:ff:72:d1:a0:04:&lt;br /&gt;
     ac:88:c7:e7:43:b9:9e:db:47:d3:0d:99:25:bb:1a:&lt;br /&gt;
     b7:89:11:b4:c7:f9:1d:77:c5:3d:dd:77:f2:42:91:&lt;br /&gt;
     ad:7e:2d:80:a5:e2:1d:2a:a1:68:45:3e:13:a4:bd:&lt;br /&gt;
     0c:e6:99:2c:d4:99:99:40:95:30:d0:2e:fd:9e:01:&lt;br /&gt;
     d2:48:ad:07:2c:9c:a6:77:4a:c2:0e:08:2f:f7:22:&lt;br /&gt;
     9a:b0:4b:3a:62:77:7f:08:96:5e:0e:c4:7e:97:22:&lt;br /&gt;
     b5:45&lt;br /&gt;
 publicExponent: 65537 (0x10001)&lt;br /&gt;
 privateExponent:&lt;br /&gt;
     00:9d:8c:0b:42:6b:33:c4:d4:2d:21:c9:ad:ff:f4:&lt;br /&gt;
     bb:b3:b8:6f:60:cc:b9:32:2e:5b:7f:3a:b1:25:2b:&lt;br /&gt;
     d7:b9:83:9d:fb:e2:18:5e:93:36:f7:fb:6e:af:be:&lt;br /&gt;
     7b:8a:e0:1d:b6:47:bc:88:35:1c:9f:41:a5:d9:de:&lt;br /&gt;
     f8:9f:3a:1e:d5:00:45:83:65:6b:3a:ee:f1:f0:05:&lt;br /&gt;
     64:41:a2:c8:bc:c1:25:45:7f:f1:3a:4e:e9:92:46:&lt;br /&gt;
     7a:94:7c:cd:25:ab:90:58:19:b0:e7:5d:c3:a8:ba:&lt;br /&gt;
     2d:a9:40:0f:2e:46:44:37:23:a2:20:da:8d:97:51:&lt;br /&gt;
     de:56:71:2e:bb:f9:a8:e4:14:23:5b:ca:4d:fe:19:&lt;br /&gt;
     b3:64:e5:de:09:da:27:f2:25:d6:00:47:21:0f:56:&lt;br /&gt;
     f7:15:07:f2:33:c1:23:08:f9:d6:25:f0:0a:1f:07:&lt;br /&gt;
     d0:18:83:3e:f1:64:53:b7:07:20:50:8f:b0:98:46:&lt;br /&gt;
     b0:6a:7a:39:2d:ee:4b:0c:10:b9:21:3e:36:a6:ee:&lt;br /&gt;
     3d:f5:62:97:2b:02:73:08:19:76:e9:27:ca:2a:34:&lt;br /&gt;
     40:ed:58:7c:c0:4b:eb:e5:e8:28:4f:db:14:7b:27:&lt;br /&gt;
     37:e1:73:cd:cc:d0:83:db:16:ca:2c:15:47:ed:c4:&lt;br /&gt;
     78:8f:64:a7:82:52:12:53:61:da:7a:86:f7:a8:b8:&lt;br /&gt;
     40:01&lt;br /&gt;
 prime1:&lt;br /&gt;
     00:ef:a3:8b:50:6a:d2:84:76:f8:b1:aa:0f:69:89:&lt;br /&gt;
     c1:00:a2:c4:75:68:f9:2b:8f:37:25:d6:3a:05:26:&lt;br /&gt;
     dd:77:94:64:0d:b2:46:f0:4c:66:71:b7:d3:6a:cf:&lt;br /&gt;
     c1:19:d2:9c:e2:25:42:93:15:77:ca:cc:4a:9d:7d:&lt;br /&gt;
     7c:3d:fc:40:4c:70:cb:2f:c3:4c:6b:e8:06:81:96:&lt;br /&gt;
     39:a1:32:94:b2:b5:c4:a5:2d:77:d8:78:42:27:d4:&lt;br /&gt;
     fd:2e:87:ac:42:34:5b:e2:43:99:1f:c3:ce:56:a9:&lt;br /&gt;
     ba:3b:85:df:94:2b:74:cb:5f:8c:d5:e4:07:23:53:&lt;br /&gt;
     4f:3b:d0:a6:3c:18:28:b8:45&lt;br /&gt;
 prime2:&lt;br /&gt;
     00:e7:e1:78:49:2f:11:33:26:11:91:4f:e4:c7:5f:&lt;br /&gt;
     79:7f:08:74:86:16:8e:12:5c:eb:13:c9:99:a2:ed:&lt;br /&gt;
     cd:14:bf:d7:4f:af:fd:b7:ed:be:ee:c3:13:ba:24:&lt;br /&gt;
     02:3f:dc:c8:6b:ab:3e:fe:ba:d7:76:35:ad:ad:37:&lt;br /&gt;
     03:a7:85:a5:0c:84:da:b3:45:14:81:98:6f:61:50:&lt;br /&gt;
     50:04:5e:2f:84:7c:48:57:02:71:9d:3f:46:c2:2e:&lt;br /&gt;
     17:33:52:65:16:65:47:a1:f5:83:ef:53:fa:0d:17:&lt;br /&gt;
     bb:8d:25:91:4b:70:ae:8c:fd:c0:13:db:e6:a5:63:&lt;br /&gt;
     31:b4:4d:43:f6:a2:e2:59:01&lt;br /&gt;
 exponent1:&lt;br /&gt;
     78:e3:92:f3:15:80:6f:ac:a8:d6:cf:88:88:e0:22:&lt;br /&gt;
     4a:14:d2:70:bc:6c:fe:89:77:f3:91:77:a1:83:b2:&lt;br /&gt;
     b3:91:5b:4c:01:84:81:d2:b8:d7:63:39:b7:27:69:&lt;br /&gt;
     2d:82:ae:fb:f2:79:fc:43:17:34:6a:0c:b6:18:48:&lt;br /&gt;
     a5:e8:6b:f3:63:ef:4c:80:04:3c:67:47:68:f6:04:&lt;br /&gt;
     ca:89:fe:b3:8c:b8:cf:ee:f9:07:6d:db:49:c6:cb:&lt;br /&gt;
     96:3e:81:2a:c0:c9:1d:82:a6:6b:7c:d6:c9:a7:43:&lt;br /&gt;
     b8:a5:57:5d:a2:f2:7f:6a:0b:5d:17:74:76:60:9f:&lt;br /&gt;
     96:f8:31:f4:1c:e7:e5:d5&lt;br /&gt;
 exponent2:&lt;br /&gt;
     59:cc:73:6c:c4:11:81:21:69:04:41:50:73:f5:81:&lt;br /&gt;
     73:b4:ae:8b:8f:08:8e:0b:f5:ed:bf:d1:03:cb:db:&lt;br /&gt;
     f4:01:27:3c:f1:06:ec:c7:e1:7d:4d:86:c2:3b:57:&lt;br /&gt;
     b3:ab:a8:e2:29:7b:47:e2:cb:b6:37:ab:7e:bd:23:&lt;br /&gt;
     69:28:d4:76:38:ad:09:67:e3:3d:1c:ef:65:5c:58:&lt;br /&gt;
     e0:98:29:06:c1:aa:b2:27:7c:20:4d:74:f5:96:2b:&lt;br /&gt;
     dd:f0:36:bd:a9:93:48:21:70:6a:aa:b6:d7:83:2d:&lt;br /&gt;
     5a:c8:05:b0:95:7e:c3:93:31:63:7f:71:9e:f2:ff:&lt;br /&gt;
     38:b8:03:6d:ec:3e:84:01&lt;br /&gt;
 coefficient:&lt;br /&gt;
     10:fc:dc:22:33:b2:a0:1f:7b:3f:37:7b:88:d8:a6:&lt;br /&gt;
     1a:29:fc:46:4c:17:22:21:46:48:7a:3c:bc:08:7b:&lt;br /&gt;
     e0:22:81:36:89:13:84:ce:74:39:43:66:e5:3d:9e:&lt;br /&gt;
     27:88:6e:cc:fa:68:c1:0f:88:0f:59:81:e4:48:c4:&lt;br /&gt;
     6a:2f:67:25:8f:65:97:77:14:a5:ac:22:20:85:bf:&lt;br /&gt;
     ea:e1:93:1f:25:df:bd:95:8d:b6:a1:18:5e:b5:49:&lt;br /&gt;
     e9:f7:03:68:a7:16:e3:2d:dc:a6:53:63:fd:22:5a:&lt;br /&gt;
     05:6f:07:5e:c5:bb:60:61:d6:df:31:ec:83:2e:c4:&lt;br /&gt;
     38:03:b3:3f:09:66:f6:81&lt;br /&gt;
&lt;br /&gt;
Keep in mind the above key was generated solely for pedagogical purposes; never give anyone access to your private keys.&lt;br /&gt;
&lt;br /&gt;
==Generating a Public Key==&lt;br /&gt;
&lt;br /&gt;
Having previously generated your private key, you may generate the corresponding public key using the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -out public-key.pem -pubout&lt;br /&gt;
&lt;br /&gt;
You may once again view the key details, using a slightly different command this time.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in public-key.pem -pubin -text&lt;br /&gt;
&lt;br /&gt;
The output for the public key will be shorter, as it carries much less information, and it will look something like this.&lt;br /&gt;
&lt;br /&gt;
 -----BEGIN PUBLIC KEY-----&lt;br /&gt;
 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Q+iDC0RZOAmhcNK4UYn&lt;br /&gt;
 p8LhORGesRRPHtwuU1YtfnfRJ4Yt/EYJMA+1JVsTxOgFoaeU95H6xVnWpNZWRVT6&lt;br /&gt;
 e/27Tii4ylK7teZy6AOACmLc/VvT4bDNHcsy3OhUOiuEXkGpuaRwqiNsxfNjMBPn&lt;br /&gt;
 iAHbr7qsqECyoiOtPBAK1mag7TFKQSc79FFRGL0XZzFqQsH86SPoTycsFQnE5TQk&lt;br /&gt;
 /3LRoASsiMfnQ7me20fTDZkluxq3iRG0x/kdd8U93XfyQpGtfi2ApeIdKqFoRT4T&lt;br /&gt;
 pL0M5pks1JmZQJUw0C79ngHSSK0HLJymd0rCDggv9yKasEs6Ynd/CJZeDsR+lyK1&lt;br /&gt;
 RQIDAQAB&lt;br /&gt;
 -----END PUBLIC KEY-----&lt;br /&gt;
 RSA Public-Key: (2048 bit)&lt;br /&gt;
 Modulus:&lt;br /&gt;
     00:d9:0f:a2:0c:2d:11:64:e0:26:85:c3:4a:e1:46:&lt;br /&gt;
     27:a7:c2:e1:39:11:9e:b1:14:4f:1e:dc:2e:53:56:&lt;br /&gt;
     2d:7e:77:d1:27:86:2d:fc:46:09:30:0f:b5:25:5b:&lt;br /&gt;
     13:c4:e8:05:a1:a7:94:f7:91:fa:c5:59:d6:a4:d6:&lt;br /&gt;
     56:45:54:fa:7b:fd:bb:4e:28:b8:ca:52:bb:b5:e6:&lt;br /&gt;
     72:e8:03:80:0a:62:dc:fd:5b:d3:e1:b0:cd:1d:cb:&lt;br /&gt;
     32:dc:e8:54:3a:2b:84:5e:41:a9:b9:a4:70:aa:23:&lt;br /&gt;
     6c:c5:f3:63:30:13:e7:88:01:db:af:ba:ac:a8:40:&lt;br /&gt;
     b2:a2:23:ad:3c:10:0a:d6:66:a0:ed:31:4a:41:27:&lt;br /&gt;
     3b:f4:51:51:18:bd:17:67:31:6a:42:c1:fc:e9:23:&lt;br /&gt;
     e8:4f:27:2c:15:09:c4:e5:34:24:ff:72:d1:a0:04:&lt;br /&gt;
     ac:88:c7:e7:43:b9:9e:db:47:d3:0d:99:25:bb:1a:&lt;br /&gt;
     b7:89:11:b4:c7:f9:1d:77:c5:3d:dd:77:f2:42:91:&lt;br /&gt;
     ad:7e:2d:80:a5:e2:1d:2a:a1:68:45:3e:13:a4:bd:&lt;br /&gt;
     0c:e6:99:2c:d4:99:99:40:95:30:d0:2e:fd:9e:01:&lt;br /&gt;
     d2:48:ad:07:2c:9c:a6:77:4a:c2:0e:08:2f:f7:22:&lt;br /&gt;
     9a:b0:4b:3a:62:77:7f:08:96:5e:0e:c4:7e:97:22:&lt;br /&gt;
     b5:45&lt;br /&gt;
 Exponent: 65537 (0x10001)&lt;br /&gt;
&lt;br /&gt;
For more information on generating keys, see the source code documentation, located in the &amp;lt;tt&amp;gt;doc/HOWTO/keys.txt&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Generating Keys Based on Elliptic Curves==&lt;br /&gt;
&lt;br /&gt;
There are essentially two steps to generating a key:&lt;br /&gt;
&lt;br /&gt;
# Generate the parameters for the specific curve you are using&lt;br /&gt;
# Use those parameters to generate the key&lt;br /&gt;
&lt;br /&gt;
To see the list of curves instrinsically supported by openssl, you can use the &amp;lt;tt&amp;gt;-list_curves&amp;lt;/t&amp;gt; option when calling the &amp;lt;tt&amp;gt;ecparam&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -list_curves&lt;br /&gt;
   secp112r1 : SECG/WTLS curve over a 112 bit prime field&lt;br /&gt;
   secp112r2 : SECG curve over a 112 bit prime field&lt;br /&gt;
   secp128r1 : SECG curve over a 128 bit prime field&lt;br /&gt;
   secp128r2 : SECG curve over a 128 bit prime field&lt;br /&gt;
   secp160k1 : SECG curve over a 160 bit prime field&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
For this example I will use the &amp;lt;tt&amp;gt;prime256v1&amp;lt;/tt&amp;gt; curve, which is an &amp;lt;tt&amp;gt;X9.62/SECG&amp;lt;/tt&amp;gt; curve over a 256 bit prime field.&lt;br /&gt;
&lt;br /&gt;
===Generating the Curve Parameters===&lt;br /&gt;
&lt;br /&gt;
Having selected our curve, we now call &amp;lt;tt&amp;gt;ecparam&amp;lt;/tt&amp;gt; to generate our parameters file.&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -name prime256v1 -out prime256v1.pem&lt;br /&gt;
&lt;br /&gt;
====Printing Parameters to Standard Out====&lt;br /&gt;
&lt;br /&gt;
You can print the generated curve parameters to the terminal output with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -in prime256v1.pem -noout -text&lt;br /&gt;
 ASN1 OID: prime256v1&lt;br /&gt;
 NIST CURVE: P-256&lt;br /&gt;
&lt;br /&gt;
====Printing Parameters as C Code====&lt;br /&gt;
&lt;br /&gt;
Analogously, you may also output the generated curve parameters as C code. The parameters can then be loaded by calling the &amp;lt;tt&amp;gt;get_ec_group_XXX()&amp;lt;/tt&amp;gt; function. To print the C code to the current terminal's output, the following command may be used:&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -in prime256v1.pem -noout -C&lt;br /&gt;
&lt;br /&gt;
And here are the first few lines of the corresponding output:&lt;br /&gt;
&lt;br /&gt;
 EC_GROUP *get_ec_group_256(void)&lt;br /&gt;
 {&lt;br /&gt;
     static unsigned char ec_p_256[] = {&lt;br /&gt;
         0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,&lt;br /&gt;
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
         0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
===Generating the Key===&lt;br /&gt;
&lt;br /&gt;
With the curve parameters in hand, we are now free to generate the key. Just as with the [#Generating an RSA Private Key|RSA] example above, we may optionally specify a cipher algorithm with which to encrypt the private key. The call to generate the key using the elliptic curve parameters generated in the example above looks like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -paramfile prime256v1.pem -out private-key.pem&lt;br /&gt;
 Enter PEM pass phrase:&lt;br /&gt;
 Verifying - Enter PEM pass phrase:&lt;br /&gt;
&lt;br /&gt;
===Putting it All Together===&lt;br /&gt;
&lt;br /&gt;
The process of generation a curve based on elliptic-curves can be streamlined by calling the &amp;lt;tt&amp;gt;genpkey&amp;lt;/tt&amp;gt; command directly and specifying both the algorithm and the name of the curve to use for parameter generation. In it's simplest form, the command to generate a key based on the same curve as in the example above looks like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256&lt;br /&gt;
&lt;br /&gt;
This command will result in the generated key being printed to the terminal's output.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256&lt;br /&gt;
 &lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgqqYoJGowXJ5/GTkB&lt;br /&gt;
 SRLnBMNWLoQ2RM/QxrY+bfDDGRahRANCAASPY4eTANkwIIAWhh32eoFl2YFLJSWy&lt;br /&gt;
 bdITdZ82O5JDpDijmGmJ2hepe5afek9WVqxMPYjmbTwMPO3xMGbqUiJD&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
&lt;br /&gt;
Remember that you can specify a cipher algorithm to encrypt the key with, which something you may or may not want to do, depending on your specific use case. Here is a slightly more complete example showing a key generated with a password and written to a specific output file.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out private-key.pem&lt;br /&gt;
 Enter PEM pass phrase:&lt;br /&gt;
 Verifying - Enter PEM pass phrase:&lt;br /&gt;
&lt;br /&gt;
Just as with the previous example, you can use the &amp;lt;tt&amp;gt;pkey&amp;lt;/tt&amp;gt; command to inspect your newly-generated key.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -text&lt;br /&gt;
 Enter pass phrase for private-key.pem:&lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgEO7CxgTwi0hsjdbp&lt;br /&gt;
 sXWuU2x2flLthxqXabYDOqOZCvuhRANCAAQVTLkeCBJdvMnqwZKYJxrPvTTuanrD&lt;br /&gt;
 NkyAPQCARKsQ7bVrP6ky/5uAcAvjuZB0xKCcSp7roXLWRzD/y/ik8P5R&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
 Private-Key: (256 bit)&lt;br /&gt;
 priv:&lt;br /&gt;
     10:ee:c2:c6:04:f0:8b:48:6c:8d:d6:e9:b1:75:ae:&lt;br /&gt;
     53:6c:76:7e:52:ed:87:1a:97:69:b6:03:3a:a3:99:&lt;br /&gt;
     0a:fb&lt;br /&gt;
 pub:&lt;br /&gt;
     04:15:4c:b9:1e:08:12:5d:bc:c9:ea:c1:92:98:27:&lt;br /&gt;
     1a:cf:bd:34:ee:6a:7a:c3:36:4c:80:3d:00:80:44:&lt;br /&gt;
     ab:10:ed:b5:6b:3f:a9:32:ff:9b:80:70:0b:e3:b9:&lt;br /&gt;
     90:74:c4:a0:9c:4a:9e:eb:a1:72:d6:47:30:ff:cb:&lt;br /&gt;
     f8:a4:f0:fe:51&lt;br /&gt;
 ASN1 OID: prime256v1&lt;br /&gt;
 NIST CURVE: P-256&lt;br /&gt;
&lt;br /&gt;
For more details on elliptic curve cryptography or key generation, check out the [https://www.openssl.org/docs/manpages.html manpages].&lt;br /&gt;
&lt;br /&gt;
==Base64 Encoding Strings==&lt;br /&gt;
&lt;br /&gt;
For simple string encoding, you can use &amp;quot;here string&amp;quot; syntax with the [[Base64 Encoding|base64]] command as below. Intuitively, the &amp;lt;tt&amp;gt;-e&amp;lt;/tt&amp;gt; flag specifies the action to be encoding.&lt;br /&gt;
&lt;br /&gt;
 $ openssl base64 -e &amp;lt;&amp;lt;&amp;lt; 'Welcome to openssl wiki'&lt;br /&gt;
 V2VsY29tZSB0byBvcGVuc3NsIHdpa2kK&lt;br /&gt;
&lt;br /&gt;
Similarly, the base64 command's &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; flag may be used to indicate decoding mode.&lt;br /&gt;
&lt;br /&gt;
 $ openssl base64 -d &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kK'&lt;br /&gt;
 Welcome to openssl wiki&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Note:''''' base64 line length is limited to 76 characters by default in openssl (and generated with 64 characters per line).&lt;br /&gt;
&lt;br /&gt;
 openssl base64 -e &amp;lt;&amp;lt;&amp;lt; 'Welcome to openssl wiki with a very long line that splits...'&lt;br /&gt;
 V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRo&lt;br /&gt;
 YXQgc3BsaXRzLi4uCg==&lt;br /&gt;
 openssl base64 -d &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRoYXQgc3BsaXRzLi4uCg=='&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; NOTHING!&lt;br /&gt;
&lt;br /&gt;
To be able to decode a base64 line without line feeds that exceeds the default 76 character length restriction use the &amp;lt;code&amp;gt;-A&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
 openssl base64 -d -A &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRoYXQgc3BsaXRzLi4uCg=='&lt;br /&gt;
 Welcome to openssl wiki with a very long line that splits...&lt;br /&gt;
&lt;br /&gt;
It is recommended to actually split base64 strings into multiple lines of 64 characters, however, since the &amp;lt;code&amp;gt;-A&amp;lt;/code&amp;gt; option is buggy, particularly with its handling of long files.&lt;br /&gt;
&lt;br /&gt;
==Generating a File Hash==&lt;br /&gt;
&lt;br /&gt;
One of the most basic uses of the [[dgst]] command (short for digest) is viewing the hash of a given file. To do this, simply invoke the command with the specified digest algorithm to use. For this example, I will be hashing an arbitrary file on my system using the [[MD5]], [[SHA1]], and [[SHA384]] algorithms.&lt;br /&gt;
&lt;br /&gt;
 $ openssl dgst -md5 primes.dat&lt;br /&gt;
 MD5(primes.dat)= 7710839bb87d2c4c15a86c2b2c805664&lt;br /&gt;
 &lt;br /&gt;
 $ openssl dgst -sha1 primes.dat&lt;br /&gt;
 SHA1(primes.dat)= 5dfab70ce825591689f4a3f65910870a9022cd32&lt;br /&gt;
 &lt;br /&gt;
 $ openssl dgst -sha384 primes.dat&lt;br /&gt;
 SHA384(primes.dat)= 41399bdffe6850f5a44852d967f3db415654f20dc2eb6cd231772f6ea411876d85d44091ebbc6b1f4ce8673e64617271&lt;br /&gt;
&lt;br /&gt;
For a list of the available digest algorithms, you can use the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -digest-algorithms&lt;br /&gt;
 RSA-MD4 =&amp;gt; MD4&lt;br /&gt;
 RSA-MD5 =&amp;gt; MD5&lt;br /&gt;
 RSA-MDC2 =&amp;gt; MDC2&lt;br /&gt;
 RSA-RIPEMD160 =&amp;gt; RIPEMD160&lt;br /&gt;
 RSA-SHA1 =&amp;gt; SHA1&lt;br /&gt;
 RSA-SHA1-2 =&amp;gt; RSA-SHA1&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
You can also use a similar command to see the available [[Digest Commands|digest commands]]:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -digest-commands&lt;br /&gt;
 blake2b512        blake2s256        md5               sha1              &lt;br /&gt;
 sha224            sha256            sha3-224          sha3-256          &lt;br /&gt;
 sha3-384          sha3-512          sha384            sha512            &lt;br /&gt;
 sha512-224        sha512-256        shake128          shake256          &lt;br /&gt;
 sm3  &lt;br /&gt;
&lt;br /&gt;
Below are three sample invocations of the [[md5]], [[sha1]], and [[sha384]] digest commands using the same file as the [[dgst]] command invocation above.&lt;br /&gt;
&lt;br /&gt;
 $ openssl md5 primes.dat&lt;br /&gt;
 MD5(primes.dat)= 7710839bb87d2c4c15a86c2b2c805664&lt;br /&gt;
 &lt;br /&gt;
 $ openssl sha1 primes.dat&lt;br /&gt;
 SHA1(primes.dat)= 5dfab70ce825591689f4a3f65910870a9022cd32&lt;br /&gt;
 &lt;br /&gt;
 $ openssl sha384 primes.dat&lt;br /&gt;
 SHA384(primes.dat)= 41399bdffe6850f5a44852d967f3db415654f20dc2eb6cd231772f6ea411876d85d44091ebbc6b1f4ce8673e64617271&lt;br /&gt;
&lt;br /&gt;
==File Encryption and Decryption==&lt;br /&gt;
&lt;br /&gt;
The following example demonstrates a simple file encryption and decryption using the [[enc]] command. The first argument is the cipher algorithm to use for encrypting the file. For this example I carefully selected the [[AES-256]] algorithm in [[CBC Mode]] by looking up the available ciphers and picking out the first one I saw. To see the list of available ciphers, you can use the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -ciphers&lt;br /&gt;
 Supported ciphers:&lt;br /&gt;
 -aes-128-cbc               -aes-128-cfb               -aes-128-cfb1             &lt;br /&gt;
 -aes-128-cfb8              -aes-128-ctr               -aes-128-ecb              &lt;br /&gt;
 -aes-128-ofb               -aes-192-cbc               -aes-192-cfb              &lt;br /&gt;
 -aes-192-cfb1              -aes-192-cfb8              -aes-192-ctr&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
You can also use the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -cipher-algorithms&lt;br /&gt;
 AES-128-CBC&lt;br /&gt;
 AES-128-CBC-HMAC-SHA1&lt;br /&gt;
 AES-128-CBC-HMAC-SHA256&lt;br /&gt;
 id-aes128-CCM&lt;br /&gt;
 AES-128-CFB&lt;br /&gt;
 AES-128-CFB1&lt;br /&gt;
 AES-128-CFB8&lt;br /&gt;
 AES-128-CTR&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Having selected an encryption algorithm, you must then specify whether the action you are taking is either encryption or decryption via the &amp;lt;tt&amp;gt;-e&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; flags, respectively. The &amp;lt;tt&amp;gt;-iter&amp;lt;/tt&amp;gt; flag specifies the number of iterations on the password used for deriving the encryption key. A higher iteration count increases the time required to brute-force the resulting file. Using this option implies enabling use of the [[Password-Based Key Derivation Function 2]], usually set using the &amp;lt;tt&amp;gt;-pbkdf2&amp;lt;/tt&amp;gt; flag. We then use the &amp;lt;tt&amp;gt;-salt&amp;lt;/tt&amp;gt; flag to enable the use of a randomly generated salt in the key-derivation function.&lt;br /&gt;
&lt;br /&gt;
Putting it all together, you can see the command to encrypt a file and the corresponding output below. Note that the passwords entered by the user are blank, just as they would usually be in a terminal session.&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -aes-256-cbc -e -iter 1000 -salt -in primes.dat -out primes.enc&lt;br /&gt;
 enter aes-256-cbc encryption password:&lt;br /&gt;
 Verifying - enter aes-256-cbc encryption password:&lt;br /&gt;
&lt;br /&gt;
The analogous decryption command is as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -aes-256-cbc -d -iter 1000 -in primes.enc -out primes.dec&lt;br /&gt;
 enter aes-256-cbc decryption password:&lt;br /&gt;
&lt;br /&gt;
= Further reading =&lt;br /&gt;
&lt;br /&gt;
* Paul Heinlein. [https://www.madboa.com/geek/openssl/ &amp;quot;OpenSSL Command-Line HOWTO&amp;quot;]. Has many quick cookbook-style recipes for doing common tasks using the &amp;quot;openssl&amp;quot; command-line application.&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
[[Category:Shell level]]&lt;/div&gt;</summary>
		<author><name>DDvO</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Command_Line_Utilities&amp;diff=3216</id>
		<title>Command Line Utilities</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Command_Line_Utilities&amp;diff=3216"/>
		<updated>2022-06-24T11:52:12Z</updated>

		<summary type="html">&lt;p&gt;DDvO: Move the Commands section just after the other more general sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''openssl''' program provides a rich variety of commands, each of which often has a wealth of options and arguments. Many commands use an external configuration file for some or all of their arguments and have a &amp;lt;code&amp;gt;-config&amp;lt;/code&amp;gt; option to specify that file. The environment variable [[OPENSSL_CONF]] can be used to specify the location of the configuration file. If the environment variable is not specified, a default file is created in the default certificate storage area called '''openssl.cnf'''. The settings in this default configuration file depend on the flags set when the version of OpenSSL being used was built.&lt;br /&gt;
&lt;br /&gt;
This article is an overview of the available tools provided by OpenSSL. For all of the details on usage and implementation, you can find the [https://www.openssl.org/docs/manmaster/man1/ manpages], which are automatically generated from the source code at the [https://www.openssl.org/ official OpenSSL project home]. Likewise, the source code itself may be found on the [https://www.openssl.org/source/ OpenSSL project home page], as well as on the [https://github.com/openssl/openssl OpenSSL Github]. The main OpenSSL site also includes an [https://www.openssl.org/docs/manmaster/man1/openssl.html overview of the command-line utilities], as well as links to all of their respective documentation.&lt;br /&gt;
&lt;br /&gt;
=Getting Started=&lt;br /&gt;
&lt;br /&gt;
The entry point for the OpenSSL library is the '''openssl''' binary, usually &amp;lt;tt&amp;gt;/usr/bin/openssl&amp;lt;/tt&amp;gt; on Linux. The general syntax for calling '''openssl''' is as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl command [ command_options ] [ command_arguments ]&lt;br /&gt;
&lt;br /&gt;
Before OpenSSL 3.0, you could call '''openssl''' without arguments to enter the interactive mode prompt and then enter commands directly, exiting with either a &amp;lt;code&amp;gt;quit&amp;lt;/code&amp;gt; command or by issuing a termination signal with either &amp;lt;tt&amp;gt;Ctrl+C&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Ctrl+D&amp;lt;/tt&amp;gt;. The following is a sample interactive session in which the user invokes the [[prime]] command twice before using the &amp;lt;tt&amp;gt;quit&amp;lt;/tt&amp;gt; command to terminate the session.&lt;br /&gt;
&lt;br /&gt;
 OpenSSL&amp;gt; prime -generate -bits 24&lt;br /&gt;
 13467269&lt;br /&gt;
 OpenSSL&amp;gt; prime -generate -bits 24&lt;br /&gt;
 16651079&lt;br /&gt;
 OpenSSL&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
=Basic Tasks=&lt;br /&gt;
&lt;br /&gt;
This section is a brief tutorial on performing the most basic tasks using OpenSSL. For a detailed explanation of the rationale behind the syntax and semantics of the commands shown here, see the section on [[#Commands|Commands]].&lt;br /&gt;
&lt;br /&gt;
==Getting Help==&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, the general syntax of a command is &amp;lt;code&amp;gt;openssl command [ command_options ] [ command_arguments ]&amp;lt;/code&amp;gt;. The '''help''' command is no different, but it does have its idiosyncrasies. To view the top-level help menu, you can call '''openssl''' as follows.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help&lt;br /&gt;
&lt;br /&gt;
Since OpenSSL 3.0, there are equivalent invocations such as:&lt;br /&gt;
&lt;br /&gt;
 $ openssl --help&lt;br /&gt;
 $ openssl -h&lt;br /&gt;
&lt;br /&gt;
This query will print all of the available commands, like so:&lt;br /&gt;
&lt;br /&gt;
 Standard commands&lt;br /&gt;
 asn1parse         ca                ciphers           cmp               &lt;br /&gt;
 cms               crl               crl2pkcs7         dgst              &lt;br /&gt;
 dhparam           dsa               dsaparam          ec &lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Note the above output was truncated, so only the first four lines of output are shown.&lt;br /&gt;
&lt;br /&gt;
The same output is obtained also with&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -standard-commands&lt;br /&gt;
&lt;br /&gt;
A help menu for each command may be requested in two different ways. First, the same command used above may be repeated, followed by the name of the command to print help for.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help genpkey&lt;br /&gt;
&lt;br /&gt;
The program will then display the valid options for the given command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help genpkey&lt;br /&gt;
 General options:&lt;br /&gt;
  -help               Display this summary&lt;br /&gt;
  -engine val         Use engine, possibly a hardware device&lt;br /&gt;
  -paramfile infile   Parameters file&lt;br /&gt;
  -algorithm val      The public key algorithm&lt;br /&gt;
  -quiet              Do not output status while generating keys&lt;br /&gt;
  -pkeyopt val        Set the public key algorithm option as opt:value&lt;br /&gt;
  -config infile      Load a configuration file (this may load modules)&lt;br /&gt;
 Output options:&lt;br /&gt;
  -out outfile        Output file&lt;br /&gt;
  -outform PEM|DER    output format (DER or PEM)&lt;br /&gt;
  -pass val           Output file pass phrase source&lt;br /&gt;
  -genparam           Generate parameters, not key&lt;br /&gt;
  -text               Print the in text&lt;br /&gt;
  -*                  Cipher to use to encrypt the key&lt;br /&gt;
 Provider options:&lt;br /&gt;
  -provider-path val  Provider load path (must be before 'provider' argument if required)&lt;br /&gt;
  -provider val       Provider to load (can be specified multiple times)&lt;br /&gt;
  -propquery val      Property query used when fetching algorithms&lt;br /&gt;
 Order of options may be important!  See the documentation.&lt;br /&gt;
&lt;br /&gt;
The second way of requesting the help menu for a particular command is by using the first option in the output shown above, namely &amp;lt;code&amp;gt;openssl command -help&amp;lt;/code&amp;gt;. Both commands will yield the same output; the help menu displayed will be exactly the same.&lt;br /&gt;
&lt;br /&gt;
For additional information on the usage of a particular command, the project [https://www.openssl.org/docs/manmaster/man1/ manpages] are the definite source of information.&lt;br /&gt;
The manpages may be views in a shell as usual, e.g.&lt;br /&gt;
&lt;br /&gt;
 $ man openssl&lt;br /&gt;
 $ man openssl-genpkey&lt;br /&gt;
 $ man genpkey&lt;br /&gt;
&lt;br /&gt;
Another way of accessing the manpages is via the project perldocs. [https://perldoc.perl.org/perldoc perldoc] is a utility included with most if not all [https://www.perl.org/ Perl] distributions, and it's capable of displaying documentation information in a variety of formats, one of which is as manpages. Not surprisingly, the project documentation is generated from the '''pod''' files located in the &amp;lt;tt&amp;gt;doc&amp;lt;/tt&amp;gt; directory of the source code.&lt;br /&gt;
&lt;br /&gt;
==Getting Library Version Information==&lt;br /&gt;
&lt;br /&gt;
 $ openssl version&lt;br /&gt;
 OpenSSL 3.0.4 21 Jun 2022 (Library: OpenSSL 3.0.4 21 Jun 2022)&lt;br /&gt;
&lt;br /&gt;
As mentioned above, the &amp;lt;tt&amp;gt;version&amp;lt;/tt&amp;gt; command's help menu may be queried for additional options like so:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -help&lt;br /&gt;
 Usage: version [options]&lt;br /&gt;
 General options:&lt;br /&gt;
  -help  Display this summary&lt;br /&gt;
 Output options:&lt;br /&gt;
  -a     Show all data&lt;br /&gt;
  -b     Show build date&lt;br /&gt;
  -d     Show configuration directory&lt;br /&gt;
  -e     Show engines directory&lt;br /&gt;
  -m     Show modules directory&lt;br /&gt;
  -f     Show compiler flags used&lt;br /&gt;
  -o     Show some internal datatype options&lt;br /&gt;
  -p     Show target build platform&lt;br /&gt;
  -r     Show random seeding options&lt;br /&gt;
  -v     Show library version&lt;br /&gt;
  -c     Show CPU settings info&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;tt&amp;gt;-a&amp;lt;/tt&amp;gt; option to show all version information yields the following output on my current machine:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -a&lt;br /&gt;
 OpenSSL 3.0.4 21 Jun 2022 (Library: OpenSSL 3.0.4 21 Jun 2022)&lt;br /&gt;
 built on: Fri Jun 24 08:58:53 2022 UTC&lt;br /&gt;
 platform: linux-x86_64&lt;br /&gt;
 options:  bn(64,64)&lt;br /&gt;
 compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
 ENGINESDIR: &amp;quot;/usr/local/lib64/engines-3&amp;quot;&lt;br /&gt;
 MODULESDIR: &amp;quot;/usr/local/lib64/ossl-modules&amp;quot;&lt;br /&gt;
 Seeding source: os-specific&lt;br /&gt;
 CPUINFO: OPENSSL_ia32cap=0x7ffaf3ffffebffff:0x29c67af&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Commands=&lt;br /&gt;
&lt;br /&gt;
There are three different kinds of commands. These are [[Standard commands|standard commands]], [[Cipher commands|cipher commands]], and [[Digest comands|digest commands]]. Calling the OpenSSL top-level &amp;lt;tt&amp;gt;help&amp;lt;/tt&amp;gt; command with no arguments will result in openssl printing all available commands by group, sorted alphabetically.&lt;br /&gt;
&lt;br /&gt;
==Standard Commands==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto; text-align: center; width: 65%;&amp;quot;&lt;br /&gt;
|+ Overview of OpenSSL's command line utilities&lt;br /&gt;
! style=&amp;quot;width: 25%; padding: 4px;&amp;quot; | Command&lt;br /&gt;
! style=&amp;quot;width: 75%; padding: 4px;&amp;quot; | Description&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-asn1parse.html asn1parse]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Parse an ASN.1 sequence.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ca.html ca]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Authority (CA) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html ciphers]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Cipher Suite Description Determination.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-cmp.html cmp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Management Protocol (CMP, RFC 4210) application.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-cms.html cms]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  CMS (Cryptographic Message Syntax) utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-crl.html crl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Revocation List (CRL) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-crl2pkcs7.html crl2pkcs7]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  CRL to PKCS#7 Conversion.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dgst.html dgst]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Message Digest calculation. MAC calculations are superseded by mac(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dhparam.html dhparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation and Management of Diffie-Hellman Parameters. Superseded by genpkey(1) and pkeyparam(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dsa.html dsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  DSA Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dsaparam.html dsaparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  DSA Parameter Generation and Management. Superseded by genpkey(1) and pkeyparam(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ec.html ec]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  EC (Elliptic curve) key processing.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ecparam.html ecparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  EC parameter manipulation and generation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-enc.html enc]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Symmetric cipher routines.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-engine.html engine]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Engine (loadable module) information and manipulation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-errstr.html errstr]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Error Number to Error String Conversion.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-fipsinstall.html fipsinstall]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  IPS configuration installation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-gendsa.html gendsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of DSA Private Key from Parameters. Superseded by genpkey(1) and pkey(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html genpkey]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of Private Key or Parameters.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-genrsa.html genrsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of RSA Private Key. Superseded by genpkey(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-help.html help]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Display information about a command's options.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-info.html info]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Display diverse information built into the OpenSSL libraries.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-kdf.html kdf]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Key Derivation Functions.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-list.html list]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  List algorithms and features.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-mac.html mac]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Message Authentication Code Calculation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-nseq.html nseq]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Create or examine a Netscape certificate sequence.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ocsp.html ocsp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Online Certificate Status Protocol utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-passwd.html passwd]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of hashed passwords.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs12.html pkcs12]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#12 Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs7.html pkcs7]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#7 Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs8.html pkcs8]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#8 format private key conversion tool.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkey.html pkey]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public and private key management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkeyparam.html pkeyparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public key algorithm parameter management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkeyutl.html pkeyutl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public key algorithm cryptographic operation utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-prime.html prime]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Compute prime numbers.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rand.html rand]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generate pseudo-random bytes -- see [[Random Numbers]]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rehash.html rehash]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Create symbolic links to certificate and CRL files named by the hash values.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-req.html req]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#10 X.509 Certificate Signing Request (CSR) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rsa.html rsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  RSA key management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rsautl.html rsautl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  RSA utility for signing, verification, encryption, and decryption. Superseded by pkeyutl(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_client.html s_client]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  This implements a generic SSL/TLS client which can establish a transparent connection to a remote server speaking SSL/TLS.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_server.html s_server]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  This implements a generic SSL/TLS server which accepts connections from remote clients speaking SSL/TLS. &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_time.html s_time]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SSL Connection Timer.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-sess_id.html sess_id]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SSL Session Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-smime.html smime]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  S/MIME mail processing.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-openssl-speed.html speed]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Algorithm Speed Measurement.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-spkac.html spkac]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SPKAC printing and generating utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-srp.html srp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Maintain SRP password file.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-storeutl.html storeutl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Utility to list and display certificates, keys, CRLs, etc.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ts.html ts]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Time Stamping Authority tool (client/server).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-verify.html verify]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  X.509 Certificate Verification.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-version.html version]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  OpenSSL Version Information.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-x509.html x509]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  X.509 Certificate Data Management.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Generating an RSA Private Key==&lt;br /&gt;
&lt;br /&gt;
Generating a private key can be done in a variety of different ways depending on the type of key, algorithm, bits, and other options your specific use case may require. In this example, we are generating a private key using RSA and a key size of 2048 bits.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem&lt;br /&gt;
&lt;br /&gt;
To generate a password protected private key, the previous command may be slightly amended as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem&lt;br /&gt;
&lt;br /&gt;
The addition of the &amp;lt;tt&amp;gt;-aes256&amp;lt;/tt&amp;gt; option specifies the cipher to use to encrypt the private key file. For a list of available ciphers in the library, you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -cipher-algorithms&lt;br /&gt;
&lt;br /&gt;
With your private key in hand, you can use the following command to see the key's details, such as its modulus and its constituent primes. Remember to change the name of the input file to the file name of your private key.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -text&lt;br /&gt;
&lt;br /&gt;
The above command yields the following output in my specific case. Your output will differ but should be structurally similar.&lt;br /&gt;
&lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDZD6IMLRFk4CaF&lt;br /&gt;
 w0rhRienwuE5EZ6xFE8e3C5TVi1+d9Enhi38RgkwD7UlWxPE6AWhp5T3kfrFWdak&lt;br /&gt;
 1lZFVPp7/btOKLjKUru15nLoA4AKYtz9W9PhsM0dyzLc6FQ6K4ReQam5pHCqI2zF&lt;br /&gt;
 82MwE+eIAduvuqyoQLKiI608EArWZqDtMUpBJzv0UVEYvRdnMWpCwfzpI+hPJywV&lt;br /&gt;
 CcTlNCT/ctGgBKyIx+dDuZ7bR9MNmSW7GreJEbTH+R13xT3dd/JCka1+LYCl4h0q&lt;br /&gt;
 oWhFPhOkvQzmmSzUmZlAlTDQLv2eAdJIrQcsnKZ3SsIOCC/3IpqwSzpid38Ill4O&lt;br /&gt;
 xH6XIrVFAgMBAAECggEBAJ2MC0JrM8TULSHJrf/0u7O4b2DMuTIuW386sSUr17mD&lt;br /&gt;
 nfviGF6TNvf7bq++e4rgHbZHvIg1HJ9Bpdne+J86HtUARYNlazru8fAFZEGiyLzB&lt;br /&gt;
 JUV/8TpO6ZJGepR8zSWrkFgZsOddw6i6LalADy5GRDcjoiDajZdR3lZxLrv5qOQU&lt;br /&gt;
 I1vKTf4Zs2Tl3gnaJ/Il1gBHIQ9W9xUH8jPBIwj51iXwCh8H0BiDPvFkU7cHIFCP&lt;br /&gt;
 sJhGsGp6OS3uSwwQuSE+NqbuPfVilysCcwgZduknyio0QO1YfMBL6+XoKE/bFHsn&lt;br /&gt;
 N+FzzczQg9sWyiwVR+3EeI9kp4JSElNh2nqG96i4QAECgYEA76OLUGrShHb4saoP&lt;br /&gt;
 aYnBAKLEdWj5K483JdY6BSbdd5RkDbJG8ExmcbfTas/BGdKc4iVCkxV3ysxKnX18&lt;br /&gt;
 PfxATHDLL8NMa+gGgZY5oTKUsrXEpS132HhCJ9T9LoesQjRb4kOZH8POVqm6O4Xf&lt;br /&gt;
 lCt0y1+M1eQHI1NPO9CmPBgouEUCgYEA5+F4SS8RMyYRkU/kx195fwh0hhaOElzr&lt;br /&gt;
 E8mZou3NFL/XT6/9t+2+7sMTuiQCP9zIa6s+/rrXdjWtrTcDp4WlDITas0UUgZhv&lt;br /&gt;
 YVBQBF4vhHxIVwJxnT9Gwi4XM1JlFmVHofWD71P6DRe7jSWRS3CujP3AE9vmpWMx&lt;br /&gt;
 tE1D9qLiWQECgYB445LzFYBvrKjWz4iI4CJKFNJwvGz+iXfzkXehg7KzkVtMAYSB&lt;br /&gt;
 0rjXYzm3J2ktgq778nn8Qxc0agy2GEil6GvzY+9MgAQ8Z0do9gTKif6zjLjP7vkH&lt;br /&gt;
 bdtJxsuWPoEqwMkdgqZrfNbJp0O4pVddovJ/agtdF3R2YJ+W+DH0HOfl1QKBgFnM&lt;br /&gt;
 c2zEEYEhaQRBUHP1gXO0rouPCI4L9e2/0QPL2/QBJzzxBuzH4X1NhsI7V7OrqOIp&lt;br /&gt;
 e0fiy7Y3q369I2ko1HY4rQln4z0c72VcWOCYKQbBqrInfCBNdPWWK93wNr2pk0gh&lt;br /&gt;
 cGqqtteDLVrIBbCVfsOTMWN/cZ7y/zi4A23sPoQBAoGAEPzcIjOyoB97Pzd7iNim&lt;br /&gt;
 Gin8RkwXIiFGSHo8vAh74CKBNokThM50OUNm5T2eJ4huzPpowQ+ID1mB5EjEai9n&lt;br /&gt;
 JY9ll3cUpawiIIW/6uGTHyXfvZWNtqEYXrVJ6fcDaKcW4y3cplNj/SJaBW8HXsW7&lt;br /&gt;
 YGHW3zHsgy7EOAOzPwlm9oE=&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
 RSA Private-Key: (2048 bit, 2 primes)&lt;br /&gt;
 modulus:&lt;br /&gt;
     00:d9:0f:a2:0c:2d:11:64:e0:26:85:c3:4a:e1:46:&lt;br /&gt;
     27:a7:c2:e1:39:11:9e:b1:14:4f:1e:dc:2e:53:56:&lt;br /&gt;
     2d:7e:77:d1:27:86:2d:fc:46:09:30:0f:b5:25:5b:&lt;br /&gt;
     13:c4:e8:05:a1:a7:94:f7:91:fa:c5:59:d6:a4:d6:&lt;br /&gt;
     56:45:54:fa:7b:fd:bb:4e:28:b8:ca:52:bb:b5:e6:&lt;br /&gt;
     72:e8:03:80:0a:62:dc:fd:5b:d3:e1:b0:cd:1d:cb:&lt;br /&gt;
     32:dc:e8:54:3a:2b:84:5e:41:a9:b9:a4:70:aa:23:&lt;br /&gt;
     6c:c5:f3:63:30:13:e7:88:01:db:af:ba:ac:a8:40:&lt;br /&gt;
     b2:a2:23:ad:3c:10:0a:d6:66:a0:ed:31:4a:41:27:&lt;br /&gt;
     3b:f4:51:51:18:bd:17:67:31:6a:42:c1:fc:e9:23:&lt;br /&gt;
     e8:4f:27:2c:15:09:c4:e5:34:24:ff:72:d1:a0:04:&lt;br /&gt;
     ac:88:c7:e7:43:b9:9e:db:47:d3:0d:99:25:bb:1a:&lt;br /&gt;
     b7:89:11:b4:c7:f9:1d:77:c5:3d:dd:77:f2:42:91:&lt;br /&gt;
     ad:7e:2d:80:a5:e2:1d:2a:a1:68:45:3e:13:a4:bd:&lt;br /&gt;
     0c:e6:99:2c:d4:99:99:40:95:30:d0:2e:fd:9e:01:&lt;br /&gt;
     d2:48:ad:07:2c:9c:a6:77:4a:c2:0e:08:2f:f7:22:&lt;br /&gt;
     9a:b0:4b:3a:62:77:7f:08:96:5e:0e:c4:7e:97:22:&lt;br /&gt;
     b5:45&lt;br /&gt;
 publicExponent: 65537 (0x10001)&lt;br /&gt;
 privateExponent:&lt;br /&gt;
     00:9d:8c:0b:42:6b:33:c4:d4:2d:21:c9:ad:ff:f4:&lt;br /&gt;
     bb:b3:b8:6f:60:cc:b9:32:2e:5b:7f:3a:b1:25:2b:&lt;br /&gt;
     d7:b9:83:9d:fb:e2:18:5e:93:36:f7:fb:6e:af:be:&lt;br /&gt;
     7b:8a:e0:1d:b6:47:bc:88:35:1c:9f:41:a5:d9:de:&lt;br /&gt;
     f8:9f:3a:1e:d5:00:45:83:65:6b:3a:ee:f1:f0:05:&lt;br /&gt;
     64:41:a2:c8:bc:c1:25:45:7f:f1:3a:4e:e9:92:46:&lt;br /&gt;
     7a:94:7c:cd:25:ab:90:58:19:b0:e7:5d:c3:a8:ba:&lt;br /&gt;
     2d:a9:40:0f:2e:46:44:37:23:a2:20:da:8d:97:51:&lt;br /&gt;
     de:56:71:2e:bb:f9:a8:e4:14:23:5b:ca:4d:fe:19:&lt;br /&gt;
     b3:64:e5:de:09:da:27:f2:25:d6:00:47:21:0f:56:&lt;br /&gt;
     f7:15:07:f2:33:c1:23:08:f9:d6:25:f0:0a:1f:07:&lt;br /&gt;
     d0:18:83:3e:f1:64:53:b7:07:20:50:8f:b0:98:46:&lt;br /&gt;
     b0:6a:7a:39:2d:ee:4b:0c:10:b9:21:3e:36:a6:ee:&lt;br /&gt;
     3d:f5:62:97:2b:02:73:08:19:76:e9:27:ca:2a:34:&lt;br /&gt;
     40:ed:58:7c:c0:4b:eb:e5:e8:28:4f:db:14:7b:27:&lt;br /&gt;
     37:e1:73:cd:cc:d0:83:db:16:ca:2c:15:47:ed:c4:&lt;br /&gt;
     78:8f:64:a7:82:52:12:53:61:da:7a:86:f7:a8:b8:&lt;br /&gt;
     40:01&lt;br /&gt;
 prime1:&lt;br /&gt;
     00:ef:a3:8b:50:6a:d2:84:76:f8:b1:aa:0f:69:89:&lt;br /&gt;
     c1:00:a2:c4:75:68:f9:2b:8f:37:25:d6:3a:05:26:&lt;br /&gt;
     dd:77:94:64:0d:b2:46:f0:4c:66:71:b7:d3:6a:cf:&lt;br /&gt;
     c1:19:d2:9c:e2:25:42:93:15:77:ca:cc:4a:9d:7d:&lt;br /&gt;
     7c:3d:fc:40:4c:70:cb:2f:c3:4c:6b:e8:06:81:96:&lt;br /&gt;
     39:a1:32:94:b2:b5:c4:a5:2d:77:d8:78:42:27:d4:&lt;br /&gt;
     fd:2e:87:ac:42:34:5b:e2:43:99:1f:c3:ce:56:a9:&lt;br /&gt;
     ba:3b:85:df:94:2b:74:cb:5f:8c:d5:e4:07:23:53:&lt;br /&gt;
     4f:3b:d0:a6:3c:18:28:b8:45&lt;br /&gt;
 prime2:&lt;br /&gt;
     00:e7:e1:78:49:2f:11:33:26:11:91:4f:e4:c7:5f:&lt;br /&gt;
     79:7f:08:74:86:16:8e:12:5c:eb:13:c9:99:a2:ed:&lt;br /&gt;
     cd:14:bf:d7:4f:af:fd:b7:ed:be:ee:c3:13:ba:24:&lt;br /&gt;
     02:3f:dc:c8:6b:ab:3e:fe:ba:d7:76:35:ad:ad:37:&lt;br /&gt;
     03:a7:85:a5:0c:84:da:b3:45:14:81:98:6f:61:50:&lt;br /&gt;
     50:04:5e:2f:84:7c:48:57:02:71:9d:3f:46:c2:2e:&lt;br /&gt;
     17:33:52:65:16:65:47:a1:f5:83:ef:53:fa:0d:17:&lt;br /&gt;
     bb:8d:25:91:4b:70:ae:8c:fd:c0:13:db:e6:a5:63:&lt;br /&gt;
     31:b4:4d:43:f6:a2:e2:59:01&lt;br /&gt;
 exponent1:&lt;br /&gt;
     78:e3:92:f3:15:80:6f:ac:a8:d6:cf:88:88:e0:22:&lt;br /&gt;
     4a:14:d2:70:bc:6c:fe:89:77:f3:91:77:a1:83:b2:&lt;br /&gt;
     b3:91:5b:4c:01:84:81:d2:b8:d7:63:39:b7:27:69:&lt;br /&gt;
     2d:82:ae:fb:f2:79:fc:43:17:34:6a:0c:b6:18:48:&lt;br /&gt;
     a5:e8:6b:f3:63:ef:4c:80:04:3c:67:47:68:f6:04:&lt;br /&gt;
     ca:89:fe:b3:8c:b8:cf:ee:f9:07:6d:db:49:c6:cb:&lt;br /&gt;
     96:3e:81:2a:c0:c9:1d:82:a6:6b:7c:d6:c9:a7:43:&lt;br /&gt;
     b8:a5:57:5d:a2:f2:7f:6a:0b:5d:17:74:76:60:9f:&lt;br /&gt;
     96:f8:31:f4:1c:e7:e5:d5&lt;br /&gt;
 exponent2:&lt;br /&gt;
     59:cc:73:6c:c4:11:81:21:69:04:41:50:73:f5:81:&lt;br /&gt;
     73:b4:ae:8b:8f:08:8e:0b:f5:ed:bf:d1:03:cb:db:&lt;br /&gt;
     f4:01:27:3c:f1:06:ec:c7:e1:7d:4d:86:c2:3b:57:&lt;br /&gt;
     b3:ab:a8:e2:29:7b:47:e2:cb:b6:37:ab:7e:bd:23:&lt;br /&gt;
     69:28:d4:76:38:ad:09:67:e3:3d:1c:ef:65:5c:58:&lt;br /&gt;
     e0:98:29:06:c1:aa:b2:27:7c:20:4d:74:f5:96:2b:&lt;br /&gt;
     dd:f0:36:bd:a9:93:48:21:70:6a:aa:b6:d7:83:2d:&lt;br /&gt;
     5a:c8:05:b0:95:7e:c3:93:31:63:7f:71:9e:f2:ff:&lt;br /&gt;
     38:b8:03:6d:ec:3e:84:01&lt;br /&gt;
 coefficient:&lt;br /&gt;
     10:fc:dc:22:33:b2:a0:1f:7b:3f:37:7b:88:d8:a6:&lt;br /&gt;
     1a:29:fc:46:4c:17:22:21:46:48:7a:3c:bc:08:7b:&lt;br /&gt;
     e0:22:81:36:89:13:84:ce:74:39:43:66:e5:3d:9e:&lt;br /&gt;
     27:88:6e:cc:fa:68:c1:0f:88:0f:59:81:e4:48:c4:&lt;br /&gt;
     6a:2f:67:25:8f:65:97:77:14:a5:ac:22:20:85:bf:&lt;br /&gt;
     ea:e1:93:1f:25:df:bd:95:8d:b6:a1:18:5e:b5:49:&lt;br /&gt;
     e9:f7:03:68:a7:16:e3:2d:dc:a6:53:63:fd:22:5a:&lt;br /&gt;
     05:6f:07:5e:c5:bb:60:61:d6:df:31:ec:83:2e:c4:&lt;br /&gt;
     38:03:b3:3f:09:66:f6:81&lt;br /&gt;
&lt;br /&gt;
Keep in mind the above key was generated solely for pedagogical purposes; never give anyone access to your private keys.&lt;br /&gt;
&lt;br /&gt;
==Generating a Public Key==&lt;br /&gt;
&lt;br /&gt;
Having previously generated your private key, you may generate the corresponding public key using the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -out public-key.pem -pubout&lt;br /&gt;
&lt;br /&gt;
You may once again view the key details, using a slightly different command this time.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in public-key.pem -pubin -text&lt;br /&gt;
&lt;br /&gt;
The output for the public key will be shorter, as it carries much less information, and it will look something like this.&lt;br /&gt;
&lt;br /&gt;
 -----BEGIN PUBLIC KEY-----&lt;br /&gt;
 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Q+iDC0RZOAmhcNK4UYn&lt;br /&gt;
 p8LhORGesRRPHtwuU1YtfnfRJ4Yt/EYJMA+1JVsTxOgFoaeU95H6xVnWpNZWRVT6&lt;br /&gt;
 e/27Tii4ylK7teZy6AOACmLc/VvT4bDNHcsy3OhUOiuEXkGpuaRwqiNsxfNjMBPn&lt;br /&gt;
 iAHbr7qsqECyoiOtPBAK1mag7TFKQSc79FFRGL0XZzFqQsH86SPoTycsFQnE5TQk&lt;br /&gt;
 /3LRoASsiMfnQ7me20fTDZkluxq3iRG0x/kdd8U93XfyQpGtfi2ApeIdKqFoRT4T&lt;br /&gt;
 pL0M5pks1JmZQJUw0C79ngHSSK0HLJymd0rCDggv9yKasEs6Ynd/CJZeDsR+lyK1&lt;br /&gt;
 RQIDAQAB&lt;br /&gt;
 -----END PUBLIC KEY-----&lt;br /&gt;
 RSA Public-Key: (2048 bit)&lt;br /&gt;
 Modulus:&lt;br /&gt;
     00:d9:0f:a2:0c:2d:11:64:e0:26:85:c3:4a:e1:46:&lt;br /&gt;
     27:a7:c2:e1:39:11:9e:b1:14:4f:1e:dc:2e:53:56:&lt;br /&gt;
     2d:7e:77:d1:27:86:2d:fc:46:09:30:0f:b5:25:5b:&lt;br /&gt;
     13:c4:e8:05:a1:a7:94:f7:91:fa:c5:59:d6:a4:d6:&lt;br /&gt;
     56:45:54:fa:7b:fd:bb:4e:28:b8:ca:52:bb:b5:e6:&lt;br /&gt;
     72:e8:03:80:0a:62:dc:fd:5b:d3:e1:b0:cd:1d:cb:&lt;br /&gt;
     32:dc:e8:54:3a:2b:84:5e:41:a9:b9:a4:70:aa:23:&lt;br /&gt;
     6c:c5:f3:63:30:13:e7:88:01:db:af:ba:ac:a8:40:&lt;br /&gt;
     b2:a2:23:ad:3c:10:0a:d6:66:a0:ed:31:4a:41:27:&lt;br /&gt;
     3b:f4:51:51:18:bd:17:67:31:6a:42:c1:fc:e9:23:&lt;br /&gt;
     e8:4f:27:2c:15:09:c4:e5:34:24:ff:72:d1:a0:04:&lt;br /&gt;
     ac:88:c7:e7:43:b9:9e:db:47:d3:0d:99:25:bb:1a:&lt;br /&gt;
     b7:89:11:b4:c7:f9:1d:77:c5:3d:dd:77:f2:42:91:&lt;br /&gt;
     ad:7e:2d:80:a5:e2:1d:2a:a1:68:45:3e:13:a4:bd:&lt;br /&gt;
     0c:e6:99:2c:d4:99:99:40:95:30:d0:2e:fd:9e:01:&lt;br /&gt;
     d2:48:ad:07:2c:9c:a6:77:4a:c2:0e:08:2f:f7:22:&lt;br /&gt;
     9a:b0:4b:3a:62:77:7f:08:96:5e:0e:c4:7e:97:22:&lt;br /&gt;
     b5:45&lt;br /&gt;
 Exponent: 65537 (0x10001)&lt;br /&gt;
&lt;br /&gt;
For more information on generating keys, see the source code documentation, located in the &amp;lt;tt&amp;gt;doc/HOWTO/keys.txt&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Generating Keys Based on Elliptic Curves==&lt;br /&gt;
&lt;br /&gt;
There are essentially two steps to generating a key:&lt;br /&gt;
&lt;br /&gt;
# Generate the parameters for the specific curve you are using&lt;br /&gt;
# Use those parameters to generate the key&lt;br /&gt;
&lt;br /&gt;
To see the list of curves instrinsically supported by openssl, you can use the &amp;lt;tt&amp;gt;-list_curves&amp;lt;/t&amp;gt; option when calling the &amp;lt;tt&amp;gt;ecparam&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -list_curves&lt;br /&gt;
   secp112r1 : SECG/WTLS curve over a 112 bit prime field&lt;br /&gt;
   secp112r2 : SECG curve over a 112 bit prime field&lt;br /&gt;
   secp128r1 : SECG curve over a 128 bit prime field&lt;br /&gt;
   secp128r2 : SECG curve over a 128 bit prime field&lt;br /&gt;
   secp160k1 : SECG curve over a 160 bit prime field&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
For this example I will use the &amp;lt;tt&amp;gt;prime256v1&amp;lt;/tt&amp;gt; curve, which is an &amp;lt;tt&amp;gt;X9.62/SECG&amp;lt;/tt&amp;gt; curve over a 256 bit prime field.&lt;br /&gt;
&lt;br /&gt;
===Generating the Curve Parameters===&lt;br /&gt;
&lt;br /&gt;
Having selected our curve, we now call &amp;lt;tt&amp;gt;ecparam&amp;lt;/tt&amp;gt; to generate our parameters file.&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -name prime256v1 -out prime256v1.pem&lt;br /&gt;
&lt;br /&gt;
====Printing Parameters to Standard Out====&lt;br /&gt;
&lt;br /&gt;
You can print the generated curve parameters to the terminal output with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -in prime256v1.pem -noout -text&lt;br /&gt;
 ASN1 OID: prime256v1&lt;br /&gt;
 NIST CURVE: P-256&lt;br /&gt;
&lt;br /&gt;
====Printing Parameters as C Code====&lt;br /&gt;
&lt;br /&gt;
Analogously, you may also output the generated curve parameters as C code. The parameters can then be loaded by calling the &amp;lt;tt&amp;gt;get_ec_group_XXX()&amp;lt;/tt&amp;gt; function. To print the C code to the current terminal's output, the following command may be used:&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -in prime256v1.pem -noout -C&lt;br /&gt;
&lt;br /&gt;
And here are the first few lines of the corresponding output:&lt;br /&gt;
&lt;br /&gt;
 EC_GROUP *get_ec_group_256(void)&lt;br /&gt;
 {&lt;br /&gt;
     static unsigned char ec_p_256[] = {&lt;br /&gt;
         0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,&lt;br /&gt;
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
         0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
===Generating the Key===&lt;br /&gt;
&lt;br /&gt;
With the curve parameters in hand, we are now free to generate the key. Just as with the [#Generating an RSA Private Key|RSA] example above, we may optionally specify a cipher algorithm with which to encrypt the private key. The call to generate the key using the elliptic curve parameters generated in the example above looks like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -paramfile prime256v1.pem -out private-key.pem&lt;br /&gt;
 Enter PEM pass phrase:&lt;br /&gt;
 Verifying - Enter PEM pass phrase:&lt;br /&gt;
&lt;br /&gt;
===Putting it All Together===&lt;br /&gt;
&lt;br /&gt;
The process of generation a curve based on elliptic-curves can be streamlined by calling the &amp;lt;tt&amp;gt;genpkey&amp;lt;/tt&amp;gt; command directly and specifying both the algorithm and the name of the curve to use for parameter generation. In it's simplest form, the command to generate a key based on the same curve as in the example above looks like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256&lt;br /&gt;
&lt;br /&gt;
This command will result in the generated key being printed to the terminal's output.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256&lt;br /&gt;
 &lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgqqYoJGowXJ5/GTkB&lt;br /&gt;
 SRLnBMNWLoQ2RM/QxrY+bfDDGRahRANCAASPY4eTANkwIIAWhh32eoFl2YFLJSWy&lt;br /&gt;
 bdITdZ82O5JDpDijmGmJ2hepe5afek9WVqxMPYjmbTwMPO3xMGbqUiJD&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
&lt;br /&gt;
Remember that you can specify a cipher algorithm to encrypt the key with, which something you may or may not want to do, depending on your specific use case. Here is a slightly more complete example showing a key generated with a password and written to a specific output file.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out private-key.pem&lt;br /&gt;
 Enter PEM pass phrase:&lt;br /&gt;
 Verifying - Enter PEM pass phrase:&lt;br /&gt;
&lt;br /&gt;
Just as with the previous example, you can use the &amp;lt;tt&amp;gt;pkey&amp;lt;/tt&amp;gt; command to inspect your newly-generated key.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -text&lt;br /&gt;
 Enter pass phrase for private-key.pem:&lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgEO7CxgTwi0hsjdbp&lt;br /&gt;
 sXWuU2x2flLthxqXabYDOqOZCvuhRANCAAQVTLkeCBJdvMnqwZKYJxrPvTTuanrD&lt;br /&gt;
 NkyAPQCARKsQ7bVrP6ky/5uAcAvjuZB0xKCcSp7roXLWRzD/y/ik8P5R&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
 Private-Key: (256 bit)&lt;br /&gt;
 priv:&lt;br /&gt;
     10:ee:c2:c6:04:f0:8b:48:6c:8d:d6:e9:b1:75:ae:&lt;br /&gt;
     53:6c:76:7e:52:ed:87:1a:97:69:b6:03:3a:a3:99:&lt;br /&gt;
     0a:fb&lt;br /&gt;
 pub:&lt;br /&gt;
     04:15:4c:b9:1e:08:12:5d:bc:c9:ea:c1:92:98:27:&lt;br /&gt;
     1a:cf:bd:34:ee:6a:7a:c3:36:4c:80:3d:00:80:44:&lt;br /&gt;
     ab:10:ed:b5:6b:3f:a9:32:ff:9b:80:70:0b:e3:b9:&lt;br /&gt;
     90:74:c4:a0:9c:4a:9e:eb:a1:72:d6:47:30:ff:cb:&lt;br /&gt;
     f8:a4:f0:fe:51&lt;br /&gt;
 ASN1 OID: prime256v1&lt;br /&gt;
 NIST CURVE: P-256&lt;br /&gt;
&lt;br /&gt;
For more details on elliptic curve cryptography or key generation, check out the [https://www.openssl.org/docs/manpages.html manpages].&lt;br /&gt;
&lt;br /&gt;
==Base64 Encoding Strings==&lt;br /&gt;
&lt;br /&gt;
For simple string encoding, you can use &amp;quot;here string&amp;quot; syntax with the [[Base64 Encoding|base64]] command as below. Intuitively, the &amp;lt;tt&amp;gt;-e&amp;lt;/tt&amp;gt; flag specifies the action to be encoding.&lt;br /&gt;
&lt;br /&gt;
 $ openssl base64 -e &amp;lt;&amp;lt;&amp;lt; 'Welcome to openssl wiki'&lt;br /&gt;
 V2VsY29tZSB0byBvcGVuc3NsIHdpa2kK&lt;br /&gt;
&lt;br /&gt;
Similarly, the base64 command's &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; flag may be used to indicate decoding mode.&lt;br /&gt;
&lt;br /&gt;
 $ openssl base64 -d &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kK'&lt;br /&gt;
 Welcome to openssl wiki&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Note:''''' base64 line length is limited to 76 characters by default in openssl (and generated with 64 characters per line).&lt;br /&gt;
&lt;br /&gt;
 openssl base64 -e &amp;lt;&amp;lt;&amp;lt; 'Welcome to openssl wiki with a very long line that splits...'&lt;br /&gt;
 V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRo&lt;br /&gt;
 YXQgc3BsaXRzLi4uCg==&lt;br /&gt;
 openssl base64 -d &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRoYXQgc3BsaXRzLi4uCg=='&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; NOTHING!&lt;br /&gt;
&lt;br /&gt;
To be able to decode a base64 line without line feeds that exceeds the default 76 character length restriction use the &amp;lt;code&amp;gt;-A&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
 openssl base64 -d -A &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRoYXQgc3BsaXRzLi4uCg=='&lt;br /&gt;
 Welcome to openssl wiki with a very long line that splits...&lt;br /&gt;
&lt;br /&gt;
It is recommended to actually split base64 strings into multiple lines of 64 characters, however, since the &amp;lt;code&amp;gt;-A&amp;lt;/code&amp;gt; option is buggy, particularly with its handling of long files.&lt;br /&gt;
&lt;br /&gt;
==Generating a File Hash==&lt;br /&gt;
&lt;br /&gt;
One of the most basic uses of the [[dgst]] command (short for digest) is viewing the hash of a given file. To do this, simply invoke the command with the specified digest algorithm to use. For this example, I will be hashing an arbitrary file on my system using the [[MD5]], [[SHA1]], and [[SHA384]] algorithms.&lt;br /&gt;
&lt;br /&gt;
 $ openssl dgst -md5 primes.dat&lt;br /&gt;
 MD5(primes.dat)= 7710839bb87d2c4c15a86c2b2c805664&lt;br /&gt;
 &lt;br /&gt;
 $ openssl dgst -sha1 primes.dat&lt;br /&gt;
 SHA1(primes.dat)= 5dfab70ce825591689f4a3f65910870a9022cd32&lt;br /&gt;
 &lt;br /&gt;
 $ openssl dgst -sha384 primes.dat&lt;br /&gt;
 SHA384(primes.dat)= 41399bdffe6850f5a44852d967f3db415654f20dc2eb6cd231772f6ea411876d85d44091ebbc6b1f4ce8673e64617271&lt;br /&gt;
&lt;br /&gt;
For a list of the available digest algorithms, you can use the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -digest-algorithms&lt;br /&gt;
 RSA-MD4 =&amp;gt; MD4&lt;br /&gt;
 RSA-MD5 =&amp;gt; MD5&lt;br /&gt;
 RSA-MDC2 =&amp;gt; MDC2&lt;br /&gt;
 RSA-RIPEMD160 =&amp;gt; RIPEMD160&lt;br /&gt;
 RSA-SHA1 =&amp;gt; SHA1&lt;br /&gt;
 RSA-SHA1-2 =&amp;gt; RSA-SHA1&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
You can also use a similar command to see the available [[Digest Commands|digest commands]]:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -digest-commands&lt;br /&gt;
 blake2b512        blake2s256        md5               sha1              &lt;br /&gt;
 sha224            sha256            sha3-224          sha3-256          &lt;br /&gt;
 sha3-384          sha3-512          sha384            sha512            &lt;br /&gt;
 sha512-224        sha512-256        shake128          shake256          &lt;br /&gt;
 sm3  &lt;br /&gt;
&lt;br /&gt;
Below are three sample invocations of the [[md5]], [[sha1]], and [[sha384]] digest commands using the same file as the [[dgst]] command invocation above.&lt;br /&gt;
&lt;br /&gt;
 $ openssl md5 primes.dat&lt;br /&gt;
 MD5(primes.dat)= 7710839bb87d2c4c15a86c2b2c805664&lt;br /&gt;
 &lt;br /&gt;
 $ openssl sha1 primes.dat&lt;br /&gt;
 SHA1(primes.dat)= 5dfab70ce825591689f4a3f65910870a9022cd32&lt;br /&gt;
 &lt;br /&gt;
 $ openssl sha384 primes.dat&lt;br /&gt;
 SHA384(primes.dat)= 41399bdffe6850f5a44852d967f3db415654f20dc2eb6cd231772f6ea411876d85d44091ebbc6b1f4ce8673e64617271&lt;br /&gt;
&lt;br /&gt;
==File Encryption and Decryption==&lt;br /&gt;
&lt;br /&gt;
The following example demonstrates a simple file encryption and decryption using the [[enc]] command. The first argument is the cipher algorithm to use for encrypting the file. For this example I carefully selected the [[AES-256]] algorithm in [[CBC Mode]] by looking up the available ciphers and picking out the first one I saw. To see the list of available ciphers, you can use the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -ciphers&lt;br /&gt;
 Supported ciphers:&lt;br /&gt;
 -aes-128-cbc               -aes-128-cfb               -aes-128-cfb1             &lt;br /&gt;
 -aes-128-cfb8              -aes-128-ctr               -aes-128-ecb              &lt;br /&gt;
 -aes-128-ofb               -aes-192-cbc               -aes-192-cfb              &lt;br /&gt;
 -aes-192-cfb1              -aes-192-cfb8              -aes-192-ctr&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
You can also use the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -cipher-algorithms&lt;br /&gt;
 AES-128-CBC&lt;br /&gt;
 AES-128-CBC-HMAC-SHA1&lt;br /&gt;
 AES-128-CBC-HMAC-SHA256&lt;br /&gt;
 id-aes128-CCM&lt;br /&gt;
 AES-128-CFB&lt;br /&gt;
 AES-128-CFB1&lt;br /&gt;
 AES-128-CFB8&lt;br /&gt;
 AES-128-CTR&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Having selected an encryption algorithm, you must then specify whether the action you are taking is either encryption or decryption via the &amp;lt;tt&amp;gt;-e&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; flags, respectively. The &amp;lt;tt&amp;gt;-iter&amp;lt;/tt&amp;gt; flag specifies the number of iterations on the password used for deriving the encryption key. A higher iteration count increases the time required to brute-force the resulting file. Using this option implies enabling use of the [[Password-Based Key Derivation Function 2]], usually set using the &amp;lt;tt&amp;gt;-pbkdf2&amp;lt;/tt&amp;gt; flag. We then use the &amp;lt;tt&amp;gt;-salt&amp;lt;/tt&amp;gt; flag to enable the use of a randomly generated salt in the key-derivation function.&lt;br /&gt;
&lt;br /&gt;
Putting it all together, you can see the command to encrypt a file and the corresponding output below. Note that the passwords entered by the user are blank, just as they would usually be in a terminal session.&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -aes-256-cbc -e -iter 1000 -salt -in primes.dat -out primes.enc&lt;br /&gt;
 enter aes-256-cbc encryption password:&lt;br /&gt;
 Verifying - enter aes-256-cbc encryption password:&lt;br /&gt;
&lt;br /&gt;
The analogous decryption command is as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -aes-256-cbc -d -iter 1000 -in primes.enc -out primes.dec&lt;br /&gt;
 enter aes-256-cbc decryption password:&lt;br /&gt;
&lt;br /&gt;
= Further reading =&lt;br /&gt;
&lt;br /&gt;
* Paul Heinlein. [https://www.madboa.com/geek/openssl/ &amp;quot;OpenSSL Command-Line HOWTO&amp;quot;]. Has many quick cookbook-style recipes for doing common tasks using the &amp;quot;openssl&amp;quot; command-line application.&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
[[Category:Shell level]]&lt;/div&gt;</summary>
		<author><name>DDvO</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Talk:Standard_commands&amp;diff=3215</id>
		<title>Talk:Standard commands</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Talk:Standard_commands&amp;diff=3215"/>
		<updated>2022-06-24T11:49:22Z</updated>

		<summary type="html">&lt;p&gt;DDvO: I suggest removing this page (or keeping it just for backward compatibility.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I suggest removing this page (or keeping it just for backward compatibility.&lt;br /&gt;
Its contents is much better covered by [[Command Line Utilities]].&lt;/div&gt;</summary>
		<author><name>DDvO</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Standard_commands&amp;diff=3214</id>
		<title>Standard commands</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Standard_commands&amp;diff=3214"/>
		<updated>2022-06-24T11:47:44Z</updated>

		<summary type="html">&lt;p&gt;DDvO: Replace the outdated list of standard commands by a reference to Command Line Utilities#Standard Commands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL [[standard commands]] can be listed via&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openssl list-standard-commands&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In later versions of OpenSSL [[standard commands]] can be listed via&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openssl list -commands&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Besides there are also [[cipher commands]] and [[message-digest commands]]. You can use these like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openssl command [options]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Options heavily depend on the command. Please consult the dedicated pages or use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openssl command -help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a commented list of standard commands see [[Command Line Utilities#Standard Commands]].&lt;/div&gt;</summary>
		<author><name>DDvO</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Command_Line_Utilities&amp;diff=3213</id>
		<title>Command Line Utilities</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Command_Line_Utilities&amp;diff=3213"/>
		<updated>2022-06-24T11:43:14Z</updated>

		<summary type="html">&lt;p&gt;DDvO: Minor improvements regarding the list of standard commands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''openssl''' program provides a rich variety of commands, each of which often has a wealth of options and arguments. Many commands use an external configuration file for some or all of their arguments and have a &amp;lt;code&amp;gt;-config&amp;lt;/code&amp;gt; option to specify that file. The environment variable [[OPENSSL_CONF]] can be used to specify the location of the configuration file. If the environment variable is not specified, a default file is created in the default certificate storage area called '''openssl.cnf'''. The settings in this default configuration file depend on the flags set when the version of OpenSSL being used was built.&lt;br /&gt;
&lt;br /&gt;
This article is an overview of the available tools provided by OpenSSL. For all of the details on usage and implementation, you can find the [https://www.openssl.org/docs/manmaster/man1/ manpages], which are automatically generated from the source code at the [https://www.openssl.org/ official OpenSSL project home]. Likewise, the source code itself may be found on the [https://www.openssl.org/source/ OpenSSL project home page], as well as on the [https://github.com/openssl/openssl OpenSSL Github]. The main OpenSSL site also includes an [https://www.openssl.org/docs/manmaster/man1/openssl.html overview of the command-line utilities], as well as links to all of their respective documentation.&lt;br /&gt;
&lt;br /&gt;
=Getting Started=&lt;br /&gt;
&lt;br /&gt;
The entry point for the OpenSSL library is the '''openssl''' binary, usually &amp;lt;tt&amp;gt;/usr/bin/openssl&amp;lt;/tt&amp;gt; on Linux. The general syntax for calling '''openssl''' is as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl command [ command_options ] [ command_arguments ]&lt;br /&gt;
&lt;br /&gt;
Before OpenSSL 3.0, you could call '''openssl''' without arguments to enter the interactive mode prompt and then enter commands directly, exiting with either a &amp;lt;code&amp;gt;quit&amp;lt;/code&amp;gt; command or by issuing a termination signal with either &amp;lt;tt&amp;gt;Ctrl+C&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Ctrl+D&amp;lt;/tt&amp;gt;. The following is a sample interactive session in which the user invokes the [[prime]] command twice before using the &amp;lt;tt&amp;gt;quit&amp;lt;/tt&amp;gt; command to terminate the session.&lt;br /&gt;
&lt;br /&gt;
 OpenSSL&amp;gt; prime -generate -bits 24&lt;br /&gt;
 13467269&lt;br /&gt;
 OpenSSL&amp;gt; prime -generate -bits 24&lt;br /&gt;
 16651079&lt;br /&gt;
 OpenSSL&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
=Basic Tasks=&lt;br /&gt;
&lt;br /&gt;
This section is a brief tutorial on performing the most basic tasks using OpenSSL. For a detailed explanation of the rationale behind the syntax and semantics of the commands shown here, see the section on [[#Commands|Commands]].&lt;br /&gt;
&lt;br /&gt;
==Getting Help==&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, the general syntax of a command is &amp;lt;code&amp;gt;openssl command [ command_options ] [ command_arguments ]&amp;lt;/code&amp;gt;. The '''help''' command is no different, but it does have its idiosyncrasies. To view the top-level help menu, you can call '''openssl''' as follows.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help&lt;br /&gt;
&lt;br /&gt;
Since OpenSSL 3.0, there are equivalent invocations such as:&lt;br /&gt;
&lt;br /&gt;
 $ openssl --help&lt;br /&gt;
 $ openssl -h&lt;br /&gt;
&lt;br /&gt;
This query will print all of the available commands, like so:&lt;br /&gt;
&lt;br /&gt;
 Standard commands&lt;br /&gt;
 asn1parse         ca                ciphers           cmp               &lt;br /&gt;
 cms               crl               crl2pkcs7         dgst              &lt;br /&gt;
 dhparam           dsa               dsaparam          ec &lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Note the above output was truncated, so only the first four lines of output are shown.&lt;br /&gt;
&lt;br /&gt;
The same output is obtained also with&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -standard-commands&lt;br /&gt;
&lt;br /&gt;
A help menu for each command may be requested in two different ways. First, the same command used above may be repeated, followed by the name of the command to print help for.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help genpkey&lt;br /&gt;
&lt;br /&gt;
The program will then display the valid options for the given command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help genpkey&lt;br /&gt;
 General options:&lt;br /&gt;
  -help               Display this summary&lt;br /&gt;
  -engine val         Use engine, possibly a hardware device&lt;br /&gt;
  -paramfile infile   Parameters file&lt;br /&gt;
  -algorithm val      The public key algorithm&lt;br /&gt;
  -quiet              Do not output status while generating keys&lt;br /&gt;
  -pkeyopt val        Set the public key algorithm option as opt:value&lt;br /&gt;
  -config infile      Load a configuration file (this may load modules)&lt;br /&gt;
 Output options:&lt;br /&gt;
  -out outfile        Output file&lt;br /&gt;
  -outform PEM|DER    output format (DER or PEM)&lt;br /&gt;
  -pass val           Output file pass phrase source&lt;br /&gt;
  -genparam           Generate parameters, not key&lt;br /&gt;
  -text               Print the in text&lt;br /&gt;
  -*                  Cipher to use to encrypt the key&lt;br /&gt;
 Provider options:&lt;br /&gt;
  -provider-path val  Provider load path (must be before 'provider' argument if required)&lt;br /&gt;
  -provider val       Provider to load (can be specified multiple times)&lt;br /&gt;
  -propquery val      Property query used when fetching algorithms&lt;br /&gt;
 Order of options may be important!  See the documentation.&lt;br /&gt;
&lt;br /&gt;
The second way of requesting the help menu for a particular command is by using the first option in the output shown above, namely &amp;lt;code&amp;gt;openssl command -help&amp;lt;/code&amp;gt;. Both commands will yield the same output; the help menu displayed will be exactly the same.&lt;br /&gt;
&lt;br /&gt;
For additional information on the usage of a particular command, the project [https://www.openssl.org/docs/manmaster/man1/ manpages] are the definite source of information.&lt;br /&gt;
The manpages may be views in a shell as usual, e.g.&lt;br /&gt;
&lt;br /&gt;
 $ man openssl&lt;br /&gt;
 $ man openssl-genpkey&lt;br /&gt;
 $ man genpkey&lt;br /&gt;
&lt;br /&gt;
Another way of accessing the manpages is via the project perldocs. [https://perldoc.perl.org/perldoc perldoc] is a utility included with most if not all [https://www.perl.org/ Perl] distributions, and it's capable of displaying documentation information in a variety of formats, one of which is as manpages. Not surprisingly, the project documentation is generated from the '''pod''' files located in the &amp;lt;tt&amp;gt;doc&amp;lt;/tt&amp;gt; directory of the source code.&lt;br /&gt;
&lt;br /&gt;
==Getting Library Version Information==&lt;br /&gt;
&lt;br /&gt;
 $ openssl version&lt;br /&gt;
 OpenSSL 3.0.4 21 Jun 2022 (Library: OpenSSL 3.0.4 21 Jun 2022)&lt;br /&gt;
&lt;br /&gt;
As mentioned above, the &amp;lt;tt&amp;gt;version&amp;lt;/tt&amp;gt; command's help menu may be queried for additional options like so:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -help&lt;br /&gt;
 Usage: version [options]&lt;br /&gt;
 General options:&lt;br /&gt;
  -help  Display this summary&lt;br /&gt;
 Output options:&lt;br /&gt;
  -a     Show all data&lt;br /&gt;
  -b     Show build date&lt;br /&gt;
  -d     Show configuration directory&lt;br /&gt;
  -e     Show engines directory&lt;br /&gt;
  -m     Show modules directory&lt;br /&gt;
  -f     Show compiler flags used&lt;br /&gt;
  -o     Show some internal datatype options&lt;br /&gt;
  -p     Show target build platform&lt;br /&gt;
  -r     Show random seeding options&lt;br /&gt;
  -v     Show library version&lt;br /&gt;
  -c     Show CPU settings info&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;tt&amp;gt;-a&amp;lt;/tt&amp;gt; option to show all version information yields the following output on my current machine:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -a&lt;br /&gt;
 OpenSSL 3.0.4 21 Jun 2022 (Library: OpenSSL 3.0.4 21 Jun 2022)&lt;br /&gt;
 built on: Fri Jun 24 08:58:53 2022 UTC&lt;br /&gt;
 platform: linux-x86_64&lt;br /&gt;
 options:  bn(64,64)&lt;br /&gt;
 compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
 ENGINESDIR: &amp;quot;/usr/local/lib64/engines-3&amp;quot;&lt;br /&gt;
 MODULESDIR: &amp;quot;/usr/local/lib64/ossl-modules&amp;quot;&lt;br /&gt;
 Seeding source: os-specific&lt;br /&gt;
 CPUINFO: OPENSSL_ia32cap=0x7ffaf3ffffebffff:0x29c67af&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Generating an RSA Private Key==&lt;br /&gt;
&lt;br /&gt;
Generating a private key can be done in a variety of different ways depending on the type of key, algorithm, bits, and other options your specific use case may require. In this example, we are generating a private key using RSA and a key size of 2048 bits.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem&lt;br /&gt;
&lt;br /&gt;
To generate a password protected private key, the previous command may be slightly amended as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem&lt;br /&gt;
&lt;br /&gt;
The addition of the &amp;lt;tt&amp;gt;-aes256&amp;lt;/tt&amp;gt; option specifies the cipher to use to encrypt the private key file. For a list of available ciphers in the library, you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -cipher-algorithms&lt;br /&gt;
&lt;br /&gt;
With your private key in hand, you can use the following command to see the key's details, such as its modulus and its constituent primes. Remember to change the name of the input file to the file name of your private key.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -text&lt;br /&gt;
&lt;br /&gt;
The above command yields the following output in my specific case. Your output will differ but should be structurally similar.&lt;br /&gt;
&lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDZD6IMLRFk4CaF&lt;br /&gt;
 w0rhRienwuE5EZ6xFE8e3C5TVi1+d9Enhi38RgkwD7UlWxPE6AWhp5T3kfrFWdak&lt;br /&gt;
 1lZFVPp7/btOKLjKUru15nLoA4AKYtz9W9PhsM0dyzLc6FQ6K4ReQam5pHCqI2zF&lt;br /&gt;
 82MwE+eIAduvuqyoQLKiI608EArWZqDtMUpBJzv0UVEYvRdnMWpCwfzpI+hPJywV&lt;br /&gt;
 CcTlNCT/ctGgBKyIx+dDuZ7bR9MNmSW7GreJEbTH+R13xT3dd/JCka1+LYCl4h0q&lt;br /&gt;
 oWhFPhOkvQzmmSzUmZlAlTDQLv2eAdJIrQcsnKZ3SsIOCC/3IpqwSzpid38Ill4O&lt;br /&gt;
 xH6XIrVFAgMBAAECggEBAJ2MC0JrM8TULSHJrf/0u7O4b2DMuTIuW386sSUr17mD&lt;br /&gt;
 nfviGF6TNvf7bq++e4rgHbZHvIg1HJ9Bpdne+J86HtUARYNlazru8fAFZEGiyLzB&lt;br /&gt;
 JUV/8TpO6ZJGepR8zSWrkFgZsOddw6i6LalADy5GRDcjoiDajZdR3lZxLrv5qOQU&lt;br /&gt;
 I1vKTf4Zs2Tl3gnaJ/Il1gBHIQ9W9xUH8jPBIwj51iXwCh8H0BiDPvFkU7cHIFCP&lt;br /&gt;
 sJhGsGp6OS3uSwwQuSE+NqbuPfVilysCcwgZduknyio0QO1YfMBL6+XoKE/bFHsn&lt;br /&gt;
 N+FzzczQg9sWyiwVR+3EeI9kp4JSElNh2nqG96i4QAECgYEA76OLUGrShHb4saoP&lt;br /&gt;
 aYnBAKLEdWj5K483JdY6BSbdd5RkDbJG8ExmcbfTas/BGdKc4iVCkxV3ysxKnX18&lt;br /&gt;
 PfxATHDLL8NMa+gGgZY5oTKUsrXEpS132HhCJ9T9LoesQjRb4kOZH8POVqm6O4Xf&lt;br /&gt;
 lCt0y1+M1eQHI1NPO9CmPBgouEUCgYEA5+F4SS8RMyYRkU/kx195fwh0hhaOElzr&lt;br /&gt;
 E8mZou3NFL/XT6/9t+2+7sMTuiQCP9zIa6s+/rrXdjWtrTcDp4WlDITas0UUgZhv&lt;br /&gt;
 YVBQBF4vhHxIVwJxnT9Gwi4XM1JlFmVHofWD71P6DRe7jSWRS3CujP3AE9vmpWMx&lt;br /&gt;
 tE1D9qLiWQECgYB445LzFYBvrKjWz4iI4CJKFNJwvGz+iXfzkXehg7KzkVtMAYSB&lt;br /&gt;
 0rjXYzm3J2ktgq778nn8Qxc0agy2GEil6GvzY+9MgAQ8Z0do9gTKif6zjLjP7vkH&lt;br /&gt;
 bdtJxsuWPoEqwMkdgqZrfNbJp0O4pVddovJ/agtdF3R2YJ+W+DH0HOfl1QKBgFnM&lt;br /&gt;
 c2zEEYEhaQRBUHP1gXO0rouPCI4L9e2/0QPL2/QBJzzxBuzH4X1NhsI7V7OrqOIp&lt;br /&gt;
 e0fiy7Y3q369I2ko1HY4rQln4z0c72VcWOCYKQbBqrInfCBNdPWWK93wNr2pk0gh&lt;br /&gt;
 cGqqtteDLVrIBbCVfsOTMWN/cZ7y/zi4A23sPoQBAoGAEPzcIjOyoB97Pzd7iNim&lt;br /&gt;
 Gin8RkwXIiFGSHo8vAh74CKBNokThM50OUNm5T2eJ4huzPpowQ+ID1mB5EjEai9n&lt;br /&gt;
 JY9ll3cUpawiIIW/6uGTHyXfvZWNtqEYXrVJ6fcDaKcW4y3cplNj/SJaBW8HXsW7&lt;br /&gt;
 YGHW3zHsgy7EOAOzPwlm9oE=&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
 RSA Private-Key: (2048 bit, 2 primes)&lt;br /&gt;
 modulus:&lt;br /&gt;
     00:d9:0f:a2:0c:2d:11:64:e0:26:85:c3:4a:e1:46:&lt;br /&gt;
     27:a7:c2:e1:39:11:9e:b1:14:4f:1e:dc:2e:53:56:&lt;br /&gt;
     2d:7e:77:d1:27:86:2d:fc:46:09:30:0f:b5:25:5b:&lt;br /&gt;
     13:c4:e8:05:a1:a7:94:f7:91:fa:c5:59:d6:a4:d6:&lt;br /&gt;
     56:45:54:fa:7b:fd:bb:4e:28:b8:ca:52:bb:b5:e6:&lt;br /&gt;
     72:e8:03:80:0a:62:dc:fd:5b:d3:e1:b0:cd:1d:cb:&lt;br /&gt;
     32:dc:e8:54:3a:2b:84:5e:41:a9:b9:a4:70:aa:23:&lt;br /&gt;
     6c:c5:f3:63:30:13:e7:88:01:db:af:ba:ac:a8:40:&lt;br /&gt;
     b2:a2:23:ad:3c:10:0a:d6:66:a0:ed:31:4a:41:27:&lt;br /&gt;
     3b:f4:51:51:18:bd:17:67:31:6a:42:c1:fc:e9:23:&lt;br /&gt;
     e8:4f:27:2c:15:09:c4:e5:34:24:ff:72:d1:a0:04:&lt;br /&gt;
     ac:88:c7:e7:43:b9:9e:db:47:d3:0d:99:25:bb:1a:&lt;br /&gt;
     b7:89:11:b4:c7:f9:1d:77:c5:3d:dd:77:f2:42:91:&lt;br /&gt;
     ad:7e:2d:80:a5:e2:1d:2a:a1:68:45:3e:13:a4:bd:&lt;br /&gt;
     0c:e6:99:2c:d4:99:99:40:95:30:d0:2e:fd:9e:01:&lt;br /&gt;
     d2:48:ad:07:2c:9c:a6:77:4a:c2:0e:08:2f:f7:22:&lt;br /&gt;
     9a:b0:4b:3a:62:77:7f:08:96:5e:0e:c4:7e:97:22:&lt;br /&gt;
     b5:45&lt;br /&gt;
 publicExponent: 65537 (0x10001)&lt;br /&gt;
 privateExponent:&lt;br /&gt;
     00:9d:8c:0b:42:6b:33:c4:d4:2d:21:c9:ad:ff:f4:&lt;br /&gt;
     bb:b3:b8:6f:60:cc:b9:32:2e:5b:7f:3a:b1:25:2b:&lt;br /&gt;
     d7:b9:83:9d:fb:e2:18:5e:93:36:f7:fb:6e:af:be:&lt;br /&gt;
     7b:8a:e0:1d:b6:47:bc:88:35:1c:9f:41:a5:d9:de:&lt;br /&gt;
     f8:9f:3a:1e:d5:00:45:83:65:6b:3a:ee:f1:f0:05:&lt;br /&gt;
     64:41:a2:c8:bc:c1:25:45:7f:f1:3a:4e:e9:92:46:&lt;br /&gt;
     7a:94:7c:cd:25:ab:90:58:19:b0:e7:5d:c3:a8:ba:&lt;br /&gt;
     2d:a9:40:0f:2e:46:44:37:23:a2:20:da:8d:97:51:&lt;br /&gt;
     de:56:71:2e:bb:f9:a8:e4:14:23:5b:ca:4d:fe:19:&lt;br /&gt;
     b3:64:e5:de:09:da:27:f2:25:d6:00:47:21:0f:56:&lt;br /&gt;
     f7:15:07:f2:33:c1:23:08:f9:d6:25:f0:0a:1f:07:&lt;br /&gt;
     d0:18:83:3e:f1:64:53:b7:07:20:50:8f:b0:98:46:&lt;br /&gt;
     b0:6a:7a:39:2d:ee:4b:0c:10:b9:21:3e:36:a6:ee:&lt;br /&gt;
     3d:f5:62:97:2b:02:73:08:19:76:e9:27:ca:2a:34:&lt;br /&gt;
     40:ed:58:7c:c0:4b:eb:e5:e8:28:4f:db:14:7b:27:&lt;br /&gt;
     37:e1:73:cd:cc:d0:83:db:16:ca:2c:15:47:ed:c4:&lt;br /&gt;
     78:8f:64:a7:82:52:12:53:61:da:7a:86:f7:a8:b8:&lt;br /&gt;
     40:01&lt;br /&gt;
 prime1:&lt;br /&gt;
     00:ef:a3:8b:50:6a:d2:84:76:f8:b1:aa:0f:69:89:&lt;br /&gt;
     c1:00:a2:c4:75:68:f9:2b:8f:37:25:d6:3a:05:26:&lt;br /&gt;
     dd:77:94:64:0d:b2:46:f0:4c:66:71:b7:d3:6a:cf:&lt;br /&gt;
     c1:19:d2:9c:e2:25:42:93:15:77:ca:cc:4a:9d:7d:&lt;br /&gt;
     7c:3d:fc:40:4c:70:cb:2f:c3:4c:6b:e8:06:81:96:&lt;br /&gt;
     39:a1:32:94:b2:b5:c4:a5:2d:77:d8:78:42:27:d4:&lt;br /&gt;
     fd:2e:87:ac:42:34:5b:e2:43:99:1f:c3:ce:56:a9:&lt;br /&gt;
     ba:3b:85:df:94:2b:74:cb:5f:8c:d5:e4:07:23:53:&lt;br /&gt;
     4f:3b:d0:a6:3c:18:28:b8:45&lt;br /&gt;
 prime2:&lt;br /&gt;
     00:e7:e1:78:49:2f:11:33:26:11:91:4f:e4:c7:5f:&lt;br /&gt;
     79:7f:08:74:86:16:8e:12:5c:eb:13:c9:99:a2:ed:&lt;br /&gt;
     cd:14:bf:d7:4f:af:fd:b7:ed:be:ee:c3:13:ba:24:&lt;br /&gt;
     02:3f:dc:c8:6b:ab:3e:fe:ba:d7:76:35:ad:ad:37:&lt;br /&gt;
     03:a7:85:a5:0c:84:da:b3:45:14:81:98:6f:61:50:&lt;br /&gt;
     50:04:5e:2f:84:7c:48:57:02:71:9d:3f:46:c2:2e:&lt;br /&gt;
     17:33:52:65:16:65:47:a1:f5:83:ef:53:fa:0d:17:&lt;br /&gt;
     bb:8d:25:91:4b:70:ae:8c:fd:c0:13:db:e6:a5:63:&lt;br /&gt;
     31:b4:4d:43:f6:a2:e2:59:01&lt;br /&gt;
 exponent1:&lt;br /&gt;
     78:e3:92:f3:15:80:6f:ac:a8:d6:cf:88:88:e0:22:&lt;br /&gt;
     4a:14:d2:70:bc:6c:fe:89:77:f3:91:77:a1:83:b2:&lt;br /&gt;
     b3:91:5b:4c:01:84:81:d2:b8:d7:63:39:b7:27:69:&lt;br /&gt;
     2d:82:ae:fb:f2:79:fc:43:17:34:6a:0c:b6:18:48:&lt;br /&gt;
     a5:e8:6b:f3:63:ef:4c:80:04:3c:67:47:68:f6:04:&lt;br /&gt;
     ca:89:fe:b3:8c:b8:cf:ee:f9:07:6d:db:49:c6:cb:&lt;br /&gt;
     96:3e:81:2a:c0:c9:1d:82:a6:6b:7c:d6:c9:a7:43:&lt;br /&gt;
     b8:a5:57:5d:a2:f2:7f:6a:0b:5d:17:74:76:60:9f:&lt;br /&gt;
     96:f8:31:f4:1c:e7:e5:d5&lt;br /&gt;
 exponent2:&lt;br /&gt;
     59:cc:73:6c:c4:11:81:21:69:04:41:50:73:f5:81:&lt;br /&gt;
     73:b4:ae:8b:8f:08:8e:0b:f5:ed:bf:d1:03:cb:db:&lt;br /&gt;
     f4:01:27:3c:f1:06:ec:c7:e1:7d:4d:86:c2:3b:57:&lt;br /&gt;
     b3:ab:a8:e2:29:7b:47:e2:cb:b6:37:ab:7e:bd:23:&lt;br /&gt;
     69:28:d4:76:38:ad:09:67:e3:3d:1c:ef:65:5c:58:&lt;br /&gt;
     e0:98:29:06:c1:aa:b2:27:7c:20:4d:74:f5:96:2b:&lt;br /&gt;
     dd:f0:36:bd:a9:93:48:21:70:6a:aa:b6:d7:83:2d:&lt;br /&gt;
     5a:c8:05:b0:95:7e:c3:93:31:63:7f:71:9e:f2:ff:&lt;br /&gt;
     38:b8:03:6d:ec:3e:84:01&lt;br /&gt;
 coefficient:&lt;br /&gt;
     10:fc:dc:22:33:b2:a0:1f:7b:3f:37:7b:88:d8:a6:&lt;br /&gt;
     1a:29:fc:46:4c:17:22:21:46:48:7a:3c:bc:08:7b:&lt;br /&gt;
     e0:22:81:36:89:13:84:ce:74:39:43:66:e5:3d:9e:&lt;br /&gt;
     27:88:6e:cc:fa:68:c1:0f:88:0f:59:81:e4:48:c4:&lt;br /&gt;
     6a:2f:67:25:8f:65:97:77:14:a5:ac:22:20:85:bf:&lt;br /&gt;
     ea:e1:93:1f:25:df:bd:95:8d:b6:a1:18:5e:b5:49:&lt;br /&gt;
     e9:f7:03:68:a7:16:e3:2d:dc:a6:53:63:fd:22:5a:&lt;br /&gt;
     05:6f:07:5e:c5:bb:60:61:d6:df:31:ec:83:2e:c4:&lt;br /&gt;
     38:03:b3:3f:09:66:f6:81&lt;br /&gt;
&lt;br /&gt;
Keep in mind the above key was generated solely for pedagogical purposes; never give anyone access to your private keys.&lt;br /&gt;
&lt;br /&gt;
==Generating a Public Key==&lt;br /&gt;
&lt;br /&gt;
Having previously generated your private key, you may generate the corresponding public key using the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -out public-key.pem -pubout&lt;br /&gt;
&lt;br /&gt;
You may once again view the key details, using a slightly different command this time.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in public-key.pem -pubin -text&lt;br /&gt;
&lt;br /&gt;
The output for the public key will be shorter, as it carries much less information, and it will look something like this.&lt;br /&gt;
&lt;br /&gt;
 -----BEGIN PUBLIC KEY-----&lt;br /&gt;
 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Q+iDC0RZOAmhcNK4UYn&lt;br /&gt;
 p8LhORGesRRPHtwuU1YtfnfRJ4Yt/EYJMA+1JVsTxOgFoaeU95H6xVnWpNZWRVT6&lt;br /&gt;
 e/27Tii4ylK7teZy6AOACmLc/VvT4bDNHcsy3OhUOiuEXkGpuaRwqiNsxfNjMBPn&lt;br /&gt;
 iAHbr7qsqECyoiOtPBAK1mag7TFKQSc79FFRGL0XZzFqQsH86SPoTycsFQnE5TQk&lt;br /&gt;
 /3LRoASsiMfnQ7me20fTDZkluxq3iRG0x/kdd8U93XfyQpGtfi2ApeIdKqFoRT4T&lt;br /&gt;
 pL0M5pks1JmZQJUw0C79ngHSSK0HLJymd0rCDggv9yKasEs6Ynd/CJZeDsR+lyK1&lt;br /&gt;
 RQIDAQAB&lt;br /&gt;
 -----END PUBLIC KEY-----&lt;br /&gt;
 RSA Public-Key: (2048 bit)&lt;br /&gt;
 Modulus:&lt;br /&gt;
     00:d9:0f:a2:0c:2d:11:64:e0:26:85:c3:4a:e1:46:&lt;br /&gt;
     27:a7:c2:e1:39:11:9e:b1:14:4f:1e:dc:2e:53:56:&lt;br /&gt;
     2d:7e:77:d1:27:86:2d:fc:46:09:30:0f:b5:25:5b:&lt;br /&gt;
     13:c4:e8:05:a1:a7:94:f7:91:fa:c5:59:d6:a4:d6:&lt;br /&gt;
     56:45:54:fa:7b:fd:bb:4e:28:b8:ca:52:bb:b5:e6:&lt;br /&gt;
     72:e8:03:80:0a:62:dc:fd:5b:d3:e1:b0:cd:1d:cb:&lt;br /&gt;
     32:dc:e8:54:3a:2b:84:5e:41:a9:b9:a4:70:aa:23:&lt;br /&gt;
     6c:c5:f3:63:30:13:e7:88:01:db:af:ba:ac:a8:40:&lt;br /&gt;
     b2:a2:23:ad:3c:10:0a:d6:66:a0:ed:31:4a:41:27:&lt;br /&gt;
     3b:f4:51:51:18:bd:17:67:31:6a:42:c1:fc:e9:23:&lt;br /&gt;
     e8:4f:27:2c:15:09:c4:e5:34:24:ff:72:d1:a0:04:&lt;br /&gt;
     ac:88:c7:e7:43:b9:9e:db:47:d3:0d:99:25:bb:1a:&lt;br /&gt;
     b7:89:11:b4:c7:f9:1d:77:c5:3d:dd:77:f2:42:91:&lt;br /&gt;
     ad:7e:2d:80:a5:e2:1d:2a:a1:68:45:3e:13:a4:bd:&lt;br /&gt;
     0c:e6:99:2c:d4:99:99:40:95:30:d0:2e:fd:9e:01:&lt;br /&gt;
     d2:48:ad:07:2c:9c:a6:77:4a:c2:0e:08:2f:f7:22:&lt;br /&gt;
     9a:b0:4b:3a:62:77:7f:08:96:5e:0e:c4:7e:97:22:&lt;br /&gt;
     b5:45&lt;br /&gt;
 Exponent: 65537 (0x10001)&lt;br /&gt;
&lt;br /&gt;
For more information on generating keys, see the source code documentation, located in the &amp;lt;tt&amp;gt;doc/HOWTO/keys.txt&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Generating Keys Based on Elliptic Curves==&lt;br /&gt;
&lt;br /&gt;
There are essentially two steps to generating a key:&lt;br /&gt;
&lt;br /&gt;
# Generate the parameters for the specific curve you are using&lt;br /&gt;
# Use those parameters to generate the key&lt;br /&gt;
&lt;br /&gt;
To see the list of curves instrinsically supported by openssl, you can use the &amp;lt;tt&amp;gt;-list_curves&amp;lt;/t&amp;gt; option when calling the &amp;lt;tt&amp;gt;ecparam&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -list_curves&lt;br /&gt;
   secp112r1 : SECG/WTLS curve over a 112 bit prime field&lt;br /&gt;
   secp112r2 : SECG curve over a 112 bit prime field&lt;br /&gt;
   secp128r1 : SECG curve over a 128 bit prime field&lt;br /&gt;
   secp128r2 : SECG curve over a 128 bit prime field&lt;br /&gt;
   secp160k1 : SECG curve over a 160 bit prime field&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
For this example I will use the &amp;lt;tt&amp;gt;prime256v1&amp;lt;/tt&amp;gt; curve, which is an &amp;lt;tt&amp;gt;X9.62/SECG&amp;lt;/tt&amp;gt; curve over a 256 bit prime field.&lt;br /&gt;
&lt;br /&gt;
===Generating the Curve Parameters===&lt;br /&gt;
&lt;br /&gt;
Having selected our curve, we now call &amp;lt;tt&amp;gt;ecparam&amp;lt;/tt&amp;gt; to generate our parameters file.&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -name prime256v1 -out prime256v1.pem&lt;br /&gt;
&lt;br /&gt;
====Printing Parameters to Standard Out====&lt;br /&gt;
&lt;br /&gt;
You can print the generated curve parameters to the terminal output with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -in prime256v1.pem -noout -text&lt;br /&gt;
 ASN1 OID: prime256v1&lt;br /&gt;
 NIST CURVE: P-256&lt;br /&gt;
&lt;br /&gt;
====Printing Parameters as C Code====&lt;br /&gt;
&lt;br /&gt;
Analogously, you may also output the generated curve parameters as C code. The parameters can then be loaded by calling the &amp;lt;tt&amp;gt;get_ec_group_XXX()&amp;lt;/tt&amp;gt; function. To print the C code to the current terminal's output, the following command may be used:&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -in prime256v1.pem -noout -C&lt;br /&gt;
&lt;br /&gt;
And here are the first few lines of the corresponding output:&lt;br /&gt;
&lt;br /&gt;
 EC_GROUP *get_ec_group_256(void)&lt;br /&gt;
 {&lt;br /&gt;
     static unsigned char ec_p_256[] = {&lt;br /&gt;
         0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,&lt;br /&gt;
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
         0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
===Generating the Key===&lt;br /&gt;
&lt;br /&gt;
With the curve parameters in hand, we are now free to generate the key. Just as with the [#Generating an RSA Private Key|RSA] example above, we may optionally specify a cipher algorithm with which to encrypt the private key. The call to generate the key using the elliptic curve parameters generated in the example above looks like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -paramfile prime256v1.pem -out private-key.pem&lt;br /&gt;
 Enter PEM pass phrase:&lt;br /&gt;
 Verifying - Enter PEM pass phrase:&lt;br /&gt;
&lt;br /&gt;
===Putting it All Together===&lt;br /&gt;
&lt;br /&gt;
The process of generation a curve based on elliptic-curves can be streamlined by calling the &amp;lt;tt&amp;gt;genpkey&amp;lt;/tt&amp;gt; command directly and specifying both the algorithm and the name of the curve to use for parameter generation. In it's simplest form, the command to generate a key based on the same curve as in the example above looks like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256&lt;br /&gt;
&lt;br /&gt;
This command will result in the generated key being printed to the terminal's output.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256&lt;br /&gt;
 &lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgqqYoJGowXJ5/GTkB&lt;br /&gt;
 SRLnBMNWLoQ2RM/QxrY+bfDDGRahRANCAASPY4eTANkwIIAWhh32eoFl2YFLJSWy&lt;br /&gt;
 bdITdZ82O5JDpDijmGmJ2hepe5afek9WVqxMPYjmbTwMPO3xMGbqUiJD&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
&lt;br /&gt;
Remember that you can specify a cipher algorithm to encrypt the key with, which something you may or may not want to do, depending on your specific use case. Here is a slightly more complete example showing a key generated with a password and written to a specific output file.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out private-key.pem&lt;br /&gt;
 Enter PEM pass phrase:&lt;br /&gt;
 Verifying - Enter PEM pass phrase:&lt;br /&gt;
&lt;br /&gt;
Just as with the previous example, you can use the &amp;lt;tt&amp;gt;pkey&amp;lt;/tt&amp;gt; command to inspect your newly-generated key.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -text&lt;br /&gt;
 Enter pass phrase for private-key.pem:&lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgEO7CxgTwi0hsjdbp&lt;br /&gt;
 sXWuU2x2flLthxqXabYDOqOZCvuhRANCAAQVTLkeCBJdvMnqwZKYJxrPvTTuanrD&lt;br /&gt;
 NkyAPQCARKsQ7bVrP6ky/5uAcAvjuZB0xKCcSp7roXLWRzD/y/ik8P5R&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
 Private-Key: (256 bit)&lt;br /&gt;
 priv:&lt;br /&gt;
     10:ee:c2:c6:04:f0:8b:48:6c:8d:d6:e9:b1:75:ae:&lt;br /&gt;
     53:6c:76:7e:52:ed:87:1a:97:69:b6:03:3a:a3:99:&lt;br /&gt;
     0a:fb&lt;br /&gt;
 pub:&lt;br /&gt;
     04:15:4c:b9:1e:08:12:5d:bc:c9:ea:c1:92:98:27:&lt;br /&gt;
     1a:cf:bd:34:ee:6a:7a:c3:36:4c:80:3d:00:80:44:&lt;br /&gt;
     ab:10:ed:b5:6b:3f:a9:32:ff:9b:80:70:0b:e3:b9:&lt;br /&gt;
     90:74:c4:a0:9c:4a:9e:eb:a1:72:d6:47:30:ff:cb:&lt;br /&gt;
     f8:a4:f0:fe:51&lt;br /&gt;
 ASN1 OID: prime256v1&lt;br /&gt;
 NIST CURVE: P-256&lt;br /&gt;
&lt;br /&gt;
For more details on elliptic curve cryptography or key generation, check out the [https://www.openssl.org/docs/manpages.html manpages].&lt;br /&gt;
&lt;br /&gt;
==Base64 Encoding Strings==&lt;br /&gt;
&lt;br /&gt;
For simple string encoding, you can use &amp;quot;here string&amp;quot; syntax with the [[Base64 Encoding|base64]] command as below. Intuitively, the &amp;lt;tt&amp;gt;-e&amp;lt;/tt&amp;gt; flag specifies the action to be encoding.&lt;br /&gt;
&lt;br /&gt;
 $ openssl base64 -e &amp;lt;&amp;lt;&amp;lt; 'Welcome to openssl wiki'&lt;br /&gt;
 V2VsY29tZSB0byBvcGVuc3NsIHdpa2kK&lt;br /&gt;
&lt;br /&gt;
Similarly, the base64 command's &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; flag may be used to indicate decoding mode.&lt;br /&gt;
&lt;br /&gt;
 $ openssl base64 -d &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kK'&lt;br /&gt;
 Welcome to openssl wiki&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Note:''''' base64 line length is limited to 76 characters by default in openssl (and generated with 64 characters per line).&lt;br /&gt;
&lt;br /&gt;
 openssl base64 -e &amp;lt;&amp;lt;&amp;lt; 'Welcome to openssl wiki with a very long line that splits...'&lt;br /&gt;
 V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRo&lt;br /&gt;
 YXQgc3BsaXRzLi4uCg==&lt;br /&gt;
 openssl base64 -d &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRoYXQgc3BsaXRzLi4uCg=='&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; NOTHING!&lt;br /&gt;
&lt;br /&gt;
To be able to decode a base64 line without line feeds that exceeds the default 76 character length restriction use the &amp;lt;code&amp;gt;-A&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
 openssl base64 -d -A &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRoYXQgc3BsaXRzLi4uCg=='&lt;br /&gt;
 Welcome to openssl wiki with a very long line that splits...&lt;br /&gt;
&lt;br /&gt;
It is recommended to actually split base64 strings into multiple lines of 64 characters, however, since the &amp;lt;code&amp;gt;-A&amp;lt;/code&amp;gt; option is buggy, particularly with its handling of long files.&lt;br /&gt;
&lt;br /&gt;
==Generating a File Hash==&lt;br /&gt;
&lt;br /&gt;
One of the most basic uses of the [[dgst]] command (short for digest) is viewing the hash of a given file. To do this, simply invoke the command with the specified digest algorithm to use. For this example, I will be hashing an arbitrary file on my system using the [[MD5]], [[SHA1]], and [[SHA384]] algorithms.&lt;br /&gt;
&lt;br /&gt;
 $ openssl dgst -md5 primes.dat&lt;br /&gt;
 MD5(primes.dat)= 7710839bb87d2c4c15a86c2b2c805664&lt;br /&gt;
 &lt;br /&gt;
 $ openssl dgst -sha1 primes.dat&lt;br /&gt;
 SHA1(primes.dat)= 5dfab70ce825591689f4a3f65910870a9022cd32&lt;br /&gt;
 &lt;br /&gt;
 $ openssl dgst -sha384 primes.dat&lt;br /&gt;
 SHA384(primes.dat)= 41399bdffe6850f5a44852d967f3db415654f20dc2eb6cd231772f6ea411876d85d44091ebbc6b1f4ce8673e64617271&lt;br /&gt;
&lt;br /&gt;
For a list of the available digest algorithms, you can use the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -digest-algorithms&lt;br /&gt;
 RSA-MD4 =&amp;gt; MD4&lt;br /&gt;
 RSA-MD5 =&amp;gt; MD5&lt;br /&gt;
 RSA-MDC2 =&amp;gt; MDC2&lt;br /&gt;
 RSA-RIPEMD160 =&amp;gt; RIPEMD160&lt;br /&gt;
 RSA-SHA1 =&amp;gt; SHA1&lt;br /&gt;
 RSA-SHA1-2 =&amp;gt; RSA-SHA1&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
You can also use a similar command to see the available [[Digest Commands|digest commands]]:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -digest-commands&lt;br /&gt;
 blake2b512        blake2s256        md5               sha1              &lt;br /&gt;
 sha224            sha256            sha3-224          sha3-256          &lt;br /&gt;
 sha3-384          sha3-512          sha384            sha512            &lt;br /&gt;
 sha512-224        sha512-256        shake128          shake256          &lt;br /&gt;
 sm3  &lt;br /&gt;
&lt;br /&gt;
Below are three sample invocations of the [[md5]], [[sha1]], and [[sha384]] digest commands using the same file as the [[dgst]] command invocation above.&lt;br /&gt;
&lt;br /&gt;
 $ openssl md5 primes.dat&lt;br /&gt;
 MD5(primes.dat)= 7710839bb87d2c4c15a86c2b2c805664&lt;br /&gt;
 &lt;br /&gt;
 $ openssl sha1 primes.dat&lt;br /&gt;
 SHA1(primes.dat)= 5dfab70ce825591689f4a3f65910870a9022cd32&lt;br /&gt;
 &lt;br /&gt;
 $ openssl sha384 primes.dat&lt;br /&gt;
 SHA384(primes.dat)= 41399bdffe6850f5a44852d967f3db415654f20dc2eb6cd231772f6ea411876d85d44091ebbc6b1f4ce8673e64617271&lt;br /&gt;
&lt;br /&gt;
==File Encryption and Decryption==&lt;br /&gt;
&lt;br /&gt;
The following example demonstrates a simple file encryption and decryption using the [[enc]] command. The first argument is the cipher algorithm to use for encrypting the file. For this example I carefully selected the [[AES-256]] algorithm in [[CBC Mode]] by looking up the available ciphers and picking out the first one I saw. To see the list of available ciphers, you can use the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -ciphers&lt;br /&gt;
 Supported ciphers:&lt;br /&gt;
 -aes-128-cbc               -aes-128-cfb               -aes-128-cfb1             &lt;br /&gt;
 -aes-128-cfb8              -aes-128-ctr               -aes-128-ecb              &lt;br /&gt;
 -aes-128-ofb               -aes-192-cbc               -aes-192-cfb              &lt;br /&gt;
 -aes-192-cfb1              -aes-192-cfb8              -aes-192-ctr&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
You can also use the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -cipher-algorithms&lt;br /&gt;
 AES-128-CBC&lt;br /&gt;
 AES-128-CBC-HMAC-SHA1&lt;br /&gt;
 AES-128-CBC-HMAC-SHA256&lt;br /&gt;
 id-aes128-CCM&lt;br /&gt;
 AES-128-CFB&lt;br /&gt;
 AES-128-CFB1&lt;br /&gt;
 AES-128-CFB8&lt;br /&gt;
 AES-128-CTR&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Having selected an encryption algorithm, you must then specify whether the action you are taking is either encryption or decryption via the &amp;lt;tt&amp;gt;-e&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; flags, respectively. The &amp;lt;tt&amp;gt;-iter&amp;lt;/tt&amp;gt; flag specifies the number of iterations on the password used for deriving the encryption key. A higher iteration count increases the time required to brute-force the resulting file. Using this option implies enabling use of the [[Password-Based Key Derivation Function 2]], usually set using the &amp;lt;tt&amp;gt;-pbkdf2&amp;lt;/tt&amp;gt; flag. We then use the &amp;lt;tt&amp;gt;-salt&amp;lt;/tt&amp;gt; flag to enable the use of a randomly generated salt in the key-derivation function.&lt;br /&gt;
&lt;br /&gt;
Putting it all together, you can see the command to encrypt a file and the corresponding output below. Note that the passwords entered by the user are blank, just as they would usually be in a terminal session.&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -aes-256-cbc -e -iter 1000 -salt -in primes.dat -out primes.enc&lt;br /&gt;
 enter aes-256-cbc encryption password:&lt;br /&gt;
 Verifying - enter aes-256-cbc encryption password:&lt;br /&gt;
&lt;br /&gt;
The analogous decryption command is as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -aes-256-cbc -d -iter 1000 -in primes.enc -out primes.dec&lt;br /&gt;
 enter aes-256-cbc decryption password:&lt;br /&gt;
&lt;br /&gt;
=Commands=&lt;br /&gt;
&lt;br /&gt;
There are three different kinds of commands. These are [[Standard commands|standard commands]], [[Cipher commands|cipher commands]], and [[Digest comands|digest commands]]. Calling the OpenSSL top-level &amp;lt;tt&amp;gt;help&amp;lt;/tt&amp;gt; command with no arguments will result in openssl printing all available commands by group, sorted alphabetically.&lt;br /&gt;
&lt;br /&gt;
==Standard Commands==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto; text-align: center; width: 65%;&amp;quot;&lt;br /&gt;
|+ Overview of OpenSSL's command line utilities&lt;br /&gt;
! style=&amp;quot;width: 25%; padding: 4px;&amp;quot; | Command&lt;br /&gt;
! style=&amp;quot;width: 75%; padding: 4px;&amp;quot; | Description&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-asn1parse.html asn1parse]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Parse an ASN.1 sequence.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ca.html ca]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Authority (CA) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html ciphers]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Cipher Suite Description Determination.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-cmp.html cmp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Management Protocol (CMP, RFC 4210) application.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-cms.html cms]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  CMS (Cryptographic Message Syntax) utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-crl.html crl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Revocation List (CRL) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-crl2pkcs7.html crl2pkcs7]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  CRL to PKCS#7 Conversion.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dgst.html dgst]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Message Digest calculation. MAC calculations are superseded by mac(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dhparam.html dhparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation and Management of Diffie-Hellman Parameters. Superseded by genpkey(1) and pkeyparam(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dsa.html dsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  DSA Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dsaparam.html dsaparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  DSA Parameter Generation and Management. Superseded by genpkey(1) and pkeyparam(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ec.html ec]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  EC (Elliptic curve) key processing.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ecparam.html ecparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  EC parameter manipulation and generation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-enc.html enc]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Symmetric cipher routines.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-engine.html engine]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Engine (loadable module) information and manipulation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-errstr.html errstr]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Error Number to Error String Conversion.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-fipsinstall.html fipsinstall]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  IPS configuration installation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-gendsa.html gendsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of DSA Private Key from Parameters. Superseded by genpkey(1) and pkey(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html genpkey]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of Private Key or Parameters.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-genrsa.html genrsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of RSA Private Key. Superseded by genpkey(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-help.html help]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Display information about a command's options.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-info.html info]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Display diverse information built into the OpenSSL libraries.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-kdf.html kdf]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Key Derivation Functions.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-list.html list]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  List algorithms and features.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-mac.html mac]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Message Authentication Code Calculation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-nseq.html nseq]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Create or examine a Netscape certificate sequence.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ocsp.html ocsp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Online Certificate Status Protocol utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-passwd.html passwd]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of hashed passwords.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs12.html pkcs12]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#12 Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs7.html pkcs7]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#7 Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs8.html pkcs8]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#8 format private key conversion tool.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkey.html pkey]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public and private key management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkeyparam.html pkeyparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public key algorithm parameter management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkeyutl.html pkeyutl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public key algorithm cryptographic operation utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-prime.html prime]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Compute prime numbers.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rand.html rand]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generate pseudo-random bytes -- see [[Random Numbers]]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rehash.html rehash]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Create symbolic links to certificate and CRL files named by the hash values.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-req.html req]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#10 X.509 Certificate Signing Request (CSR) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rsa.html rsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  RSA key management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rsautl.html rsautl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  RSA utility for signing, verification, encryption, and decryption. Superseded by pkeyutl(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_client.html s_client]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  This implements a generic SSL/TLS client which can establish a transparent connection to a remote server speaking SSL/TLS.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_server.html s_server]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  This implements a generic SSL/TLS server which accepts connections from remote clients speaking SSL/TLS. &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_time.html s_time]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SSL Connection Timer.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-sess_id.html sess_id]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SSL Session Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-smime.html smime]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  S/MIME mail processing.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-openssl-speed.html speed]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Algorithm Speed Measurement.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-spkac.html spkac]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SPKAC printing and generating utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-srp.html srp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Maintain SRP password file.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-storeutl.html storeutl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Utility to list and display certificates, keys, CRLs, etc.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ts.html ts]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Time Stamping Authority tool (client/server).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-verify.html verify]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  X.509 Certificate Verification.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-version.html version]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  OpenSSL Version Information.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-x509.html x509]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  X.509 Certificate Data Management.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Further reading =&lt;br /&gt;
&lt;br /&gt;
* Paul Heinlein. [https://www.madboa.com/geek/openssl/ &amp;quot;OpenSSL Command-Line HOWTO&amp;quot;]. Has many quick cookbook-style recipes for doing common tasks using the &amp;quot;openssl&amp;quot; command-line application.&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
[[Category:Shell level]]&lt;/div&gt;</summary>
		<author><name>DDvO</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Command_Line_Utilities&amp;diff=3212</id>
		<title>Command Line Utilities</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Command_Line_Utilities&amp;diff=3212"/>
		<updated>2022-06-24T09:43:43Z</updated>

		<summary type="html">&lt;p&gt;DDvO: Update the more general sections to OpenSSL 3.0.4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''openssl''' program provides a rich variety of commands, each of which often has a wealth of options and arguments. Many commands use an external configuration file for some or all of their arguments and have a &amp;lt;code&amp;gt;-config&amp;lt;/code&amp;gt; option to specify that file. The environment variable [[OPENSSL_CONF]] can be used to specify the location of the configuration file. If the environment variable is not specified, a default file is created in the default certificate storage area called '''openssl.cnf'''. The settings in this default configuration file depend on the flags set when the version of OpenSSL being used was built.&lt;br /&gt;
&lt;br /&gt;
This article is an overview of the available tools provided by OpenSSL. For all of the details on usage and implementation, you can find the [https://www.openssl.org/docs/manmaster/man1/ manpages], which are automatically generated from the source code at the [https://www.openssl.org/ official OpenSSL project home]. Likewise, the source code itself may be found on the [https://www.openssl.org/source/ OpenSSL project home page], as well as on the [https://github.com/openssl/openssl OpenSSL Github]. The main OpenSSL site also includes an [https://www.openssl.org/docs/manmaster/man1/openssl.html overview of the command-line utilities], as well as links to all of their respective documentation.&lt;br /&gt;
&lt;br /&gt;
=Getting Started=&lt;br /&gt;
&lt;br /&gt;
The entry point for the OpenSSL library is the '''openssl''' binary, usually &amp;lt;tt&amp;gt;/usr/bin/openssl&amp;lt;/tt&amp;gt; on Linux. The general syntax for calling '''openssl''' is as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl command [ command_options ] [ command_arguments ]&lt;br /&gt;
&lt;br /&gt;
Before OpenSSL 3.0, you could call '''openssl''' without arguments to enter the interactive mode prompt and then enter commands directly, exiting with either a &amp;lt;code&amp;gt;quit&amp;lt;/code&amp;gt; command or by issuing a termination signal with either &amp;lt;tt&amp;gt;Ctrl+C&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Ctrl+D&amp;lt;/tt&amp;gt;. The following is a sample interactive session in which the user invokes the [[prime]] command twice before using the &amp;lt;tt&amp;gt;quit&amp;lt;/tt&amp;gt; command to terminate the session.&lt;br /&gt;
&lt;br /&gt;
 OpenSSL&amp;gt; prime -generate -bits 24&lt;br /&gt;
 13467269&lt;br /&gt;
 OpenSSL&amp;gt; prime -generate -bits 24&lt;br /&gt;
 16651079&lt;br /&gt;
 OpenSSL&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
=Basic Tasks=&lt;br /&gt;
&lt;br /&gt;
This section is a brief tutorial on performing the most basic tasks using OpenSSL. For a detailed explanation of the rationale behind the syntax and semantics of the commands shown here, see the section on [[#Commands|Commands]].&lt;br /&gt;
&lt;br /&gt;
==Getting Help==&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, the general syntax of a command is &amp;lt;code&amp;gt;openssl command [ command_options ] [ command_arguments ]&amp;lt;/code&amp;gt;. The '''help''' command is no different, but it does have its idiosyncrasies. To view the top-level help menu, you can call '''openssl''' as follows.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help&lt;br /&gt;
&lt;br /&gt;
Since OpenSSL 3.0, there are equivalent invocations such as:&lt;br /&gt;
&lt;br /&gt;
 $ openssl --help&lt;br /&gt;
 $ openssl -h&lt;br /&gt;
&lt;br /&gt;
This query will print all of the available commands, like so:&lt;br /&gt;
&lt;br /&gt;
 Standard commands&lt;br /&gt;
 asn1parse         ca                ciphers           cmp               &lt;br /&gt;
 cms               crl               crl2pkcs7         dgst              &lt;br /&gt;
 dhparam           dsa               dsaparam          ec &lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Note the above output was truncated, so only the first four lines of output are shown.&lt;br /&gt;
&lt;br /&gt;
A help menu for each command may be requested in two different ways. First, the same command used above may be repeated, followed by the name of the command to print help for.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help genpkey&lt;br /&gt;
&lt;br /&gt;
The program will then display the valid options for the given command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl help genpkey&lt;br /&gt;
 General options:&lt;br /&gt;
  -help               Display this summary&lt;br /&gt;
  -engine val         Use engine, possibly a hardware device&lt;br /&gt;
  -paramfile infile   Parameters file&lt;br /&gt;
  -algorithm val      The public key algorithm&lt;br /&gt;
  -quiet              Do not output status while generating keys&lt;br /&gt;
  -pkeyopt val        Set the public key algorithm option as opt:value&lt;br /&gt;
  -config infile      Load a configuration file (this may load modules)&lt;br /&gt;
 Output options:&lt;br /&gt;
  -out outfile        Output file&lt;br /&gt;
  -outform PEM|DER    output format (DER or PEM)&lt;br /&gt;
  -pass val           Output file pass phrase source&lt;br /&gt;
  -genparam           Generate parameters, not key&lt;br /&gt;
  -text               Print the in text&lt;br /&gt;
  -*                  Cipher to use to encrypt the key&lt;br /&gt;
 Provider options:&lt;br /&gt;
  -provider-path val  Provider load path (must be before 'provider' argument if required)&lt;br /&gt;
  -provider val       Provider to load (can be specified multiple times)&lt;br /&gt;
  -propquery val      Property query used when fetching algorithms&lt;br /&gt;
 Order of options may be important!  See the documentation.&lt;br /&gt;
&lt;br /&gt;
The second way of requesting the help menu for a particular command is by using the first option in the output shown above, namely &amp;lt;code&amp;gt;openssl command -help&amp;lt;/code&amp;gt;. Both commands will yield the same output; the help menu displayed will be exactly the same.&lt;br /&gt;
&lt;br /&gt;
For additional information on the usage of a particular command, the project [https://www.openssl.org/docs/manmaster/man1/ manpages] are the definite source of information.&lt;br /&gt;
The manpages may be views in a shell as usual, e.g.&lt;br /&gt;
&lt;br /&gt;
 $ man openssl&lt;br /&gt;
 $ man openssl-genpkey&lt;br /&gt;
 $ man genpkey&lt;br /&gt;
&lt;br /&gt;
Another way of accessing the manpages is via the project perldocs. [https://perldoc.perl.org/perldoc perldoc] is a utility included with most if not all [https://www.perl.org/ Perl] distributions, and it's capable of displaying documentation information in a variety of formats, one of which is as manpages. Not surprisingly, the project documentation is generated from the '''pod''' files located in the &amp;lt;tt&amp;gt;doc&amp;lt;/tt&amp;gt; directory of the source code.&lt;br /&gt;
&lt;br /&gt;
==Getting Library Version Information==&lt;br /&gt;
&lt;br /&gt;
 $ openssl version&lt;br /&gt;
 OpenSSL 3.0.4 21 Jun 2022 (Library: OpenSSL 3.0.4 21 Jun 2022)&lt;br /&gt;
&lt;br /&gt;
As mentioned above, the &amp;lt;tt&amp;gt;version&amp;lt;/tt&amp;gt; command's help menu may be queried for additional options like so:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -help&lt;br /&gt;
 Usage: version [options]&lt;br /&gt;
 General options:&lt;br /&gt;
  -help  Display this summary&lt;br /&gt;
 Output options:&lt;br /&gt;
  -a     Show all data&lt;br /&gt;
  -b     Show build date&lt;br /&gt;
  -d     Show configuration directory&lt;br /&gt;
  -e     Show engines directory&lt;br /&gt;
  -m     Show modules directory&lt;br /&gt;
  -f     Show compiler flags used&lt;br /&gt;
  -o     Show some internal datatype options&lt;br /&gt;
  -p     Show target build platform&lt;br /&gt;
  -r     Show random seeding options&lt;br /&gt;
  -v     Show library version&lt;br /&gt;
  -c     Show CPU settings info&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;tt&amp;gt;-a&amp;lt;/tt&amp;gt; option to show all version information yields the following output on my current machine:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -a&lt;br /&gt;
 OpenSSL 3.0.4 21 Jun 2022 (Library: OpenSSL 3.0.4 21 Jun 2022)&lt;br /&gt;
 built on: Fri Jun 24 08:58:53 2022 UTC&lt;br /&gt;
 platform: linux-x86_64&lt;br /&gt;
 options:  bn(64,64)&lt;br /&gt;
 compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
 ENGINESDIR: &amp;quot;/usr/local/lib64/engines-3&amp;quot;&lt;br /&gt;
 MODULESDIR: &amp;quot;/usr/local/lib64/ossl-modules&amp;quot;&lt;br /&gt;
 Seeding source: os-specific&lt;br /&gt;
 CPUINFO: OPENSSL_ia32cap=0x7ffaf3ffffebffff:0x29c67af&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Generating an RSA Private Key==&lt;br /&gt;
&lt;br /&gt;
Generating a private key can be done in a variety of different ways depending on the type of key, algorithm, bits, and other options your specific use case may require. In this example, we are generating a private key using RSA and a key size of 2048 bits.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem&lt;br /&gt;
&lt;br /&gt;
To generate a password protected private key, the previous command may be slightly amended as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem&lt;br /&gt;
&lt;br /&gt;
The addition of the &amp;lt;tt&amp;gt;-aes256&amp;lt;/tt&amp;gt; option specifies the cipher to use to encrypt the private key file. For a list of available ciphers in the library, you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -cipher-algorithms&lt;br /&gt;
&lt;br /&gt;
With your private key in hand, you can use the following command to see the key's details, such as its modulus and its constituent primes. Remember to change the name of the input file to the file name of your private key.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -text&lt;br /&gt;
&lt;br /&gt;
The above command yields the following output in my specific case. Your output will differ but should be structurally similar.&lt;br /&gt;
&lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDZD6IMLRFk4CaF&lt;br /&gt;
 w0rhRienwuE5EZ6xFE8e3C5TVi1+d9Enhi38RgkwD7UlWxPE6AWhp5T3kfrFWdak&lt;br /&gt;
 1lZFVPp7/btOKLjKUru15nLoA4AKYtz9W9PhsM0dyzLc6FQ6K4ReQam5pHCqI2zF&lt;br /&gt;
 82MwE+eIAduvuqyoQLKiI608EArWZqDtMUpBJzv0UVEYvRdnMWpCwfzpI+hPJywV&lt;br /&gt;
 CcTlNCT/ctGgBKyIx+dDuZ7bR9MNmSW7GreJEbTH+R13xT3dd/JCka1+LYCl4h0q&lt;br /&gt;
 oWhFPhOkvQzmmSzUmZlAlTDQLv2eAdJIrQcsnKZ3SsIOCC/3IpqwSzpid38Ill4O&lt;br /&gt;
 xH6XIrVFAgMBAAECggEBAJ2MC0JrM8TULSHJrf/0u7O4b2DMuTIuW386sSUr17mD&lt;br /&gt;
 nfviGF6TNvf7bq++e4rgHbZHvIg1HJ9Bpdne+J86HtUARYNlazru8fAFZEGiyLzB&lt;br /&gt;
 JUV/8TpO6ZJGepR8zSWrkFgZsOddw6i6LalADy5GRDcjoiDajZdR3lZxLrv5qOQU&lt;br /&gt;
 I1vKTf4Zs2Tl3gnaJ/Il1gBHIQ9W9xUH8jPBIwj51iXwCh8H0BiDPvFkU7cHIFCP&lt;br /&gt;
 sJhGsGp6OS3uSwwQuSE+NqbuPfVilysCcwgZduknyio0QO1YfMBL6+XoKE/bFHsn&lt;br /&gt;
 N+FzzczQg9sWyiwVR+3EeI9kp4JSElNh2nqG96i4QAECgYEA76OLUGrShHb4saoP&lt;br /&gt;
 aYnBAKLEdWj5K483JdY6BSbdd5RkDbJG8ExmcbfTas/BGdKc4iVCkxV3ysxKnX18&lt;br /&gt;
 PfxATHDLL8NMa+gGgZY5oTKUsrXEpS132HhCJ9T9LoesQjRb4kOZH8POVqm6O4Xf&lt;br /&gt;
 lCt0y1+M1eQHI1NPO9CmPBgouEUCgYEA5+F4SS8RMyYRkU/kx195fwh0hhaOElzr&lt;br /&gt;
 E8mZou3NFL/XT6/9t+2+7sMTuiQCP9zIa6s+/rrXdjWtrTcDp4WlDITas0UUgZhv&lt;br /&gt;
 YVBQBF4vhHxIVwJxnT9Gwi4XM1JlFmVHofWD71P6DRe7jSWRS3CujP3AE9vmpWMx&lt;br /&gt;
 tE1D9qLiWQECgYB445LzFYBvrKjWz4iI4CJKFNJwvGz+iXfzkXehg7KzkVtMAYSB&lt;br /&gt;
 0rjXYzm3J2ktgq778nn8Qxc0agy2GEil6GvzY+9MgAQ8Z0do9gTKif6zjLjP7vkH&lt;br /&gt;
 bdtJxsuWPoEqwMkdgqZrfNbJp0O4pVddovJ/agtdF3R2YJ+W+DH0HOfl1QKBgFnM&lt;br /&gt;
 c2zEEYEhaQRBUHP1gXO0rouPCI4L9e2/0QPL2/QBJzzxBuzH4X1NhsI7V7OrqOIp&lt;br /&gt;
 e0fiy7Y3q369I2ko1HY4rQln4z0c72VcWOCYKQbBqrInfCBNdPWWK93wNr2pk0gh&lt;br /&gt;
 cGqqtteDLVrIBbCVfsOTMWN/cZ7y/zi4A23sPoQBAoGAEPzcIjOyoB97Pzd7iNim&lt;br /&gt;
 Gin8RkwXIiFGSHo8vAh74CKBNokThM50OUNm5T2eJ4huzPpowQ+ID1mB5EjEai9n&lt;br /&gt;
 JY9ll3cUpawiIIW/6uGTHyXfvZWNtqEYXrVJ6fcDaKcW4y3cplNj/SJaBW8HXsW7&lt;br /&gt;
 YGHW3zHsgy7EOAOzPwlm9oE=&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
 RSA Private-Key: (2048 bit, 2 primes)&lt;br /&gt;
 modulus:&lt;br /&gt;
     00:d9:0f:a2:0c:2d:11:64:e0:26:85:c3:4a:e1:46:&lt;br /&gt;
     27:a7:c2:e1:39:11:9e:b1:14:4f:1e:dc:2e:53:56:&lt;br /&gt;
     2d:7e:77:d1:27:86:2d:fc:46:09:30:0f:b5:25:5b:&lt;br /&gt;
     13:c4:e8:05:a1:a7:94:f7:91:fa:c5:59:d6:a4:d6:&lt;br /&gt;
     56:45:54:fa:7b:fd:bb:4e:28:b8:ca:52:bb:b5:e6:&lt;br /&gt;
     72:e8:03:80:0a:62:dc:fd:5b:d3:e1:b0:cd:1d:cb:&lt;br /&gt;
     32:dc:e8:54:3a:2b:84:5e:41:a9:b9:a4:70:aa:23:&lt;br /&gt;
     6c:c5:f3:63:30:13:e7:88:01:db:af:ba:ac:a8:40:&lt;br /&gt;
     b2:a2:23:ad:3c:10:0a:d6:66:a0:ed:31:4a:41:27:&lt;br /&gt;
     3b:f4:51:51:18:bd:17:67:31:6a:42:c1:fc:e9:23:&lt;br /&gt;
     e8:4f:27:2c:15:09:c4:e5:34:24:ff:72:d1:a0:04:&lt;br /&gt;
     ac:88:c7:e7:43:b9:9e:db:47:d3:0d:99:25:bb:1a:&lt;br /&gt;
     b7:89:11:b4:c7:f9:1d:77:c5:3d:dd:77:f2:42:91:&lt;br /&gt;
     ad:7e:2d:80:a5:e2:1d:2a:a1:68:45:3e:13:a4:bd:&lt;br /&gt;
     0c:e6:99:2c:d4:99:99:40:95:30:d0:2e:fd:9e:01:&lt;br /&gt;
     d2:48:ad:07:2c:9c:a6:77:4a:c2:0e:08:2f:f7:22:&lt;br /&gt;
     9a:b0:4b:3a:62:77:7f:08:96:5e:0e:c4:7e:97:22:&lt;br /&gt;
     b5:45&lt;br /&gt;
 publicExponent: 65537 (0x10001)&lt;br /&gt;
 privateExponent:&lt;br /&gt;
     00:9d:8c:0b:42:6b:33:c4:d4:2d:21:c9:ad:ff:f4:&lt;br /&gt;
     bb:b3:b8:6f:60:cc:b9:32:2e:5b:7f:3a:b1:25:2b:&lt;br /&gt;
     d7:b9:83:9d:fb:e2:18:5e:93:36:f7:fb:6e:af:be:&lt;br /&gt;
     7b:8a:e0:1d:b6:47:bc:88:35:1c:9f:41:a5:d9:de:&lt;br /&gt;
     f8:9f:3a:1e:d5:00:45:83:65:6b:3a:ee:f1:f0:05:&lt;br /&gt;
     64:41:a2:c8:bc:c1:25:45:7f:f1:3a:4e:e9:92:46:&lt;br /&gt;
     7a:94:7c:cd:25:ab:90:58:19:b0:e7:5d:c3:a8:ba:&lt;br /&gt;
     2d:a9:40:0f:2e:46:44:37:23:a2:20:da:8d:97:51:&lt;br /&gt;
     de:56:71:2e:bb:f9:a8:e4:14:23:5b:ca:4d:fe:19:&lt;br /&gt;
     b3:64:e5:de:09:da:27:f2:25:d6:00:47:21:0f:56:&lt;br /&gt;
     f7:15:07:f2:33:c1:23:08:f9:d6:25:f0:0a:1f:07:&lt;br /&gt;
     d0:18:83:3e:f1:64:53:b7:07:20:50:8f:b0:98:46:&lt;br /&gt;
     b0:6a:7a:39:2d:ee:4b:0c:10:b9:21:3e:36:a6:ee:&lt;br /&gt;
     3d:f5:62:97:2b:02:73:08:19:76:e9:27:ca:2a:34:&lt;br /&gt;
     40:ed:58:7c:c0:4b:eb:e5:e8:28:4f:db:14:7b:27:&lt;br /&gt;
     37:e1:73:cd:cc:d0:83:db:16:ca:2c:15:47:ed:c4:&lt;br /&gt;
     78:8f:64:a7:82:52:12:53:61:da:7a:86:f7:a8:b8:&lt;br /&gt;
     40:01&lt;br /&gt;
 prime1:&lt;br /&gt;
     00:ef:a3:8b:50:6a:d2:84:76:f8:b1:aa:0f:69:89:&lt;br /&gt;
     c1:00:a2:c4:75:68:f9:2b:8f:37:25:d6:3a:05:26:&lt;br /&gt;
     dd:77:94:64:0d:b2:46:f0:4c:66:71:b7:d3:6a:cf:&lt;br /&gt;
     c1:19:d2:9c:e2:25:42:93:15:77:ca:cc:4a:9d:7d:&lt;br /&gt;
     7c:3d:fc:40:4c:70:cb:2f:c3:4c:6b:e8:06:81:96:&lt;br /&gt;
     39:a1:32:94:b2:b5:c4:a5:2d:77:d8:78:42:27:d4:&lt;br /&gt;
     fd:2e:87:ac:42:34:5b:e2:43:99:1f:c3:ce:56:a9:&lt;br /&gt;
     ba:3b:85:df:94:2b:74:cb:5f:8c:d5:e4:07:23:53:&lt;br /&gt;
     4f:3b:d0:a6:3c:18:28:b8:45&lt;br /&gt;
 prime2:&lt;br /&gt;
     00:e7:e1:78:49:2f:11:33:26:11:91:4f:e4:c7:5f:&lt;br /&gt;
     79:7f:08:74:86:16:8e:12:5c:eb:13:c9:99:a2:ed:&lt;br /&gt;
     cd:14:bf:d7:4f:af:fd:b7:ed:be:ee:c3:13:ba:24:&lt;br /&gt;
     02:3f:dc:c8:6b:ab:3e:fe:ba:d7:76:35:ad:ad:37:&lt;br /&gt;
     03:a7:85:a5:0c:84:da:b3:45:14:81:98:6f:61:50:&lt;br /&gt;
     50:04:5e:2f:84:7c:48:57:02:71:9d:3f:46:c2:2e:&lt;br /&gt;
     17:33:52:65:16:65:47:a1:f5:83:ef:53:fa:0d:17:&lt;br /&gt;
     bb:8d:25:91:4b:70:ae:8c:fd:c0:13:db:e6:a5:63:&lt;br /&gt;
     31:b4:4d:43:f6:a2:e2:59:01&lt;br /&gt;
 exponent1:&lt;br /&gt;
     78:e3:92:f3:15:80:6f:ac:a8:d6:cf:88:88:e0:22:&lt;br /&gt;
     4a:14:d2:70:bc:6c:fe:89:77:f3:91:77:a1:83:b2:&lt;br /&gt;
     b3:91:5b:4c:01:84:81:d2:b8:d7:63:39:b7:27:69:&lt;br /&gt;
     2d:82:ae:fb:f2:79:fc:43:17:34:6a:0c:b6:18:48:&lt;br /&gt;
     a5:e8:6b:f3:63:ef:4c:80:04:3c:67:47:68:f6:04:&lt;br /&gt;
     ca:89:fe:b3:8c:b8:cf:ee:f9:07:6d:db:49:c6:cb:&lt;br /&gt;
     96:3e:81:2a:c0:c9:1d:82:a6:6b:7c:d6:c9:a7:43:&lt;br /&gt;
     b8:a5:57:5d:a2:f2:7f:6a:0b:5d:17:74:76:60:9f:&lt;br /&gt;
     96:f8:31:f4:1c:e7:e5:d5&lt;br /&gt;
 exponent2:&lt;br /&gt;
     59:cc:73:6c:c4:11:81:21:69:04:41:50:73:f5:81:&lt;br /&gt;
     73:b4:ae:8b:8f:08:8e:0b:f5:ed:bf:d1:03:cb:db:&lt;br /&gt;
     f4:01:27:3c:f1:06:ec:c7:e1:7d:4d:86:c2:3b:57:&lt;br /&gt;
     b3:ab:a8:e2:29:7b:47:e2:cb:b6:37:ab:7e:bd:23:&lt;br /&gt;
     69:28:d4:76:38:ad:09:67:e3:3d:1c:ef:65:5c:58:&lt;br /&gt;
     e0:98:29:06:c1:aa:b2:27:7c:20:4d:74:f5:96:2b:&lt;br /&gt;
     dd:f0:36:bd:a9:93:48:21:70:6a:aa:b6:d7:83:2d:&lt;br /&gt;
     5a:c8:05:b0:95:7e:c3:93:31:63:7f:71:9e:f2:ff:&lt;br /&gt;
     38:b8:03:6d:ec:3e:84:01&lt;br /&gt;
 coefficient:&lt;br /&gt;
     10:fc:dc:22:33:b2:a0:1f:7b:3f:37:7b:88:d8:a6:&lt;br /&gt;
     1a:29:fc:46:4c:17:22:21:46:48:7a:3c:bc:08:7b:&lt;br /&gt;
     e0:22:81:36:89:13:84:ce:74:39:43:66:e5:3d:9e:&lt;br /&gt;
     27:88:6e:cc:fa:68:c1:0f:88:0f:59:81:e4:48:c4:&lt;br /&gt;
     6a:2f:67:25:8f:65:97:77:14:a5:ac:22:20:85:bf:&lt;br /&gt;
     ea:e1:93:1f:25:df:bd:95:8d:b6:a1:18:5e:b5:49:&lt;br /&gt;
     e9:f7:03:68:a7:16:e3:2d:dc:a6:53:63:fd:22:5a:&lt;br /&gt;
     05:6f:07:5e:c5:bb:60:61:d6:df:31:ec:83:2e:c4:&lt;br /&gt;
     38:03:b3:3f:09:66:f6:81&lt;br /&gt;
&lt;br /&gt;
Keep in mind the above key was generated solely for pedagogical purposes; never give anyone access to your private keys.&lt;br /&gt;
&lt;br /&gt;
==Generating a Public Key==&lt;br /&gt;
&lt;br /&gt;
Having previously generated your private key, you may generate the corresponding public key using the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -out public-key.pem -pubout&lt;br /&gt;
&lt;br /&gt;
You may once again view the key details, using a slightly different command this time.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in public-key.pem -pubin -text&lt;br /&gt;
&lt;br /&gt;
The output for the public key will be shorter, as it carries much less information, and it will look something like this.&lt;br /&gt;
&lt;br /&gt;
 -----BEGIN PUBLIC KEY-----&lt;br /&gt;
 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Q+iDC0RZOAmhcNK4UYn&lt;br /&gt;
 p8LhORGesRRPHtwuU1YtfnfRJ4Yt/EYJMA+1JVsTxOgFoaeU95H6xVnWpNZWRVT6&lt;br /&gt;
 e/27Tii4ylK7teZy6AOACmLc/VvT4bDNHcsy3OhUOiuEXkGpuaRwqiNsxfNjMBPn&lt;br /&gt;
 iAHbr7qsqECyoiOtPBAK1mag7TFKQSc79FFRGL0XZzFqQsH86SPoTycsFQnE5TQk&lt;br /&gt;
 /3LRoASsiMfnQ7me20fTDZkluxq3iRG0x/kdd8U93XfyQpGtfi2ApeIdKqFoRT4T&lt;br /&gt;
 pL0M5pks1JmZQJUw0C79ngHSSK0HLJymd0rCDggv9yKasEs6Ynd/CJZeDsR+lyK1&lt;br /&gt;
 RQIDAQAB&lt;br /&gt;
 -----END PUBLIC KEY-----&lt;br /&gt;
 RSA Public-Key: (2048 bit)&lt;br /&gt;
 Modulus:&lt;br /&gt;
     00:d9:0f:a2:0c:2d:11:64:e0:26:85:c3:4a:e1:46:&lt;br /&gt;
     27:a7:c2:e1:39:11:9e:b1:14:4f:1e:dc:2e:53:56:&lt;br /&gt;
     2d:7e:77:d1:27:86:2d:fc:46:09:30:0f:b5:25:5b:&lt;br /&gt;
     13:c4:e8:05:a1:a7:94:f7:91:fa:c5:59:d6:a4:d6:&lt;br /&gt;
     56:45:54:fa:7b:fd:bb:4e:28:b8:ca:52:bb:b5:e6:&lt;br /&gt;
     72:e8:03:80:0a:62:dc:fd:5b:d3:e1:b0:cd:1d:cb:&lt;br /&gt;
     32:dc:e8:54:3a:2b:84:5e:41:a9:b9:a4:70:aa:23:&lt;br /&gt;
     6c:c5:f3:63:30:13:e7:88:01:db:af:ba:ac:a8:40:&lt;br /&gt;
     b2:a2:23:ad:3c:10:0a:d6:66:a0:ed:31:4a:41:27:&lt;br /&gt;
     3b:f4:51:51:18:bd:17:67:31:6a:42:c1:fc:e9:23:&lt;br /&gt;
     e8:4f:27:2c:15:09:c4:e5:34:24:ff:72:d1:a0:04:&lt;br /&gt;
     ac:88:c7:e7:43:b9:9e:db:47:d3:0d:99:25:bb:1a:&lt;br /&gt;
     b7:89:11:b4:c7:f9:1d:77:c5:3d:dd:77:f2:42:91:&lt;br /&gt;
     ad:7e:2d:80:a5:e2:1d:2a:a1:68:45:3e:13:a4:bd:&lt;br /&gt;
     0c:e6:99:2c:d4:99:99:40:95:30:d0:2e:fd:9e:01:&lt;br /&gt;
     d2:48:ad:07:2c:9c:a6:77:4a:c2:0e:08:2f:f7:22:&lt;br /&gt;
     9a:b0:4b:3a:62:77:7f:08:96:5e:0e:c4:7e:97:22:&lt;br /&gt;
     b5:45&lt;br /&gt;
 Exponent: 65537 (0x10001)&lt;br /&gt;
&lt;br /&gt;
For more information on generating keys, see the source code documentation, located in the &amp;lt;tt&amp;gt;doc/HOWTO/keys.txt&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Generating Keys Based on Elliptic Curves==&lt;br /&gt;
&lt;br /&gt;
There are essentially two steps to generating a key:&lt;br /&gt;
&lt;br /&gt;
# Generate the parameters for the specific curve you are using&lt;br /&gt;
# Use those parameters to generate the key&lt;br /&gt;
&lt;br /&gt;
To see the list of curves instrinsically supported by openssl, you can use the &amp;lt;tt&amp;gt;-list_curves&amp;lt;/t&amp;gt; option when calling the &amp;lt;tt&amp;gt;ecparam&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -list_curves&lt;br /&gt;
   secp112r1 : SECG/WTLS curve over a 112 bit prime field&lt;br /&gt;
   secp112r2 : SECG curve over a 112 bit prime field&lt;br /&gt;
   secp128r1 : SECG curve over a 128 bit prime field&lt;br /&gt;
   secp128r2 : SECG curve over a 128 bit prime field&lt;br /&gt;
   secp160k1 : SECG curve over a 160 bit prime field&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
For this example I will use the &amp;lt;tt&amp;gt;prime256v1&amp;lt;/tt&amp;gt; curve, which is an &amp;lt;tt&amp;gt;X9.62/SECG&amp;lt;/tt&amp;gt; curve over a 256 bit prime field.&lt;br /&gt;
&lt;br /&gt;
===Generating the Curve Parameters===&lt;br /&gt;
&lt;br /&gt;
Having selected our curve, we now call &amp;lt;tt&amp;gt;ecparam&amp;lt;/tt&amp;gt; to generate our parameters file.&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -name prime256v1 -out prime256v1.pem&lt;br /&gt;
&lt;br /&gt;
====Printing Parameters to Standard Out====&lt;br /&gt;
&lt;br /&gt;
You can print the generated curve parameters to the terminal output with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -in prime256v1.pem -noout -text&lt;br /&gt;
 ASN1 OID: prime256v1&lt;br /&gt;
 NIST CURVE: P-256&lt;br /&gt;
&lt;br /&gt;
====Printing Parameters as C Code====&lt;br /&gt;
&lt;br /&gt;
Analogously, you may also output the generated curve parameters as C code. The parameters can then be loaded by calling the &amp;lt;tt&amp;gt;get_ec_group_XXX()&amp;lt;/tt&amp;gt; function. To print the C code to the current terminal's output, the following command may be used:&lt;br /&gt;
&lt;br /&gt;
 $ openssl ecparam -in prime256v1.pem -noout -C&lt;br /&gt;
&lt;br /&gt;
And here are the first few lines of the corresponding output:&lt;br /&gt;
&lt;br /&gt;
 EC_GROUP *get_ec_group_256(void)&lt;br /&gt;
 {&lt;br /&gt;
     static unsigned char ec_p_256[] = {&lt;br /&gt;
         0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,&lt;br /&gt;
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
         0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
===Generating the Key===&lt;br /&gt;
&lt;br /&gt;
With the curve parameters in hand, we are now free to generate the key. Just as with the [#Generating an RSA Private Key|RSA] example above, we may optionally specify a cipher algorithm with which to encrypt the private key. The call to generate the key using the elliptic curve parameters generated in the example above looks like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -paramfile prime256v1.pem -out private-key.pem&lt;br /&gt;
 Enter PEM pass phrase:&lt;br /&gt;
 Verifying - Enter PEM pass phrase:&lt;br /&gt;
&lt;br /&gt;
===Putting it All Together===&lt;br /&gt;
&lt;br /&gt;
The process of generation a curve based on elliptic-curves can be streamlined by calling the &amp;lt;tt&amp;gt;genpkey&amp;lt;/tt&amp;gt; command directly and specifying both the algorithm and the name of the curve to use for parameter generation. In it's simplest form, the command to generate a key based on the same curve as in the example above looks like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256&lt;br /&gt;
&lt;br /&gt;
This command will result in the generated key being printed to the terminal's output.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256&lt;br /&gt;
 &lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgqqYoJGowXJ5/GTkB&lt;br /&gt;
 SRLnBMNWLoQ2RM/QxrY+bfDDGRahRANCAASPY4eTANkwIIAWhh32eoFl2YFLJSWy&lt;br /&gt;
 bdITdZ82O5JDpDijmGmJ2hepe5afek9WVqxMPYjmbTwMPO3xMGbqUiJD&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
&lt;br /&gt;
Remember that you can specify a cipher algorithm to encrypt the key with, which something you may or may not want to do, depending on your specific use case. Here is a slightly more complete example showing a key generated with a password and written to a specific output file.&lt;br /&gt;
&lt;br /&gt;
 $ openssl genpkey -aes256 -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out private-key.pem&lt;br /&gt;
 Enter PEM pass phrase:&lt;br /&gt;
 Verifying - Enter PEM pass phrase:&lt;br /&gt;
&lt;br /&gt;
Just as with the previous example, you can use the &amp;lt;tt&amp;gt;pkey&amp;lt;/tt&amp;gt; command to inspect your newly-generated key.&lt;br /&gt;
&lt;br /&gt;
 $ openssl pkey -in private-key.pem -text&lt;br /&gt;
 Enter pass phrase for private-key.pem:&lt;br /&gt;
 -----BEGIN PRIVATE KEY-----&lt;br /&gt;
 MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgEO7CxgTwi0hsjdbp&lt;br /&gt;
 sXWuU2x2flLthxqXabYDOqOZCvuhRANCAAQVTLkeCBJdvMnqwZKYJxrPvTTuanrD&lt;br /&gt;
 NkyAPQCARKsQ7bVrP6ky/5uAcAvjuZB0xKCcSp7roXLWRzD/y/ik8P5R&lt;br /&gt;
 -----END PRIVATE KEY-----&lt;br /&gt;
 Private-Key: (256 bit)&lt;br /&gt;
 priv:&lt;br /&gt;
     10:ee:c2:c6:04:f0:8b:48:6c:8d:d6:e9:b1:75:ae:&lt;br /&gt;
     53:6c:76:7e:52:ed:87:1a:97:69:b6:03:3a:a3:99:&lt;br /&gt;
     0a:fb&lt;br /&gt;
 pub:&lt;br /&gt;
     04:15:4c:b9:1e:08:12:5d:bc:c9:ea:c1:92:98:27:&lt;br /&gt;
     1a:cf:bd:34:ee:6a:7a:c3:36:4c:80:3d:00:80:44:&lt;br /&gt;
     ab:10:ed:b5:6b:3f:a9:32:ff:9b:80:70:0b:e3:b9:&lt;br /&gt;
     90:74:c4:a0:9c:4a:9e:eb:a1:72:d6:47:30:ff:cb:&lt;br /&gt;
     f8:a4:f0:fe:51&lt;br /&gt;
 ASN1 OID: prime256v1&lt;br /&gt;
 NIST CURVE: P-256&lt;br /&gt;
&lt;br /&gt;
For more details on elliptic curve cryptography or key generation, check out the [https://www.openssl.org/docs/manpages.html manpages].&lt;br /&gt;
&lt;br /&gt;
==Base64 Encoding Strings==&lt;br /&gt;
&lt;br /&gt;
For simple string encoding, you can use &amp;quot;here string&amp;quot; syntax with the [[Base64 Encoding|base64]] command as below. Intuitively, the &amp;lt;tt&amp;gt;-e&amp;lt;/tt&amp;gt; flag specifies the action to be encoding.&lt;br /&gt;
&lt;br /&gt;
 $ openssl base64 -e &amp;lt;&amp;lt;&amp;lt; 'Welcome to openssl wiki'&lt;br /&gt;
 V2VsY29tZSB0byBvcGVuc3NsIHdpa2kK&lt;br /&gt;
&lt;br /&gt;
Similarly, the base64 command's &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; flag may be used to indicate decoding mode.&lt;br /&gt;
&lt;br /&gt;
 $ openssl base64 -d &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kK'&lt;br /&gt;
 Welcome to openssl wiki&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Note:''''' base64 line length is limited to 76 characters by default in openssl (and generated with 64 characters per line).&lt;br /&gt;
&lt;br /&gt;
 openssl base64 -e &amp;lt;&amp;lt;&amp;lt; 'Welcome to openssl wiki with a very long line that splits...'&lt;br /&gt;
 V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRo&lt;br /&gt;
 YXQgc3BsaXRzLi4uCg==&lt;br /&gt;
 openssl base64 -d &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRoYXQgc3BsaXRzLi4uCg=='&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; NOTHING!&lt;br /&gt;
&lt;br /&gt;
To be able to decode a base64 line without line feeds that exceeds the default 76 character length restriction use the &amp;lt;code&amp;gt;-A&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
 openssl base64 -d -A &amp;lt;&amp;lt;&amp;lt; 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRoYXQgc3BsaXRzLi4uCg=='&lt;br /&gt;
 Welcome to openssl wiki with a very long line that splits...&lt;br /&gt;
&lt;br /&gt;
It is recommended to actually split base64 strings into multiple lines of 64 characters, however, since the &amp;lt;code&amp;gt;-A&amp;lt;/code&amp;gt; option is buggy, particularly with its handling of long files.&lt;br /&gt;
&lt;br /&gt;
==Generating a File Hash==&lt;br /&gt;
&lt;br /&gt;
One of the most basic uses of the [[dgst]] command (short for digest) is viewing the hash of a given file. To do this, simply invoke the command with the specified digest algorithm to use. For this example, I will be hashing an arbitrary file on my system using the [[MD5]], [[SHA1]], and [[SHA384]] algorithms.&lt;br /&gt;
&lt;br /&gt;
 $ openssl dgst -md5 primes.dat&lt;br /&gt;
 MD5(primes.dat)= 7710839bb87d2c4c15a86c2b2c805664&lt;br /&gt;
 &lt;br /&gt;
 $ openssl dgst -sha1 primes.dat&lt;br /&gt;
 SHA1(primes.dat)= 5dfab70ce825591689f4a3f65910870a9022cd32&lt;br /&gt;
 &lt;br /&gt;
 $ openssl dgst -sha384 primes.dat&lt;br /&gt;
 SHA384(primes.dat)= 41399bdffe6850f5a44852d967f3db415654f20dc2eb6cd231772f6ea411876d85d44091ebbc6b1f4ce8673e64617271&lt;br /&gt;
&lt;br /&gt;
For a list of the available digest algorithms, you can use the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -digest-algorithms&lt;br /&gt;
 RSA-MD4 =&amp;gt; MD4&lt;br /&gt;
 RSA-MD5 =&amp;gt; MD5&lt;br /&gt;
 RSA-MDC2 =&amp;gt; MDC2&lt;br /&gt;
 RSA-RIPEMD160 =&amp;gt; RIPEMD160&lt;br /&gt;
 RSA-SHA1 =&amp;gt; SHA1&lt;br /&gt;
 RSA-SHA1-2 =&amp;gt; RSA-SHA1&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
You can also use a similar command to see the available [[Digest Commands|digest commands]]:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -digest-commands&lt;br /&gt;
 blake2b512        blake2s256        md5               sha1              &lt;br /&gt;
 sha224            sha256            sha3-224          sha3-256          &lt;br /&gt;
 sha3-384          sha3-512          sha384            sha512            &lt;br /&gt;
 sha512-224        sha512-256        shake128          shake256          &lt;br /&gt;
 sm3  &lt;br /&gt;
&lt;br /&gt;
Below are three sample invocations of the [[md5]], [[sha1]], and [[sha384]] digest commands using the same file as the [[dgst]] command invocation above.&lt;br /&gt;
&lt;br /&gt;
 $ openssl md5 primes.dat&lt;br /&gt;
 MD5(primes.dat)= 7710839bb87d2c4c15a86c2b2c805664&lt;br /&gt;
 &lt;br /&gt;
 $ openssl sha1 primes.dat&lt;br /&gt;
 SHA1(primes.dat)= 5dfab70ce825591689f4a3f65910870a9022cd32&lt;br /&gt;
 &lt;br /&gt;
 $ openssl sha384 primes.dat&lt;br /&gt;
 SHA384(primes.dat)= 41399bdffe6850f5a44852d967f3db415654f20dc2eb6cd231772f6ea411876d85d44091ebbc6b1f4ce8673e64617271&lt;br /&gt;
&lt;br /&gt;
==File Encryption and Decryption==&lt;br /&gt;
&lt;br /&gt;
The following example demonstrates a simple file encryption and decryption using the [[enc]] command. The first argument is the cipher algorithm to use for encrypting the file. For this example I carefully selected the [[AES-256]] algorithm in [[CBC Mode]] by looking up the available ciphers and picking out the first one I saw. To see the list of available ciphers, you can use the following command.&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -ciphers&lt;br /&gt;
 Supported ciphers:&lt;br /&gt;
 -aes-128-cbc               -aes-128-cfb               -aes-128-cfb1             &lt;br /&gt;
 -aes-128-cfb8              -aes-128-ctr               -aes-128-ecb              &lt;br /&gt;
 -aes-128-ofb               -aes-192-cbc               -aes-192-cfb              &lt;br /&gt;
 -aes-192-cfb1              -aes-192-cfb8              -aes-192-ctr&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
You can also use the following command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl list -cipher-algorithms&lt;br /&gt;
 AES-128-CBC&lt;br /&gt;
 AES-128-CBC-HMAC-SHA1&lt;br /&gt;
 AES-128-CBC-HMAC-SHA256&lt;br /&gt;
 id-aes128-CCM&lt;br /&gt;
 AES-128-CFB&lt;br /&gt;
 AES-128-CFB1&lt;br /&gt;
 AES-128-CFB8&lt;br /&gt;
 AES-128-CTR&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Having selected an encryption algorithm, you must then specify whether the action you are taking is either encryption or decryption via the &amp;lt;tt&amp;gt;-e&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; flags, respectively. The &amp;lt;tt&amp;gt;-iter&amp;lt;/tt&amp;gt; flag specifies the number of iterations on the password used for deriving the encryption key. A higher iteration count increases the time required to brute-force the resulting file. Using this option implies enabling use of the [[Password-Based Key Derivation Function 2]], usually set using the &amp;lt;tt&amp;gt;-pbkdf2&amp;lt;/tt&amp;gt; flag. We then use the &amp;lt;tt&amp;gt;-salt&amp;lt;/tt&amp;gt; flag to enable the use of a randomly generated salt in the key-derivation function.&lt;br /&gt;
&lt;br /&gt;
Putting it all together, you can see the command to encrypt a file and the corresponding output below. Note that the passwords entered by the user are blank, just as they would usually be in a terminal session.&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -aes-256-cbc -e -iter 1000 -salt -in primes.dat -out primes.enc&lt;br /&gt;
 enter aes-256-cbc encryption password:&lt;br /&gt;
 Verifying - enter aes-256-cbc encryption password:&lt;br /&gt;
&lt;br /&gt;
The analogous decryption command is as follows:&lt;br /&gt;
&lt;br /&gt;
 $ openssl enc -aes-256-cbc -d -iter 1000 -in primes.enc -out primes.dec&lt;br /&gt;
 enter aes-256-cbc decryption password:&lt;br /&gt;
&lt;br /&gt;
=Commands=&lt;br /&gt;
&lt;br /&gt;
There are three different kinds of commands. These are [[Standard commands|standard commands]], [[Cipher commands|cipher commands]], and [[Digest comands|digest commands]]. Calling the OpenSSL top-level &amp;lt;tt&amp;gt;help&amp;lt;/tt&amp;gt; command with no arguments will result in openssl printing all available commands by group, sorted alphabetically.&lt;br /&gt;
&lt;br /&gt;
==Standard Commands==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto; text-align: center; width: 65%;&amp;quot;&lt;br /&gt;
|+ Overview of OpenSSL's command line utilities&lt;br /&gt;
! style=&amp;quot;width: 25%; padding: 4px;&amp;quot; | Command&lt;br /&gt;
! style=&amp;quot;width: 75%; padding: 4px;&amp;quot; | Description&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-asn1parse.html asn1parse]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Parse an ASN.1 sequence.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ca.html ca]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Authority (CA) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html ciphers]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Cipher Suite Description Determination.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-cmp.html cmp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Management Protocol (CMP, RFC 4210) application.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-cms.html cms]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  CMS (Cryptographic Message Syntax) utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-crl.html crl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Certificate Revocation List (CRL) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-crl2pkcs7.html crl2pkcs7]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  CRL to PKCS#7 Conversion.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dgst.html dgst]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Message Digest calculation. MAC calculations are superseded by mac(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dhparam.html dhparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation and Management of Diffie-Hellman Parameters. Superseded by genpkey(1) and pkeyparam(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dsa.html dsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  DSA Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-dsaparam.html dsaparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  DSA Parameter Generation and Management. Superseded by genpkey(1) and pkeyparam(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ec.html ec]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  EC (Elliptic curve) key processing.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ecparam.html ecparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  EC parameter manipulation and generation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-enc.html enc]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Encoding with Ciphers.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-engine.html engine]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Engine (loadable module) information and manipulation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-errstr.html errstr]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Error Number to Error String Conversion.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-fipsinstall.html fipsinstall]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  IPS configuration installation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-gendsa.html gendsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of DSA Private Key from Parameters. Superseded by genpkey(1) and pkey(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html genpkey]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of Private Key or Parameters.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-genrsa.html genrsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of RSA Private Key. Superseded by genpkey(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-help.html help]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Display information about a command's options.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-info.html info]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Display diverse information built into the OpenSSL libraries.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-kdf.html kdf]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Key Derivation Functions.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-list.html list]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  List algorithms and features.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-mac.html mac]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Message Authentication Code Calculation.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-nseq.html nseq]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Create or examine a Netscape certificate sequence.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ocsp.html ocsp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Online Certificate Status Protocol utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-passwd.html passwd]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generation of hashed passwords.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs12.html pkcs12]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#12 Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs7.html pkcs7]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#7 Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkcs8.html pkcs8]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#8 format private key conversion tool.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkey.html pkey]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public and private key management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkeyparam.html pkeyparam]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public key algorithm parameter management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-pkeyutl.html pkeyutl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Public key algorithm cryptographic operation utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-prime.html prime]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Compute prime numbers.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rand.html rand]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Generate pseudo-random bytes.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rehash.html rehash]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Create symbolic links to certificate and CRL files named by the hash values.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-req.html req]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  PKCS#10 X.509 Certificate Signing Request (CSR) Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rsa.html rsa]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  RSA key management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-rsautl.html rsautl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  RSA utility for signing, verification, encryption, and decryption. Superseded by pkeyutl(1).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_client.html s_client]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  This implements a generic SSL/TLS client which can establish a transparent connection to a remote server speaking SSL/TLS.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_server.html s_server]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  This implements a generic SSL/TLS server which accepts connections from remote clients speaking SSL/TLS. &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-s_time.html s_time]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SSL Connection Timer.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-sess_id.html sess_id]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SSL Session Data Management.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-smime.html smime]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  S/MIME mail processing.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-openssl-speed.html speed]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Algorithm Speed Measurement.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-spkac.html spkac]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  SPKAC printing and generating utility.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-srp.html srp]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Maintain SRP password file.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-storeutl.html storeutl]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Utility to list and display certificates, keys, CRLs, etc.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-ts.html ts]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  Time Stamping Authority tool (client/server).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-verify.html verify]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  X.509 Certificate Verification.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-version.html version]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  OpenSSL Version Information.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; | [https://www.openssl.org/docs/manmaster/man1/openssl-x509.html x509]&lt;br /&gt;
|style=&amp;quot;padding: 4px;&amp;quot; |  X.509 Certificate Data Management.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Further reading =&lt;br /&gt;
&lt;br /&gt;
* Paul Heinlein. [https://www.madboa.com/geek/openssl/ &amp;quot;OpenSSL Command-Line HOWTO&amp;quot;]. Has many quick cookbook-style recipes for doing common tasks using the &amp;quot;openssl&amp;quot; command-line application.&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
[[Category:Shell level]]&lt;/div&gt;</summary>
		<author><name>DDvO</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3022</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3022"/>
		<updated>2020-04-23T06:14:25Z</updated>

		<summary type="html">&lt;p&gt;DDvO: /* Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 */ add &amp;quot;other major new features&amp;quot; sub-section with entries for CMP and HTTP client&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 4 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;EVP&amp;quot; set of APIs. They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;EVP&amp;quot; APIs and the &amp;quot;low level&amp;quot; APIs. The EVP APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' are present in OpenSSL 3.0 but always fail. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module. The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\fips.dll' on Windows. (Drafting note: need to check the locations are correct!)&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the module:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsinstall.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly or via config, then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there maybe minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. It can be useful in some situations where you want to avoid the automatic loading of the default provider.&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them. It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
Note that default properties are not currently functional in the OpenSSL 3.0 alpha 1 release.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are present, but always fail in OpenSSL 3.0 so you should not use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsinstall.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsinstall.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conform to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
NOTE: Default properties are currently not functional in the OpenSSL 3.0 alpha 1 release - see the known issues below&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS approved algorithms match against the property query &amp;quot;fips=yes&amp;quot;. The FIPS module also has some non-approved algorithms contained within it (currently X25519, X448, Ed25519 and Ed448). These algorithms do not have the &amp;quot;fips=yes&amp;quot; property defined for them. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsinstall.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In OpenSSL 3.0 alpha 1 release only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Non-approved alogrithms available in the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
There are a small number of algorithms available within the FIPS module which are &amp;quot;allowed&amp;quot; but not &amp;quot;approved&amp;quot;. These are SHAKE-256, X25519, X448, ED25519 and ED448. All such algorithms have the property &amp;quot;fips=no&amp;quot; against them.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validate algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specifc properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first  example we create two SSL_CTX object using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_Digest{Sign,Verify}Init() does not handle no default digest (see [https://github.com/openssl/openssl/pull/11571 github #11571] and [https://github.com/openssl/openssl/pull/11576 github #11576])&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For FIPS, only SHAKE-256, not SHAKE-128. SHAKE-256 will not be undergoing FIPS validation.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2BMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2SMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC-128                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC-256                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || These cannot yet be FIPS validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 0%                 || ??                          || Scheduled for alpha 2&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSAES-OAEP                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || These cannot yet be FIPS validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default        || 80%                || ??                          || RSASSA-PSS support untested&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || These cannot yet be FIPS validated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>DDvO</name></author>
	</entry>
</feed>