Technical Notes

Manpages - openssl.1

is a cryptography toolkit implementing the Transport Layer Security

network protocol, as well as related cryptography standards.

The

program is a command line tool for using the various cryptography functions of

crypto library from the shell.

The pseudo-commands

and

output a list

of the names of all standard commands, message digest commands, or cipher commands, respectively, that are available in the present

utility.

The pseudo-commands

and

list all cipher and message digest names, one entry per line. Aliases are listed as:

The pseudo-command

lists all supported public key algorithms.

The pseudo-command

tests whether a command of the specified name is available. If

does not exist, it returns 0 and prints

otherwise it returns 1 and prints

In both cases, the output goes to stdout and nothing is printed to stderr. Additional command line arguments are always ignored. Since for each cipher there is a command of the same name, this provides an easy way for shell scripts to test for the availability of ciphers in the

program.

is not able to detect pseudo-commands such as

or

itself.

The

command is a diagnostic utility that can parse ASN.1 structures. It can also be used to extract data from ASN.1 formatted data.

The options are as follows:

Dump the first

bytes of unknown data in hex form.

Dump unknown data in hex form.

Generate encoded data based on string

file

or both, using the format described in

If only

is present then the string is obtained from the default section using the name

The encoded data is passed through the ASN.1 parser and printed out as though it came from a file; the contents can thus be examined and written to a file using the

option.

Indent the output according to the

of the structures.

The input file to read from, or standard input if not specified.

The input format.

Number of bytes to parse; the default is until end of file.

Do not output the parsed version of the input file.

Starting offset to begin parsing; the default is start of file.

A file containing additional object identifiers

If an OID

is not part of

internal table, it will be represented in numerical form

Each line consists of three columns: the first column is the OID in numerical format and should be followed by whitespace. The second column is the

which is a single word followed by whitespace. The final column is the rest of the line and is the

displays the long name.

The DER-encoded output file; the default is no encoded output (useful when combined with

Parse the content octets of the ASN.1 object starting at

This option can be used multiple times to

into a nested structure.

The

command is a minimal certificate authority (CA) application. It can be used to sign certificate requests in a variety of forms and generate certificate revocation lists (CRLs). It also maintains a text database of issued certificates and their status.

The options relevant to CAs are as follows:

Batch mode. In this mode no questions will be asked and all certificates will be certified automatically.

The CA certificate file.

Specify an alternative configuration file.

If reading the serial from the text file as specified in the configuration fails, create a new random serial to be used as the next serial number.

The number of days to certify the certificate for.

Set the expiry date. The format of the date is [YY]YYMMDDHHMMSSZ, with all four year digits required for dates from 2050 onwards.

The section of the configuration file containing certificate extensions to be added when a certificate is issued (defaults to

unless the

option is used). If no extension section is present, a V1 certificate is created. If the extension section is present

then a V3 certificate is created. See the

manual page for details of the extension section format.

An additional configuration

to read certificate extensions from (using the default section unless the

option is also used).

An input

containing a single certificate request to be signed by the CA.

If present, this should be the last option; all subsequent arguments are assumed to be the names of files containing certificate requests.

The

used to encrypt the private key. Since on some systems the command line arguments are visible, this option should be used with caution.

The private key to sign requests with.

Private key file format. The default is

The message digest to use. Possible values include

and

This option also applies to CRLs.

This is a legacy option to make

work with very old versions of the IE certificate enrollment control

It used UniversalStrings for almost everything. Since the old control has various security bugs, its use is strongly discouraged. The newer control

does not need this option.

This option causes the

argument to be interpreted with full support for multivalued RDNs, for example

If

is not used, the UID value is set to

Specifies the configuration file

to use (overrides

in the

section).

The DN of a certificate can contain the EMAIL field if present in the request DN, however it is good policy just having the email set into the

extension of the certificate. When this option is set, the EMAIL field is removed from the certificate's subject and set only in the, eventually present, extensions. The

keyword can be used in the configuration file to enable this behaviour.

Don't output the text form of a certificate to the output file.

The output file to output certificates to. The default is standard output. The certificate details will also be printed out to this file in PEM format.

The

to output certificates to. The certificate will be written to a file consisting of the serial number in hex with

appended.

The key password source.

Define the CA

to use. The policy section in the configuration file consists of a set of variables corresponding to certificate DN fields. The values may be one of

(the value must match the same field in the CA certificate),

(the value must be present), or

(the value may be present). Any fields not mentioned in the policy section are silently deleted, unless the

option is set, but this can be regarded more of a quirk than intended behaviour.

Normally, the DN order of a certificate is the same as the order of the fields in the relevant policy section. When this option is set, the order is the same as the request. This is largely for compatibility with the older IE enrollment control which would only accept certificates if their DNs matched the order of the request. This is not needed for Xenroll.

Indicates the issued certificates are to be signed with the key the certificate requests were signed with, given with

Certificate requests signed with a different key are ignored. If

or

are given,

is ignored.

A consequence of using

is that the self-signed certificate appears among the entries in the certificate database (see the configuration option

and uses the same serial number counter as all other certificates signed with the self-signed certificate.

Pass options to the signature algorithm during sign or certify operations. The names and values of these options are algorithm-specific.

A single self-signed certificate to be signed by the CA.

Set the start date. The format of the date is [YY]YYMMDDHHMMSSZ, with all four year digits required for dates from 2050 onwards.

Supersedes the subject name given in the request. The

must be formatted as

characters may be escaped by

no spaces are skipped.

Interpret field values read from a terminal or obtained from a configuration file as UTF-8 strings. By default, they are interpreted as ASCII.

Print extra details about the operations being performed.

The options relevant to CRLs are as follows:

This is the same as

except the revocation reason is set to CACompromise.

Set the revocation reason to keyCompromise and the compromise time to

should be in GeneralizedTime format, i.e. YYYYMMDDHHMMSSZ.

Set the CRL revocation reason code to certificateHold and the hold instruction to

which must be an OID. Although any OID can be used, only holdInstructionNone (the use of which is discouraged by RFC 2459), holdInstructionCallIssuer or holdInstructionReject will normally be used.

Revocation reason, where

is one of: unspecified, keyCompromise, CACompromise, affiliationChanged, superseded, cessationOfOperation, certificateHold or removeFromCRL. The matching of

is case insensitive. Setting any revocation reason will make the CRL v2. In practice, removeFromCRL is not particularly useful because it is only used in delta CRLs which are not currently implemented.

The number of days before the next CRL is due. This is the days from now to place in the CRL

field.

The

of the configuration file containing CRL extensions to include. If no CRL extension section is present then a V1 CRL is created; if the CRL extension section is present (even if it is empty) then a V2 CRL is created. The CRL extensions specified are CRL extensions and not CRL entry extensions. It should be noted that some software can't handle V2 CRLs. See the

manual page for details of the extension section format.

The number of hours before the next CRL is due.

The number of seconds before the next CRL is due.

Generate a CRL based on information in the index file.

A

containing a certificate to revoke.

Show the status of the certificate with serial number

Update the database index to purge expired certificates.

Many of the options can be set in the

section of the configuration file (or in the default section of the configuration file), specified using

or

The options

and

are read directly from the

section.

Many of the configuration file options are identical to command line options. Where the option is present in the configuration file and the command line, the command line value is used. Where an option is described as mandatory, then it must be present in the configuration file or the command line equivalent

used.

The same as

It gives the file containing the CA certificate. Mandatory.

Determines how extensions in certificate requests should be handled. If set to

or this option is not present, then extensions are ignored and not copied to the certificate. If set to

then any extensions present in the request that are not already present are copied to the certificate. If set to

then all extensions in the request are copied to the certificate: if the extension is already present in the certificate it is deleted first.

The

option should be used with caution. If care is not taken, it can be a security risk. For example, if a certificate request contains a

extension with CA:TRUE and the

value is set to

and the user does not spot this when the certificate is displayed, then this will hand the requester a valid CA certificate.

This situation can be avoided by setting

to

and including

with CA:FALSE in the configuration file. Then if the request contains a

extension, it will be ignored.

The main use of this option is to allow a certificate request to supply values for certain extensions such as

The same as

A text file containing the next CRL number to use in hex. The CRL number will be inserted in the CRLs only if this file exists. If this file is present, it must contain a valid CRL number.

The text database file to use. Mandatory. This file must be present, though initially it will be empty.

The same as the

and

options. These will only be used if neither command line option is present. At least one of these must be present to generate a CRL.

The same as the

option. The number of days to certify a certificate for.

The same as the

option. Either this option or

must be present.

The same as the

option. The message digest to use. Mandatory.

The same as the

option. The start date to certify a certificate for. If not set, the current time is used.

The same as

If the EMAIL field is to be removed from the DN of the certificate, simply set this to

If not present, the default is to allow for the EMAIL field in the certificate's DN.

The same as

These options allow the format used to display the certificate details when asking the user to confirm signing. All the options supported by the

utilities'

and

switches can be used here, except that

and

are permanently set and cannot be disabled (this is because the certificate signature cannot be displayed because the certificate has not been signed at this point).

For convenience, the value

is accepted by both to produce a reasonable output.

If neither option is present, the format used in earlier versions of

is used. Use of the old format is strongly discouraged because it only displays fields mentioned in the

section, mishandles multicharacter string types and does not display extensions.

The same as the

command line option. It specifies the directory where new certificates will be placed. Mandatory.

This specifies a file containing additional object identifiers. Each line of the file should consist of the numerical form of the object identifier followed by whitespace, then the short name followed by whitespace and finally the long name.

This specifies a section in the configuration file containing extra object identifiers. Each line should consist of the short name of the object identifier followed by

and the numerical form. The short and long names are the same when this option is used.

The same as

Mandatory.

The same as

Same as the

option. The file containing the CA private key. Mandatory.

A text file containing the next serial number to use in hex. Mandatory. This file must be present and contain a valid serial number.

If the value

is given, the valid certificate entries in the database must have unique subjects. If the value

is given, several valid certificate entries may have the exact same subject. The default value is

Note that it is valid in some circumstances for certificates to be created without any subject. In cases where there are multiple certificates without subjects this does not count as a duplicate.

The same as

The

command calculates a hash value of

file in the specified directory list and creates symbolic links for each file, where the name of the link is the hash value. See the

manual page for how hash links are used.

The links created are of the form

where each

is a hexadecimal character and

is a single decimal digit. The hashes for CRLs look similar, except the letter

appears after the period, like this:

When processing a directory,

will first remove all links that have a name in that syntax and invalid reference.

Multiple objects may have the same hash; they will be indicated by incrementing the

value. Duplicates are found by comparing the full SHA256 fingerprint. A warning will be displayed if a duplicate is found.

A warning will also be displayed if there are files that cannot be parsed as either a certificate or a CRL.

The options are as follows:

Perform a dry-run, and do not make any changes.

Print extra details about the processing.

Specify the directories to process.

The

command converts the

string from the format documented in

into an ordered SSL cipher suite preference list. If no

string is specified, the

list is printed.

The options are as follows:

Print a brief usage message.

Only list ciphers that are supported by the TLS method.

In combination with the

option, list the ciphers which could be used if the specified protocol version were negotiated.

Verbose. List ciphers with cipher suite code in hex format, cipher name, and a complete description of protocol version, key exchange, authentication, encryption, and mac algorithms.

Like

but without cipher suite codes.

The

command handles S/MIME v3.1 mail. It can encrypt, decrypt, sign and verify, compress and uncompress S/MIME messages.

The MIME message must be sent without any blank lines between the headers and the output. Some mail programs will automatically add a blank line. Piping the mail directly to sendmail is one way to achieve the correct format.

The supplied message to be signed or encrypted must include the necessary MIME headers or many S/MIME clients won't display it properly (if at all). You can use the

option to automatically add plain text headers.

A "signed and encrypted" message is one where a signed message is then encrypted. This can be produced by encrypting an already signed message.

There are various operation options that set the type of operation to be performed. The meaning of the other options varies according to the operation type.

Encrypt mail for the given recipient certificates. Input file is the message to be encrypted. The output file is the encrypted mail in MIME format. The actual CMS type is EnvelopedData. Note that no revocation check is done for the recipient cert, so if that key has been compromised, others may be able to decrypt the text.

Decrypt mail using the supplied certificate and private key. Expects an encrypted mail message in MIME format for the input file. The decrypted mail is written to the output file.

Sign mail using the supplied certificate and private key. Input file is the message to be signed. The signed message in MIME format is written to the output file.

Verify signed mail. Expects a signed mail message on input and outputs the signed data. Both clear text and opaque signing are supported.

Take an input message and write out a PEM encoded CMS structure.

Resign a message. Take an existing message and one or more new signers. This operation uses an existing message digest when adding a new signer. This means that attributes must be present in at least one existing signer using the same message digest or this operation will fail.

Create a CMS Data type.

Output a content from the input CMS Data type.

Create a CMS DigestedData type.

Verify a CMS DigestedData type and output the content.

Create a CMS CompressedData type. Must be compiled with zlib support for this option to work.

Uncompress a CMS CompressedData type and output the content. Must be compiled with zlib support for this option to work.

Encrypt a content using supplied symmetric key and algorithm using a CMS EncryptedData type.

Decrypt a CMS EncryptedData type using supplied symmetric key.

Generate and output a signed receipt for the supplied message. The input message must contain a signed receipt request. Functionality is otherwise similar to the

operation.

Verify a signed receipt in file. The input message must contain the original receipt request. Functionality is otherwise similar to the

operation.

The remaining options are as follows:

The encryption algorithm to use. 128-, 192-, or 256-bit AES, 128-, 192-, or 256-bit CAMELLIA, DES (56 bits), triple DES (168 bits), or 40-, 64-, or 128-bit RC2, respectively; if not specified, triple DES is used. Only used with

and

commands.

Normally the input message is converted to "canonical" format which is effectively using CR/LF as end of line, as required by the S/MIME specification. When this option is present, no translation occurs. This is useful when handling binary data which may not be in MIME format.

A file containing trusted CA certificates, used with

and

A directory containing trusted CA certificates, used with

and

This directory must be a standard certificate directory: that is a hash of each subject name (using

should be linked to each certificate.

Allows additional certificate revocation lists to be specified for verification. The CRLs should be in PEM format.

One or more certificates of message recipients: used when encrypting a message.

Allows additional certificates to be specified. When signing, these will be included with the message. When verifying, these will be searched for the signer's certificates. The certificates should be in PEM format.

A file that any certificates contained in the message are written to.

Set various certificate chain validation options. See the

command for details.

A file containing the detached content. This is only useful with the

command. This is only usable if the CMS structure is using the detached signature form where the content is not included. This option will override any content if the input format is S/MIME and it uses the multipart/signed MIME content type.

Output a S/MIME message with CR/LF end of line.

Set the CMS_DEBUG_DECRYPT flag when decrypting. This option should be used with caution, since this can be used to disable the MMA attack protection and return an error if no recipient can be found. See the

manual page for details of the flag.

The relevant mail headers. These are included outside the signed portion of a message so they may be included manually. If signing then many S/MIME mail clients check the signer's certificate's email address matches that specified in the From: address.

Set the encapsulated content type, used with

If not supplied, the Data type is used. The type argument can be any valid OID name in either text or numerical format.

The input message to be encrypted or signed or the message to be decrypted or verified.

The input format for the CMS structure. The default is

which reads an S/MIME format message.

and

format change this to expect PEM and DER format CMS structures instead. This currently only affects the input format of the CMS structure; if no CMS structure is being input (for example with

or

this option has no effect.

The private key to use when signing or decrypting. This must match the corresponding certificate. If this option is not specified then the private key must be included in the certificate file specified with the

or

file. When signing, this option can be used multiple times to specify successive keys.

Input private key format. The default is

Use subject key identifier to identify certificates instead of issuer name and serial number. The supplied certificate must include a subject key identifier extension. Supported by

and

operations.

Set customised parameters for the preceding key or certificate for encryption and signing. It can currently be used to set RSA-PSS for signing, RSA-OAEP for encryption or to modify default parameters for ECDH. This option can be used multiple times.

The digest algorithm to use when signing or resigning. If not present then the default digest algorithm for the signing key will be used (usually SHA1).

Do not verify the signer's attribute of a signature.

Do not verify the content of a signed message.

Do not verify the signer's certificate of a signed message.

Do not include attributes. Normally when a message is signed a set of attributes are included which include the signing time and supported symmetric algorithms. With this option they are not included.

Do not include the signer's certificate. This will reduce the size of the signed message but the verifier must have a copy of the signer's certificate available locally (passed using the

option for example).

When signing a message, use opaque signing. This form is more resistant to translation by mail relays but it cannot be read by mail agents that do not support S/MIME. Without this option cleartext signing with the MIME type multipart/signed is used.

Only the certificates specified in the

option are used. When verifying a message, normally certificates (if any) included in the message are searched for the signing certificate. The supplied certificates can still be used as untrusted CAs however.

Output an old S/MIME content type like "application/x-pkcs7-".

Do not output the parsed CMS structure for the

operation. This is useful when combined with the

option or if the syntax of the CMS structure is being checked.

Do not try to verify the signatures on the message.

Exclude the list of supported algorithms from signed attributes; other options such as signing time and content type are still included.

Do not verify the signer's certificate of a signed message.

The message text that has been decrypted or verified or the output MIME format message that has been signed or verified.

This specifies the output format for the CMS structure. The default is

which writes an S/MIME format message.

and

format change this to write PEM and DER format CMS structures instead. This currently only affects the output format of the CMS structure; if no CMS structure is being output (for example with

or

this option has no effect.

The private key password source.

Print out all fields of the CMS structure for the

operation. This is mainly useful for testing purposes.

Specify PasswordRecipientInfo (PWRI) password to use. Supported by the

and

operations.

Specify the format for a signed receipt for use with the

operation. The default is

Indicate requests should be provided by all recipient or first tier recipients (those mailed directly and not from a mailing list), for the

operation to include a signed receipt request. Ignored if

is included.

Add an explicit email address where receipts should be supplied.

Print out the contents of any signed receipt requests for the

operation.

Add an explicit email address where signed receipts should be sent to. This option must be supplied if a signed receipt is requested.

When decrypting a message, this specifies the recipient's certificate. The certificate must match one of the recipients of the message or an error occurs. When encrypting a message, this option may be used multiple times to specify each recipient. This form must be used if customised parameters are required (for example to specify RSA-OAEP). Only certificates carrying RSA, Diffie-Hellman or EC keys are supported by this option.

Specify symmetric key to use. The key must be supplied in hex format and be consistent with the algorithm used. Supported by the

and

operations. When used with

or

the supplied key is used to wrap or unwrap the content encryption key using an AES key in the KEKRecipientInfo type.

The key identifier for the supplied symmetric key for KEKRecipientInfo type. This option must be present if the

option is used with

With

operations the id is used to locate the relevant key; if it is not supplied then an attempt is used to decrypt any KEKRecipientInfo structures.

A signing certificate when signing or resigning a message; this option can be used multiple times if more than one signer is required. If a message is being verified then the signers certificates will be written to this file if the verification was successful.

The

and

options are equivalent and enable streaming I/O for encoding operations. This permits single pass processing of data without the need to hold the entire contents in memory, potentially supporting very large files. Streaming is automatically set for S/MIME signing with detached data if the output format is

it is currently off by default for all other operations.

disable streaming I/O where it would produce an indefinite length constructed encoding. This option currently has no effect.

Add plain text (text/plain) MIME headers to the supplied message if encrypting or signing. If decrypting or verifying, it strips off text headers: if the decrypted or verified message is not of MIME type text/plain then an error occurs.

Set verification error code to exit code to indicate what verification error has occurred. Supported by

operation only. Exit code value minus 32 shows verification error code. See

command for the list of verification error code.

The exit codes for

are as follows:

The operation was completely successful.

An error occurred parsing the command options.

One of the input files could not be read.

An error occurred creating the CMS file or when reading the MIME message.

An error occurred decrypting or verifying the message.

The message was verified correctly but an error occurred writing out the signer's certificates.

An error occurred writing the output file.

A verify error occurred while

is specified.

The

command processes CRL files in DER or PEM format.

The options are as follows:

Verify the signature on a CRL by looking up the issuing certificate in

Verify the signature on a CRL by looking up the issuing certificate in

This directory must be a standard certificate directory, i.e. a hash of each subject name (using

should be linked to each certificate.

Print the CRL number.

Print the CRL fingerprint.

Output a hash of the issuer name. This can be used to look up CRLs in a directory by issuer name.

Output an old-style (MD5) hash of the issuer name.

The input file to read from, or standard input if not specified.

The input format.

Output the issuer name.

Output the

field. This option is misnamed for historical reasons.

Specify certificate name options.

Output the

field.

Do not output the encoded version of the CRL.

The output file to write to, or standard output if not specified.

The output format.

Print the CRL in plain text.

Verify the signature on the CRL.

The

command takes an optional CRL and one or more certificates and converts them into a PKCS#7 degenerate

structure.

The options are as follows:

Add the certificates in PEM

to the PKCS#7 structure. This option can be used more than once to read certificates from multiple files.

Read the CRL from

or standard input if not specified.

The input format.

Normally, a CRL is included in the output file. With this option, no CRL is included in the output file and a CRL is not read from the input file.

Write the PKCS#7 structure to

or standard output if not specified.

The output format.

The digest functions output the message digest of a supplied

or

in hexadecimal form. They can also be used for digital signing and verification.

The options are as follows:

Output the digest or signature in binary form.

Print the digest in two-digit groups separated by colons.

Print BIO debugging information.

Use the specified message

The default is SHA256. The available digests can be displayed using

The following are equivalent:

and

Digest is to be output as a hex dump. This is the default case for a

digest as opposed to a digital signature.

Create a hashed MAC using

Specifies the key format to sign the digest with.

Create a keyed Message Authentication Code (MAC). The most popular MAC algorithm is HMAC (hash-based MAC), but there are other MAC algorithms which are not based on hash. MAC keys and other options should be set via the

parameter.

Passes options to the MAC algorithm, specified by

The following options are supported by HMAC:

Specifies the MAC key as an alphanumeric string (use if the key contain printable characters only). String length must conform to any restrictions of the MAC algorithm.

Specifies the MAC key in hexadecimal form (two hex digits per byte). Key length must conform to any restrictions of the MAC algorithm.

The output file to write to, or standard output if not specified.

The key password source.

Verify the signature using the private key in

The output is either

or

Print the digest in coreutils format.

Digitally sign the digest using the private key in

The actual signature to verify.

Pass options to the signature algorithm during sign or verify operations. The names and values of these options are algorithm-specific.

Verify the signature using the public key in

The output is either

or

File or files to digest. If no files are specified then standard input is used.

The

command is used to manipulate DH parameter files. Only the older PKCS#3 DH is supported, not the newer X9.42 DH.

The options are as follows:

The generator to use; 2 is the default. If present, the input file is ignored and parameters are generated instead.

Convert the parameters into C code. The parameters can then be loaded by calling the

function.

Check the DH parameters.

Read or create DSA parameters, converted to DH format on output. Otherwise,

primes

will be used for DH parameter generation.

DH parameter generation with the

option is much faster, and the recommended exponent length is shorter, which makes DH key exchange more efficient. Beware that with such DSA-style DH parameters, a fresh DH key should be created for each use to avoid small-subgroup attacks that may be possible otherwise.

The input file to read from, or standard input if not specified.

The input format.

Do not output the encoded version of the parameters.

The output file to write to, or standard output if not specified.

The output format.

Print the DH parameters in plain text.

Generate a parameter set of size

It must be the last option. If not present, a value of 2048 is used. If this value is present, the input file is ignored and parameters are generated instead.

The

command processes DSA keys. They can be converted between various forms and their components printed out.

This command uses the traditional

compatible format for private key encryption: newer applications should use the more secure PKCS#8 format using the

command.

The options are as follows:

Encrypt the private key with the AES, DES, or the triple DES ciphers, respectively, before outputting it. A pass phrase is prompted for. If none of these options are specified, the key is written in plain text. This means that using the

utility to read an encrypted key with no encryption option can be used to remove the pass phrase from a key, or by setting the encryption options it can be used to add or change the pass phrase. These options can only be used with PEM format output files.

The input file to read from, or standard input if not specified. If the key is encrypted, a pass phrase will be prompted for.

The input format.

Print the value of the public key component of the key.

Do not output the encoded version of the key.

The output file to write to, or standard output if not specified. If any encryption options are set then a pass phrase will be prompted for.

The output format.

The key password source.

The output file password source.

Read in a public key, not a private key.

Output a public key, not a private key. Automatically set if the input is a public key.

Enable or disable PVK encoding. The default is

Print the public/private key in plain text.

The

command is used to manipulate or generate DSA parameter files.

The options are as follows:

Convert the parameters into C code. The parameters can then be loaded by calling the

function.

Generate a DSA key either using the specified or generated parameters.

The input file to read from, or standard input if not specified. If the

parameter is included, then this option is ignored.

The input format.

Do not output the encoded version of the parameters.

The output file to write to, or standard output if not specified.

The output format.

Print the DSA parameters in plain text.

Generate a parameter set of size

If this option is included, the input file is ignored.

The

command processes EC keys. They can be converted between various forms and their components printed out.

uses the private key format specified in

To convert an EC private key into the PKCS#8 private key format use the

command.

The options are as follows:

Specify how the points on the elliptic curve are converted into octet strings. Possible values are:

(the default), and

For more information regarding the point conversion forms see the X9.62 standard. Note: Due to patent issues the

option is disabled by default for binary curves and can be enabled by defining the preprocessor macro

at compile time.

Encrypt the private key with DES, triple DES, or any other cipher supported by

A pass phrase is prompted for. If none of these options are specified, the key is written in plain text. This means that using the

utility to read in an encrypted key with no encryption option can be used to remove the pass phrase from a key, or by setting the encryption options it can be used to add or change the pass phrase. These options can only be used with PEM format output files.

The input file to read a key from, or standard input if not specified. If the key is encrypted, a pass phrase will be prompted for.

The input format.

Do not output the encoded version of the key.

The output filename to write to, or standard output if not specified. If any encryption options are set then a pass phrase will be prompted for.

The output format.

Specify how the elliptic curve parameters are encoded. Possible value are:

i.e. the EC parameters are specified by an OID; or

where the EC parameters are explicitly given (see RFC 3279 for the definition of the EC parameter structures). The default value is

Note: the

alternative, as specified in RFC 3279, is currently not implemented.

Print the elliptic curve parameters.

The key password source.

The output file password source.

Read in a public key, not a private key.

Output a public key, not a private key. Automatically set if the input is a public key.

Print the public/private key in plain text.

The

command is used to manipulate or generate EC parameter files.

is not able to generate new groups so

can only create EC parameters from known (named) curves.

The options are as follows:

Convert the EC parameters into C code. The parameters can then be loaded by calling the

function.

Validate the elliptic curve parameters.

Specify how the points on the elliptic curve are converted into octet strings. Possible values are:

(the default), and

For more information regarding the point conversion forms see the X9.62 standard. Note: Due to patent issues the

option is disabled by default for binary curves and can be enabled by defining the preprocessor macro

at compile time.

Generate an EC private key using the specified parameters.

The input file to read from, or standard input if not specified.

The input format.

Print a list of all currently implemented EC parameter names and exit.

Use the EC parameters with the specified "short" name.

Do not include the seed for the parameter generation in the ECParameters structure (see RFC 3279).

Do not output the encoded version of the parameters.

The output file to write to, or standard output if not specified.

The output format.

Specify how the elliptic curve parameters are encoded. Possible value are:

i.e. the EC parameters are specified by an OID, or

where the EC parameters are explicitly given (see RFC 3279 for the definition of the EC parameter structures). The default value is

Note: the

alternative, as specified in RFC 3279, is currently not implemented.

Print the EC parameters in plain text.

The symmetric cipher commands allow data to be encrypted or decrypted using various block and stream ciphers using keys based on passwords or explicitly provided. Base64 encoding or decoding can also be performed either by itself or in addition to the encryption or decryption. The program can be called either as

or

Some of the ciphers do not have large keys and others have security implications if not used correctly. All the block ciphers normally use PKCS#5 padding, also known as standard block padding. If padding is disabled, the input data must be a multiple of the cipher block length.

The options are as follows:

If the

option is set, then base64 process the data on one line.

Base64 process the data. This means that if encryption is taking place, the data is base64-encoded after encryption. If decryption is set, the input data is base64-decoded before being decrypted.

Set the buffer size for I/O.

Decrypt the input data.

Debug the BIOs used for I/O.

Encrypt the input data. This is the default.

The input file to read from, or standard input if not specified.

Use the pbkdf2 key derivation function, with

as the number of iterations.

The actual

to use: this must be represented as a string comprised only of hex digits. When only the

is specified using the

option, the IV must explicitly be defined. When a password is being specified using one of the other options, the IV is generated from this password.

The actual

to use: this must be represented as a string comprised only of hex digits. If only the key is specified, the IV must also be specified using the

option. When both a

and a

are specified, the

given with the

option will be used and the IV generated from the password will be taken. It probably does not make much sense to specify both

and

The

to derive the key from. Superseded by the

option.

Read the password to derive the key from the first line of

Superseded by the

option.

Use

to create a key from a pass phrase. Currently, the default value is

Use NULL cipher (no encryption or decryption of input).

Disable standard block padding.

Don't use a salt in the key derivation routines. This option should never be used since it makes it possible to perform efficient dictionary attacks on the password and to attack stream cipher encrypted data.

The output file to write to, or standard output if not specified.

Print out the salt, key, and IV used, then immediately exit; don't do any encryption or decryption.

Print out the salt, key, and IV used.

The password source.

Use the pbkdf2 key derivation function, with the default of 10000 iterations.

The actual

to use: this must be represented as a string comprised only of hex digits.

Use a salt in the key derivation routines (the default). When the salt is being used, the first eight bytes of the encrypted data are reserved for the salt: it is randomly generated when encrypting a file and read from the encrypted file when it is decrypted.

Print extra details about the processing.

The

command performs error number to error string conversion, generating a human-readable string representing the error code

The string is obtained through the

function and has the following format:

is an 8-digit hexadecimal number. The remaining fields

and

are all ASCII text.

The

command generates a DSA private key from a DSA parameter file (typically generated by the

command). DSA key generation is little more than random number generation so it is much quicker than, for example, RSA key generation.

The options are as follows:

Encrypt the private key with the AES, CAMELLIA, DES, triple DES or the IDEA ciphers, respectively, before outputting it. A pass phrase is prompted for. If none of these options are specified, no encryption is used.

The output file to write to, or standard output if not specified.

The output file password source.

Specify the DSA parameter file to use. The parameters in this file determine the size of the private key.

The

command generates private keys. The use of this program is encouraged over the algorithm specific utilities because additional algorithm options can be used.

The options are as follows:

The public key algorithm to use, such as RSA, DSA, or DH. This option must precede any

options. The options

and

are mutually exclusive.

Encrypt the private key with the supplied cipher. Any algorithm name accepted by

is acceptable.

Generate a set of parameters instead of a private key. This option must precede any

or

options.

The output file to write to, or standard output if not specified.

The output format.

Some public key algorithms generate a private key based on a set of parameters, which can be supplied using this option. If this option is used, the public key algorithm used is determined by the parameters. This option must precede any

options. The options

and

are mutually exclusive.

The output file password source.

Set the public key algorithm option

to

as follows:

(RSA) The number of bits in the generated key. The default is 2048.

(RSA) The RSA public exponent value. This can be a large decimal or hexadecimal value if preceded by 0x. The default is 65537.

(DSA) The number of bits in the generated parameters. The default is 1024.

(DH) The number of bits in the prime parameter

(DH) The value to use for the generator

(EC) The elliptic curve to use.

Print the private/public key in plain text.

The

command generates an RSA private key, which essentially involves the generation of two prime numbers. When generating the key, various symbols will be output to indicate the progress of the generation. A

represents each number which has passed an initial sieve test;

means a number has passed a single round of the Miller-Rabin primality test;

means the number has failed primality testing and needs to be generated afresh. A newline means that the number has passed all the prime tests (the actual number depends on the key size).

The options are as follows:

The public exponent to use, either 3 or 65537. The default is 65537.

Encrypt the private key with the AES, CAMELLIA, DES, triple DES or the IDEA ciphers, respectively, before outputting it. If none of these options are specified, no encryption is used. If encryption is used, a pass phrase is prompted for, if it is not supplied via the

option.

The output file to write to, or standard output if not specified.

The output file password source.

The size of the private key to generate in bits. This must be the last option specified. The default is 2048.

The Online Certificate Status Protocol (OCSP) enables applications to determine the (revocation) state of an identified certificate (RFC 2560).

The

command performs many common OCSP tasks. It can be used to print out requests and responses, create requests and send queries to an OCSP responder, and behave like a mini OCSP server itself.

The options are as follows:

A file or path containing trusted CA certificates, used to verify the signature on the OCSP response.

Add the certificate

to the request. The issuer certificate is taken from the previous

option, or an error occurs if no issuer certificate is specified.

Use the digest algorithm

for certificate identification in the OCSP request. By default SHA1 is used.

Send the OCSP request to

on

specifies the HTTP path name to use, or

by default.

Add the header name with the specified value to the OCSP request that is sent to the responder. This may be repeated.

The current issuer certificate, in PEM format. Can be used multiple times and must come before any

options.

Don't perform any additional checks on the OCSP response signer's certificate. That is, do not make any checks to see if the signer's certificate is authorised to provide the necessary status information: as a result this option should only be used for testing purposes.

Don't verify the OCSP response signer's certificate at all. Since this option allows the OCSP response to be signed by any certificate, it should only be used for testing purposes.

Don't include any certificates in the signed request.

Do not use certificates in the response as additional untrusted CA certificates.

Don't check the explicit trust for OCSP signing in the root CA certificate.

Ignore certificates contained in the OCSP response when searching for the signer's certificate. The signer's certificate must be specified with either the

or

options.

Don't check the signature on the OCSP response. Since this option tolerates invalid signatures on OCSP responses, it will normally only be used for testing purposes.

Add an OCSP nonce extension to a request, or disable an OCSP nonce addition. Normally, if an OCSP request is input using the

option no nonce is added: using the

option will force the addition of a nonce. If an OCSP request is being created (using the

and

options), a nonce is automatically added; specifying

overrides this.

Don't attempt to verify the OCSP response signature or the nonce values. This is normally only be used for debugging since it disables all verification of the responder's certificate.

Specify the output file to write to, or standard output if not specified.

Print out the text form of the OCSP request, response, or both, respectively.

Read an OCSP request or response file from

These options are ignored if an OCSP request or response creation is implied by other options (for example with the

and

options).

Write out the DER-encoded certificate request or response to

Same as the

option except the certificate with serial number

is added to the request. The serial number is interpreted as a decimal integer unless preceded by

Negative integers can also be specified by preceding the value with a minus sign.

Additional certificates to include in the signed request.

Sign the OCSP request using the certificate specified in the

option and the private key specified by the

option. If the

option is not present, then the private key is read from the same file as the certificate. If neither option is specified, the OCSP request is not signed.

Connection timeout to the OCSP responder in seconds.

The certificates specified by the

option should be explicitly trusted and no additional checks will be performed on them. This is useful when the complete responder certificate chain is not available or trusting a root CA is not appropriate.

Specify the responder URL. Both HTTP and HTTPS

URLs can be specified.

A file containing explicitly trusted responder certificates. Equivalent to the

and

options.

The range of times, in seconds, which will be tolerated in an OCSP response. Each certificate status response includes a notBefore time and an optional notAfter time. The current time should fall between these two values, but the interval between the two times may be only a few seconds. In practice the OCSP responder and clients' clocks may not be precisely synchronised and so such a check may fail. To avoid this the

option can be used to specify an acceptable error range in seconds, the default value being 5 minutes.

If the notAfter time is omitted from a response, it means that new status information is immediately available. In this case the age of the notBefore field is checked to see it is not older than

seconds old. By default, this additional check is not performed.

A file containing additional certificates to search when attempting to locate the OCSP response signing certificate. Some responders omit the actual signer's certificate from the response, so this can be used to supply the necessary certificate.

The options for the OCSP server are as follows:

CA certificate corresponding to the revocation information in

Ignore the invalid response.

is a text index file in ca format containing certificate revocation information.

If this option is specified,

is in responder mode, otherwise it is in client mode. The requests the responder processes can be either specified on the command line (using the

and

options), supplied in a file (using the

option), or via external OCSP clients (if

or

is specified).

If this option is present, then the

and

options must also be present.

Number of

or

when fresh revocation information is available: used in the nextUpdate field. If neither option is present, the nextUpdate field is omitted, meaning fresh revocation information is immediately available.

Exit after receiving

requests (the default is unlimited).

Port to listen for OCSP requests on. May also be specified using the

option.

Identify the signer certificate using the key ID; the default is to use the subject name.

Don't include any certificates in the OCSP response.

The private key to sign OCSP responses with; if not present, the file specified in the

option is used.

Additional certificates to include in the OCSP response.

The certificate to sign OCSP responses with.

Initially the OCSP responder certificate is located and the signature on the OCSP request checked using the responder certificate's public key. Then a normal certificate verify is performed on the OCSP responder certificate building up a certificate chain in the process. The locations of the trusted certificates used to build the chain can be specified by the

and

options or they will be looked for in the standard

certificates directory.

If the initial verify fails, the OCSP verify process halts with an error. Otherwise the issuing CA certificate in the request is compared to the OCSP responder certificate: if there is a match then the OCSP verify succeeds.

Otherwise the OCSP responder certificate's CA is checked against the issuing CA certificate in the request. If there is a match and the OCSPSigning extended key usage is present in the OCSP responder certificate, then the OCSP verify succeeds.

Otherwise the root CA of the OCSP responder's CA is checked to see if it is trusted for OCSP signing. If it is, the OCSP verify succeeds.

If none of these checks is successful, the OCSP verify fails. What this effectively means is that if the OCSP responder certificate is authorised directly by the CA it is issuing revocation information about (and it is correctly configured), then verification will succeed.

If the OCSP responder is a global responder, which can give details about multiple CAs and has its own separate certificate chain, then its root CA can be trusted for OCSP signing. Alternatively, the responder certificate itself can be explicitly trusted with the

option.

The

command computes the hash of a password.

The options are as follows:

Use the MD5 based

password algorithm

Use the

algorithm

Apache variant of the

algorithm

Use the

algorithm (the default).

Read passwords from

Don't verify when reading a password from the terminal.

Don't output warnings when passwords given on the command line are truncated.

Switch table columns. This only makes sense in conjunction with the

option.

Use the salt specified by

When reading a password from the terminal, this implies

Read passwords from standard input.

In the output list, prepend the cleartext password and a TAB character to each password hash.

The

command processes PKCS#7 files in DER or PEM format. The PKCS#7 routines only understand PKCS#7 v 1.5 as specified in RFC 2315.

The options are as follows:

The input file to read from, or standard input if not specified.

The input format.

Don't output the encoded version of the PKCS#7 structure (or certificates if

is set).

The output to write to, or standard output if not specified.

The output format.

Print the ASN.1 representation of PKCS#7 structure.

Print any certificates or CRLs contained in the file, preceded by their subject and issuer names in a one-line format.

Print certificate details in full rather than just subject and issuer names.

The

command processes private keys (both encrypted and unencrypted) in PKCS#8 format with a variety of PKCS#5 (v1.5 and v2.0) and PKCS#12 algorithms. The default encryption is only 56 bits; keys encrypted using PKCS#5 v2.0 algorithms and high iteration counts are more secure.

The options are as follows:

The input file to read from, or standard input if not specified. If the key is encrypted, a pass phrase will be prompted for.

The input format.

Generate an unencrypted PrivateKeyInfo structure. This option does not encrypt private keys at all and should only be used when absolutely necessary.

Use an iteration count of 1. See the

section below for a detailed explanation of this option.

The output file to write to, or standard output if none is specified. If any encryption options are set, a pass phrase will be prompted for.

The output format.

The key password source.

The output file password source.

Read a traditional format private key and write a PKCS#8 format key.

Specify a PKCS#5 v1.5 or PKCS#12 algorithm to use.

56-bit DES.

64-bit RC2 or 56-bit DES.

PKCS#12 password-based encryption algorithm, which allow strong encryption algorithms like triple DES or 128-bit RC2.

Use PKCS#5 v2.0 algorithms. Supports algorithms such as 168-bit triple DES or 128-bit RC2, however not many implementations support PKCS#5 v2.0 yet (if using private keys with

this doesn't matter).

is the encryption algorithm to use; valid values include des, des3, and rc2. It is recommended that des3 is used.

The

command allows PKCS#12 files

to be created and parsed. By default, a PKCS#12 file is parsed; a PKCS#12 file can be created by using the

option.

The options for parsing a PKCS12 file are as follows:

Encrypt private keys using AES, CAMELLIA, DES, triple DES or the IDEA ciphers, respectively. The default is triple DES.

Only output CA certificates

Only output client certificates

The input file to read from, or standard input if not specified.

Output additional information about the PKCS#12 file structure, algorithms used, and iteration counts.

Do not output certificates.

Do not encrypt private keys.

Do not output private keys.

Do not attempt to verify the integrity MAC before reading the file.

Do not output the keys and certificates to the output file version of the PKCS#12 file.

The output file to write to, or standard output if not specified.

The key password source.

The output file password source.

Prompt for separate integrity and encryption passwords: most software always assumes these are the same so this option will render such PKCS#12 files unreadable.

The options for PKCS12 file creation are as follows:

CA storage as a file.

CA storage as a directory. The directory must be a standard certificate directory: that is, a hash of each subject name (using

should be linked to each certificate.

Specify the

for other certificates. May be used multiple times to specify names for all certificates in the order they appear.

A file to read additional certificates from.

Specify the algorithm used to encrypt the private key and certificates to be selected. Any PKCS#5 v1.5 or PKCS#12 PBE algorithm name can be used. If a cipher name (as output by the

command) is specified then it is used with PKCS#5 v2.0. For interoperability reasons it is advisable to only use PKCS#12 algorithms.

Include the entire certificate chain of the user certificate. The standard CA store is used for this search. If the search fails, it is considered a fatal error.

Encrypt the certificate using triple DES; this may render the PKCS#12 file unreadable by some

software. By default, the private key is encrypted using triple DES and the certificate using 40-bit RC2.

Create a PKCS#12 file (rather than parsing one).

The input file to read from, or standard input if not specified. The order doesn't matter but one private key and its corresponding certificate should be present. If additional certificates are present, they will also be included in the PKCS#12 file.

File to read a private key from. If not present, a private key must be present in the input file.

Specify whether the private key is to be used for key exchange or just signing. Normally,

software will only allow 512-bit RSA keys to be used for encryption purposes, but arbitrary length keys for signing. The

option marks the key for signing only. Signing only keys can be used for S/MIME signing, authenticode (ActiveX control signing) and SSL client authentication.

Specify the MAC digest algorithm. The default is SHA1.

Included for compatibility only: it used to be needed to use MAC iterations counts but they are now used by default.

Specify the

for the certificate and private key. This name is typically displayed in list boxes by software importing the file.

Don't attempt to provide the MAC integrity.

Affect the iteration counts on the MAC and key algorithms.

To discourage attacks by using large dictionaries of common passwords, the algorithm that derives keys from passwords can have an iteration count applied to it: this causes a certain part of the algorithm to be repeated and slows it down. The MAC is used to check the file integrity but since it will normally have the same password as the keys and certificates it could also be attacked. By default, both MAC and encryption iteration counts are set to 2048; using these options the MAC and encryption iteration counts can be set to 1. Since this reduces the file security, you should not use these options unless you really have to. Most software supports both MAC and key iteration counts.

The output file to write to, or standard output if not specified.

The key password source.

The output file password source.

With

is equivalent to

Otherwise,

is equivalent to

The

command processes public or private keys. They can be converted between various forms and their components printed out.

The options are as follows:

Encrypt the private key with the specified cipher. Any algorithm name accepted by

is acceptable, such as

The input file to read from, or standard input if not specified. If the key is encrypted, a pass phrase will be prompted for.

The input format.

Do not output the encoded version of the key.

The output file to write to, or standard output if not specified. If any encryption options are set then a pass phrase will be prompted for.

The output format.

The key password source.

The output file password source.

Read in a public key, not a private key.

Output a public key, not a private key. Automatically set if the input is a public key.

Print the public/private key in plain text.

Print out only public key components even if a private key is being processed.

The

command processes public or private keys. The key type is determined by the PEM headers.

The options are as follows:

The input file to read from, or standard input if not specified.

Do not output the encoded version of the parameters.

The output file to write to, or standard output if not specified.

Print the parameters in plain text.

The

command can be used to perform public key operations using any supported algorithm.

The options are as follows:

ASN.1 parse the output data. This is useful when combined with the

option when an ASN.1 structure is signed.

The input is a certificate containing a public key.

Decrypt the input data using a private key.

Derive a shared secret using the peer key.

Encrypt the input data using a public key.

Hex dump the output data.

The input file to read from, or standard input if not specified.

The input key file. By default it should be a private key.

The key format.

The output file to write to, or standard output if not specified.

The key password source.

The peer key format.

The peer key file, used by key derivation (agreement) operations.

Set the public key algorithm option

to

Unless otherwise mentioned, all algorithms support the format

which specifies the digest to use for sign, verify, and verifyrecover operations. The value

should represent a digest name as used in the

function.

The RSA algorithm supports the encrypt, decrypt, sign, verify, and verifyrecover operations in general. Some padding modes only support some of these operations however.

This sets the RSA padding mode. Acceptable values for

are

for PKCS#1 padding;

for no padding;

for OAEP mode;

for X9.31 mode; and

for PSS.

In PKCS#1 padding if the message digest is not set then the supplied data is signed or verified directly instead of using a DigestInfo structure. If a digest is set then a DigestInfo structure is used and its length must correspond to the digest type. For oeap mode only encryption and decryption is supported. For x931 if the digest type is set it is used to format the block data; otherwise the first byte is used to specify the X9.31 digest ID. Sign, verify, and verifyrecover can be performed in this mode. For pss mode only sign and verify are supported and the digest type must be specified.

For pss mode only this option specifies the salt length. Two special values are supported: -1 sets the salt length to the digest length. When signing, -2 sets the salt length to the maximum permissible value. When verifying, -2 causes the salt length to be automatically determined based on the PSS block structure.

The DSA algorithm supports the sign and verify operations. Currently there are no additional options other than

Only the SHA1 digest can be used and this digest is assumed by default.

The DH algorithm supports the derive operation and no additional options.

The EC algorithm supports the sign, verify, and derive operations. The sign and verify operations use ECDSA and derive uses ECDH. Currently there are no additional options other than

Only the SHA1 digest can be used and this digest is assumed by default.

The input file is a public key.

Reverse the order of the input buffer.

Signature file (verify operation only).

Sign the input data and output the signed result. This requires a private key.

Verify the input data against the signature file and indicate if the verification succeeded or failed.

Verify the input data and output the recovered data.

The

command is used to generate prime numbers, or to check numbers for primality. Results are probabilistic: they have an exceedingly high likelihood of being correct, but are not guaranteed.

The options are as follows:

Specify the number of bits in the generated prime number. Must be used in conjunction with

Perform a Miller-Rabin probabilistic primality test with

iterations. The default is 20.

Generate a pseudo-random prime number. Must be used in conjunction with

Output in hex format.

Generate only

prime numbers (i.e. a prime p so that (p-1)/2 is also prime).

Test if number

is prime.

The

command outputs

pseudo-random bytes.

The options are as follows:

Perform base64 encoding on the output.

Specify hexadecimal output.

The output file to write to, or standard output if not specified.

The

command primarily creates and processes certificate requests in PKCS#10 format. It can additionally create self-signed certificates, for use as root CAs, for example.

The options are as follows:

Add a specific extension to the certificate (if the

option is present) or certificate request. The argument must have the form of a key=value pair as it would appear in a config file. This option can be given multiple times.

Non-interactive mode.

Specify an alternative configuration file.

Specify the number of days to certify the certificate for. The default is 30 days. Used with the

option.

Specify alternative sections to include certificate extensions (with

or certificate request extensions, allowing several different sections to be used in the same configuration file.

The input file to read a request from, or standard input if not specified. A request is only read if the creation options

and

are not specified.

The input format.

The file to read the private key from. It also accepts PKCS#8 format private keys for PEM format files.

The format of the private key file specified in the

argument. The default is

The file to write the newly created private key to. If this option is not specified, the filename present in the configuration file is used.

The message digest to sign the request with. This overrides the digest algorithm specified in the configuration file.

Some public key algorithms may override this choice. For instance, DSA signatures always use SHA1.

Print the value of the modulus of the public key contained in the request.

This option causes the

argument to be interpreted with full support for multivalued RDNs, for example

If

is not used, the UID value is set to

Determine how the subject or issuer names are displayed.

can be a single option or multiple options separated by commas. Alternatively, these options may be used more than once to set multiple options. See the

section below for details.

Generate a new certificate request. The user is prompted for the relevant field values. The actual fields prompted for and their maximum and minimum sizes are specified in the configuration file and any requested extensions.

If the

option is not used, it will generate a new RSA private key using information specified in the configuration file.

Add the word NEW to the PEM file header and footer lines on the outputted request. Some software and CAs need this.

Create a new certificate request and a new private key. The argument takes one of several forms.

generates an RSA key

in size. If

is omitted, the default key size is used.

generates a DSA key using the parameters in

generates a key using the parameters or certificate in

All other algorithms support the form

where file may be an algorithm parameter file, created by the

command or an X.509 certificate for a key with appropriate algorithm.

can be omitted, in which case any parameters can be specified via the

option.

Do not encrypt the private key.

Do not output the encoded version of the request.

The output file to write to, or standard output if not specified.

The output format.

The key password source.

The output file password source.

Set the public key algorithm option

to

Output the public key.

Customise the output format used with

The

argument can be a single option or multiple options separated by commas. See also the discussion of

in the

command.

Serial number to use when outputting a self-signed certificate. This may be specified as a decimal value or a hex value if preceded by

It is possible to use negative serial numbers but this is not recommended.

Pass options to the signature algorithm during sign operation. The names and values of these options are algorithm-specific.

Replaces the subject field of an input request with the specified data and output the modified request.

must be formatted as /type0=value0/type1=value1/type2=…; characters may be escaped by

(backslash); no spaces are skipped.

Print the request subject (or certificate subject if

is specified).

Print the certificate request in plain text.

Interpret field values as UTF8 strings, not ASCII.

Print extra details about the operations being performed.

Verify the signature on the request.

Output a self-signed certificate instead of a certificate request. This is typically used to generate a test certificate or a self-signed root CA. The extensions added to the certificate (if any) are specified in the configuration file. Unless specified using the

option, 0 is used for the serial number.

The configuration options are specified in the

section of the configuration file. The options available are as follows:

The section containing any request attributes: its format is the same as

Typically these may contain the challengePassword or unstructuredName types. They are currently ignored by the

request signing utilities, but some CAs might want them.

The default key size, in bits. The default is 2048. It is used if the

option is used and can be overridden by using the

option.

The default file to write a private key to, or standard output if not specified. It can be overridden by the

option.

The digest algorithm to use. Possible values include

and

(the default). It can be overridden on the command line.

The section containing the distinguished name fields to prompt for when generating a certificate or certificate request. The format is described below.

If set to

and a private key is generated, it is not encrypted. It is equivalent to the

option. For compatibility,

is an equivalent option.

The passwords for the input private key file (if present) and the output private key file (if one will be created). The command line options

and

override the configuration file values.

A file containing additional OBJECT IDENTIFIERS. Each line of the file should consist of the numerical form of the object identifier, followed by whitespace, then the short name followed by whitespace and finally the long name.

Specify a section in the configuration file containing extra object identifiers. Each line should consist of the short name of the object identifier followed by

and the numerical form. The short and long names are the same when this option is used.

If set to

it disables prompting of certificate fields and just takes values from the config file directly. It also changes the expected format of the

and

sections.

The configuration file section containing a list of extensions to add to the certificate request. It can be overridden by the

option.

Limit the string types for encoding certain fields. The following values may be used, limiting strings to the indicated types:

UTF8String. This is the default, as recommended by PKIX in RFC 2459.

PrintableString, IA5String, T61String, BMPString, UTF8String.

PrintableString, IA5String, BMPString, UTF8String. Inspired by the PKIX recommendation in RFC 2459 for certificates generated before 2004, but differs by also permitting IA5String.

PrintableString, IA5String, T61String, UniversalString. A workaround for some ancient software that had problems with the variable-sized BMPString and UTF8String types.

An explicit bitmask of permitted types, where

is a C-style hex, decimal, or octal number that's a bit-wise OR of

values from

If set to

field values are interpreted as UTF8 strings.

The configuration file section containing a list of extensions to add to a certificate generated when the

switch is used. It can be overridden by the

command line switch.

There are two separate formats for the distinguished name and attribute sections. If the

option is set to

then these sections just consist of field names and values. If the

option is absent or not set to

then the file contains field prompting information of the form:

fieldName="prompt" fieldName_default="default field value" fieldName_min= 2 fieldName_max= 4

is the field name being used, for example

(or CN). The

string is used to ask the user to enter the relevant details. If the user enters nothing, the default value is used; if no default value is present, the field is omitted. A field can still be omitted if a default value is present, if the user just enters the

character.

The number of characters entered must be between the fieldName_min and fieldName_max limits: there may be additional restrictions based on the field being used (for example

can only ever be two characters long and must fit in a

Some fields (such as

can be used more than once in a DN. This presents a problem because configuration files will not recognize the same name occurring twice. To avoid this problem, if the

contains some characters followed by a full stop, they will be ignored. So, for example, a second

can be input by calling it

The actual permitted field names are any object identifier short or long names. These are compiled into

and include the usual values such as

Additionally,

is included as well as

and

Additional object identifiers can be defined with the

or

options in the configuration file. Any additional fields will be treated as though they were a

The

command processes RSA keys. They can be converted between various forms and their components printed out.

uses the traditional

compatible format for private key encryption: newer applications should use the more secure PKCS#8 format using the

utility.

The options are as follows:

Encrypt the private key with the AES, DES, or the triple DES ciphers, respectively, before outputting it. A pass phrase is prompted for. If none of these options are specified, the key is written in plain text. This means that using the

utility to read in an encrypted key with no encryption option can be used to remove the pass phrase from a key, or by setting the encryption options it can be used to add or change the pass phrase. These options can only be used with PEM format output files.

Check the consistency of an RSA private key.

The input file to read from, or standard input if not specified. If the key is encrypted, a pass phrase will be prompted for.

The input format.

Do not output the encoded version of the key.

Print the value of the modulus of the key.

The output file to write to, or standard output if not specified.

The output format.

The key password source.

The output file password source.

Read in a public key, not a private key.

Output a public key, not a private key. Automatically set if the input is a public key.

Enable or disable PVK encoding. The default is

Same as

and

except

format is used instead.

Print the public/private key components in plain text.

The

command can be used to sign, verify, encrypt and decrypt data using the RSA algorithm.

The options are as follows:

Asn1parse the output data; this is useful when combined with the

option.

The input is a certificate containing an RSA public key.

Decrypt the input data using an RSA private key.

Encrypt the input data using an RSA public key.

Hex dump the output data.

The input to read from, or standard input if not specified.

The input key file; by default an RSA private key.

The private key format. The default is

The padding to use: PKCS#1 OAEP, PKCS#1 v1.5 (the default), no padding, or ANSI X9.31, respectively. For signatures, only

and

can be used.

The output file to write to, or standard output if not specified.

The key password source.

The input file is an RSA public key.

Reverse the order of the input buffer.

Sign the input data and output the signed result. This requires an RSA private key.

Verify the input data and output the recovered data.

The

command implements a generic SSL/TLS client which connects to a remote host using SSL/TLS.

If a connection is established with an SSL server, any data received from the server is displayed and any key presses will be sent to the server. When used interactively (which means neither

nor

have been given), the session will be renegotiated if the line begins with an

if the line begins with a

or if end of file is reached, the connection will be closed down.

The options are as follows:

Attempt connections using IPv4 only.

Attempt connections using IPv6 only.

Enable the Application-Layer Protocol Negotiation.

is a comma-separated list of protocol names that the client should advertise support for.

Enable various workarounds for buggy implementations.

A

containing trusted certificates to use during server authentication and to use when attempting to build the client certificate chain.

The

to use for server certificate verification. This directory must be in

see

for more information. These are also used when building the client certificate chain.

The certificate to use, if one is requested by the server. The default is not to use a certificate.

The certificate format. The default is

Set various certificate chain validation options. See the

command for details.

Modify the cipher list sent by the client. Although the server determines which cipher suite is used, it should take the first supported cipher in the list sent by the client. See the

command for more information.

The

and

to connect to. If not specified, an attempt is made to connect to the local host on port 4433. Alternatively, the host and port pair may be separated using a forward-slash character, which is useful for numeric IPv6 addresses.

Translate a line feed from the terminal into CR+LF, as required by some servers.

Print extensive debugging information, including a hex dump of all traffic.

Permit any version of DTLS.

Permit only DTLS1.2.

Set the supported elliptic curve groups to the colon separated

of group NIDs or names as documented in

The

to connect to. The default is localhost.

Inhibit shutting down the connection when end of file is reached in the input.

The private key to use. If not specified, the certificate file will be used.

The private key format. The default is

Export keying material using label.

Export len bytes of keying material (default 20).

Allow or disallow initial connection to servers that don't support RI.

Show all protocol messages with hex dump.

Set the link layer MTU.

Turn on non-blocking I/O.

Test non-blocking I/O.

Shut down the connection when end of file is reached in the input. Can be used to override the implicit

after

Disable the use of TLS1.2 and 1.3, respectively.

Disable RFC 4507 session ticket support.

The private key password source.

The

to connect to. The default is 4433.

Print session information when the program exits. This will always attempt to print out information even if the connection fails. Normally, information will only be printed out once if the connection succeeds. This option is useful because the cipher in use may be renegotiated or the connection may fail because a client certificate is required or is requested only after an attempt is made to access a certain URL. Note that the output produced by this option is not always accurate because a connection might never have been established.

Use the HTTP proxy at

and

The connection to the proxy is done in cleartext and the

argument is given to the proxy. If not specified, localhost is used as final destination. After that, switch the connection through the proxy to the destination to TLS.

Inhibit printing of session and certificate information. This implicitly turns on

as well.

Reconnect to the same server 5 times using the same session ID; this can be used as a test that session caching is working.

Include the TLS Server Name Indication (SNI) extension in the ClientHello message, using the specified server

Display the whole server certificate chain: normally only the server certificate itself is displayed.

Use the server's cipher preferences.

Load TLS session from file. The client will attempt to resume a connection from this session.

Output TLS session to file.

Send the protocol-specific messages to switch to TLS for communication.

is a keyword for the intended protocol. Currently, the supported keywords are

and

Print the SSL session states.

Send a certificate status request to the server (OCSP stapling). The server response (if any) is printed out.

Enable send/receive timeout on DTLS connections.

Permit only TLS1.2 or 1.3 respectively.

Print a hex dump of any TLS extensions received from the server.

Offer SRTP key management with a colon-separated profile list.

Turn on server certificate verification, with a maximum length of

Currently the verify operation continues after errors so all the problems with a certificate chain can be seen. As a side effect the connection will never fail due to a server certificate verify failure.

Return verification error.

When used with

specify the host for the "to" attribute of the stream element. If this option is not specified then the host specified with

will be used.

The

command implements a generic SSL/TLS server which listens for connections on a given port using SSL/TLS.

If a connection request is established with a client and neither the

nor the

option has been used, then any data received from the client is displayed and any key presses are sent to the client. Certain single letter commands perform special operations:

Send plain text, which should cause the client to disconnect.

End the current SSL connection and exit.

End the current SSL connection, but still accept new connections.

Renegotiate the SSL session and request a client certificate.

Renegotiate the SSL session.

Print out some session cache status information.

The options are as follows:

Listen on TCP

for connections. The default is port 4433.

Enable the Application-Layer Protocol Negotiation.

is a comma-separated list of supported protocol names.

Enable various workarounds for buggy implementations.

A

containing trusted certificates to use during client authentication and to use when attempting to build the server certificate chain. The list is also used in the list of acceptable client CAs passed to the client when a certificate is requested.

The

to use for client certificate verification. This directory must be in

see

for more information. These are also used when building the server certificate chain.

The certificate to use: most server's cipher suites require the use of a certificate and some require a certificate with a certain public key type. For example, the DSS cipher suites require a certificate containing a DSS (DSA) key. If not specified, the file

will be used.

The certificate to use for servername.

The certificate format. The default is

Modify the cipher list used by the server. This allows the cipher list used by the server to be modified. When the client sends a list of supported ciphers, the first client cipher also included in the server list is used. Because the client specifies the preference order, the order of the server cipherlist is irrelevant. See the

command for more information.

Set the SSL context ID. It can be given any string value.

Check the peer certificate has not been revoked by its CA. The CRLs are appended to the certificate file.

checks all CRLs of all CAs in the chain.

Translate a line feed from the terminal into CR+LF.

Specify an additional certificate and private key; these behave in the same manner as the

and

options except there is no default if they are not specified (no additional certificate or key is used). By using RSA and DSS certificates and keys, a server can support clients which only support RSA or DSS cipher suites by using an appropriate certificate.

Additional certificate and private key format, and private key password source, respectively.

Print extensive debugging information, including a hex dump of all traffic.

The DH parameter file to use. The ephemeral DH cipher suites generate keys using a set of DH parameters. If not specified, an attempt is made to load the parameters from the server certificate file. If this fails, a static set of parameters hard coded into the

program will be used.

Permit any version of DTLS.

Permit only DTLS1.2.

Set the supported elliptic curve groups to the colon separated

of group NIDs or names as documented in

Emulate a simple web server. Pages are resolved relative to the current directory. For example if the URL

is requested, the file

will be loaded. The files loaded are assumed to contain a complete and correct HTTP response (lines that are part of the HTTP response line and headers must end with CRLF).

Generate SSL/TLS session IDs prefixed by

This is mostly useful for testing any SSL/TLS code that wish to deal with multiple servers, when each of which might be generating a unique range of session IDs.

The private key to use. If not specified, the certificate file will be used.

The private key to use for servername.

The private key format. The default is

Export keying material using label.

Export len bytes of keying material (default 20).

Show all protocol messages with hex dump.

Set the link layer MTU.

Terminate server after

connections.

Specify the elliptic curve name to use for ephemeral ECDH keys. This option is deprecated; use

instead.

Turn on non-blocking I/O.

Test non-blocking I/O.

Disable session caching.

Disable ephemeral DH cipher suites.

Disable ephemeral ECDH cipher suites.

Disable RFC 4507 session ticket support.

Disable the use of TLS1.2 and 1.3, respectively.

Disable temporary RSA key generation.

Do not use a certificate. This restricts the cipher suites available to the anonymous ones (currently just anonymous DH).

The private key password source.

Inhibit printing of session and certificate information.

Set the TLS Server Name Indication (SNI) extension with

Send fatal alert if servername does not match. The default is warning alert.

Use server's cipher preferences.

Print the SSL session states.

Enables certificate status request support (OCSP stapling).

Sets the timeout for OCSP response in seconds.

Sets a fallback responder URL to use if no responder URL is present in the server certificate. Without this option, an error is returned if the server certificate does not contain a responder address.

Enables certificate status request support (OCSP stapling) and gives a verbose printout of the OCSP response.

Enable send/receive timeout on DTLS connections.

Permit only TLS1.2, or 1.3, respectively.

Print a hex dump of any TLS extensions received from the server.

Offer SRTP key management with a colon-separated profile list.

Return verification error.

Emulate a simple web server. Pages are resolved relative to the current directory. For example if the URL

is requested, the file

will be loaded.

Send a status message to the client when it connects, including information about the ciphers used and various session parameters. The output is in HTML format so this option will normally be used with a web browser.

Request a certificate chain from the client, with a maximum length of

With

the client must supply a certificate or an error occurs; with

a certificate is requested but the client does not have to send one.

The

command implements a generic SSL/TLS client which connects to a remote host using SSL/TLS. It can request a page from the server and includes the time to transfer the payload data in its timing measurements. It measures the number of connections within a given timeframe, the amount of data transferred

and calculates the average time spent for one connection.

The options are as follows:

Enable various workarounds for buggy implementations.

A

containing trusted certificates to use during server authentication and to use when attempting to build the client certificate chain.

The directory to use for server certificate verification. This directory must be in

see

for more information. These are also used when building the client certificate chain.

The certificate to use, if one is requested by the server. The default is not to use a certificate.

Modify the cipher list sent by the client. Although the server determines which cipher suite is used, it should take the first supported cipher in the list sent by the client. See the

command for more information.

The host and port to connect to.

The private key to use. If not specified, the certificate file will be used.

Turn on non-blocking I/O.

Perform the timing test using a new session ID for each connection. If neither

nor

are specified, they are both on by default and executed in sequence.

Shut down the connection without sending a

shutdown alert to the server.

Perform the timing test using the same session ID for each connection. If neither

nor

are specified, they are both on by default and executed in sequence.

Limit

benchmarks to the number of

The default is 30 seconds.

Turn on server certificate verification, with a maximum length of

Currently the verify operation continues after errors, so all the problems with a certificate chain can be seen. As a side effect, the connection will never fail due to a server certificate verify failure.

The page to GET from the server. A value of

gets the index.htm[l] page. If this parameter is not specified,

will only perform the handshake to establish SSL connections but not transfer any payload data.

The

program processes the encoded version of the SSL session structure and optionally prints out SSL session details (for example the SSL session master key) in human-readable format.

The options are as follows:

If a certificate is present in the session, it will be output using this option; if the

option is also present, then it will be printed out in text form.

Set the session

The ID can be any string of characters.

The input file to read from, or standard input if not specified.

The input format.

uses an ASN.1 DER-encoded format containing session details. The precise format can vary from one version to the next.

is the default format: it consists of the DER format base64-encoded with additional header and footer lines.

Do not output the encoded version of the session.

The output file to write to, or standard output if not specified.

The output format.

Print the various public or private key components in plain text, in addition to the encoded version.

The output of

is composed as follows:

The protocol in use.

The actual raw SSL or TLS cipher code.

The SSL session ID, in hex format.

The session ID context, in hex format.

The SSL session master key.

The key argument; this is only used in SSL v2.

The session start time.

format.

The timeout, in seconds.

The return code when a certificate is verified.

Since the SSL session output contains the master key, it is possible to read the contents of an encrypted session using this information. Therefore appropriate security precautions should be taken if the information is being output by a

application. This is, however, strongly discouraged and should only be used for debugging purposes.

The

command handles S/MIME mail. It can encrypt, decrypt, sign, and verify S/MIME messages.

The MIME message must be sent without any blank lines between the headers and the output. Some mail programs will automatically add a blank line. Piping the mail directly to an MTA is one way to achieve the correct format.

The supplied message to be signed or encrypted must include the necessary MIME headers or many S/MIME clients won't display it properly (if at all). Use the

option to automatically add plain text headers.

A

message is one where a signed message is then encrypted. This can be produced by encrypting an already signed message.

There are a number of operations that can be performed, as follows:

Decrypt mail using the supplied certificate and private key. The input file is an encrypted mail message in MIME format. The decrypted mail is written to the output file.

Encrypt mail for the given recipient certificates. The input is the message to be encrypted. The output file is the encrypted mail, in MIME format.

Take an input message and write out a PEM-encoded PKCS#7 structure.

Resign a message: take an existing message and one or more new signers.

Sign mail using the supplied certificate and private key. The input file is the message to be signed. The signed message, in MIME format, is written to the output file.

Verify signed mail. The input is a signed mail message and the output is the signed data. Both clear text and opaque signing is supported.

The remaining options are as follows:

The encryption algorithm to use. 128-, 192-, or 256-bit AES, DES (56 bits), triple DES (168 bits), or 40-, 64-, or 128-bit RC2, respectively; if not specified, 40-bit RC2 is used. Only used with

Normally, the input message is converted to

format which uses CR/LF as end of line, as required by the S/MIME specification. When this option is present, no translation occurs. This is useful when handling binary data which may not be in MIME format.

A

containing trusted CA certificates; only used with

A

containing trusted CA certificates; only used with

This directory must be a standard certificate directory: that is, a hash of each subject name (using

should be linked to each certificate.

One or more certificates of message recipients: used when encrypting a message.

Allows additional certificates to be specified. When signing, these will be included with the message. When verifying, these will be searched for the signers' certificates. The certificates should be in PEM format.

Set various certificate chain validation options. See the

command for details.

A file containing the detached content. This is only useful with the

option, and only usable if the PKCS#7 structure is using the detached signature form where the content is not included. This option will override any content if the input format is S/MIME and it uses the multipart/signed MIME content type.

The relevant mail headers. These are included outside the signed portion of a message so they may be included manually. When signing, many S/MIME mail clients check that the signer's certificate email address matches the From: address.

The input file to read from.

Enable streaming I/O for encoding operations. This permits single pass processing of data without the need to hold the entire contents in memory, potentially supporting very large files. Streaming is automatically set for S/MIME signing with detached data if the output format is SMIME; it is currently off by default for all other operations.

The input format.

The private key to use when signing or decrypting, which must match the corresponding certificate. If this option is not specified, the private key must be included in the certificate file specified with the

or

file. When signing, this option can be used multiple times to specify successive keys.

Input private key format. The default is

The digest algorithm to use when signing or resigning. If not present then the default digest algorithm for the signing key is used (usually SHA1).

Do not include attributes.

Do not include the signer's certificate. This will reduce the size of the signed message but the verifier must have a copy of the signer's certificate available locally (passed using the

option, for example).

Do not do chain verification of signers' certificates: that is, don't use the certificates in the signed message as untrusted CAs.

When signing a message, use opaque signing: this form is more resistant to translation by mail relays but it cannot be read by mail agents that do not support S/MIME. Without this option cleartext signing with the MIME type multipart/signed is used.

Disable streaming I/O where it would produce an encoding of indefinite length (currently has no effect).

Only use certificates specified in the

The supplied certificates can still be used as untrusted CAs.

Do not try to verify the signatures on the message.

Exclude the list of supported algorithms from signed attributes, other options such as signing time and content type are still included.

Do not verify the signer's certificate of a signed message.

The output file to write to.

The output format. The default is smime, which writes an S/MIME format message.

and

change this to write PEM and DER format PKCS#7 structures instead. This currently only affects the output format of the PKCS#7 structure; if no PKCS#7 structure is being output (for example with

or

this option has no effect.

The key password source.

The recipients certificate when decrypting a message. This certificate must match one of the recipients of the message or an error occurs.

A signing certificate when signing or resigning a message; this option can be used multiple times if more than one signer is required. If a message is being verified, the signer's certificates will be written to this file if the verification was successful.

The same as

Add plain text (text/plain) MIME headers to the supplied message if encrypting or signing. If decrypting or verifying, it strips off text headers: if the decrypted or verified message is not of MIME type text/plain then an error occurs.

The exit codes for

are as follows:

The operation was completely successful.

An error occurred parsing the command options.

One of the input files could not be read.

An error occurred creating the file or when reading the message.

An error occurred decrypting or verifying the message.

An error occurred writing certificates.

The

command is used to test the performance of cryptographic algorithms.

Perform the test using

The default is to test all algorithms.

Time decryption instead of encryption; must be used with

Measure time in real time instead of CPU user time.

Perform the test using one of the algorithms accepted by

Produce machine readable output.

Run

benchmarks in parallel.

Use allocated buffers with an offset of

bytes from the alignment provided by

should be between 0 and 16.

The

command is a basic Time Stamping Authority (TSA) client and server application as specified in RFC 3161 (Time-Stamp Protocol, TSP). A TSA can be part of a PKI deployment and its role is to provide long term proof of the existence of specific data. Here is a brief description of the protocol:

The TSA client computes a one-way hash value for a data file and sends the hash to the TSA.

The TSA attaches the current date and time to the received hash value, signs them and sends the time stamp token back to the client. By creating this token the TSA certifies the existence of the original data file at the time of response generation.

The TSA client receives the time stamp token and verifies the signature on it. It also checks if the token contains the same hash value that it had sent to the TSA.

There is one DER-encoded protocol data unit defined for transporting a time stamp request to the TSA and one for sending the time stamp response back to the client. The

command has three main functions: creating a time stamp request based on a data file; creating a time stamp response based on a request; and verifying if a response corresponds to a particular request or a data file.

There is no support for sending the requests/responses automatically over HTTP or TCP yet as suggested in RFC 3161. Users must send the requests either by FTP or email.

The

switch can be used for creating and printing a time stamp request with the following options:

Expect the TSA to include its signing certificate in the response.

Specify an alternative configuration file. Only the OID section is used.

The data file for which the time stamp request needs to be created. The default is standard input.

Specify the message imprint explicitly without the data file. The imprint must be specified in a hexadecimal format, two characters per byte, the bytes optionally separated by colons. The number of bytes must match the message digest algorithm in use.

A previously created time stamp request in DER format that will be printed into the output file. Useful for examining the content of a request in human-readable format.

The message digest to apply to the data file. It supports all the message digest algorithms that are supported by the

command. The default is SHA1.

Specify no nonce in the request. The default, to include a 64-bit long pseudo-random nonce, is recommended to protect against replay attacks.

The output file to write to, or standard output if not specified.

The policy that the client expects the TSA to use for creating the time stamp token. Either dotted OID notation or OID names defined in the config file can be used. If no policy is requested, the TSA uses its own default policy.

Output in human-readable text format instead of DER.

A time stamp response (TimeStampResp) consists of a response status and the time stamp token itself (ContentInfo), if the token generation was successful. The

command is for creating a time stamp response or time stamp token based on a request and printing the response/token in human-readable format. If

is not specified the output is always a time stamp response (TimeStampResp), otherwise it is a time stamp token (ContentInfo).

The collection of PEM certificates that will be included in the response in addition to the signer certificate if the

option was used for the request. This file is supposed to contain the certificate chain for the signer certificate from its issuer upwards. The

command does not build a certificate chain automatically.

Specify an alternative configuration file.

Specify a previously created time stamp response (or time stamp token, if

is also specified) in DER format that will be written to the output file. This option does not require a request; it is useful, for example, to examine the content of a response or token or to extract the time stamp token from a response. If the input is a token and the output is a time stamp response, a default

status info is added to the token.

The signer private key of the TSA in PEM format. Overrides the

config file option.

The response is written to this file. The format and content of the file depends on other options (see

and

The default is stdout.

The key password source.

The default policy to use for the response. Either dotted OID notation or OID names defined in the config file can be used. If no policy is requested, the TSA uses its own default policy.

The file containing a DER-encoded time stamp request.

The config file section containing the settings for response generation.

The PEM signer certificate of the TSA. The TSA signing certificate must have exactly one extended key usage assigned to it: timeStamping. The extended key usage must also be critical, otherwise the certificate is going to be refused. Overrides the

variable of the config file.

Output in human-readable text format instead of DER.

The input is a DER-encoded time stamp token (ContentInfo) instead of a time stamp response (TimeStampResp).

The output is a time stamp token (ContentInfo) instead of a time stamp response (TimeStampResp).

The

command is for verifying if a time stamp response or time stamp token is valid and matches a particular time stamp request or data file. The

command does not use the configuration file.

The file containing a set of trusted self-signed PEM CA certificates. See

for additional details. Either this option or

must be specified.

The directory containing the trusted CA certificates of the client. See

for additional details. Either this option or

must be specified.

The response or token must be verified against

The file is hashed with the message digest algorithm specified in the token. The

and

options must not be specified with this one.

The response or token must be verified against the message digest specified with this option. The number of bytes must match the message digest algorithm specified in the token. The

and

options must not be specified with this one.

The time stamp response that needs to be verified, in DER format. This option in mandatory.

The original time stamp request, in DER format. The

and

options must not be specified with this one.

The input is a DER-encoded time stamp token (ContentInfo) instead of a time stamp response (TimeStampResp).

Additional untrusted PEM certificates which may be needed when building the certificate chain for the TSA's signing certificate. This file must contain the TSA signing certificate and all intermediate CA certificates unless the response includes them.

Options specified on the command line always override the settings in the config file:

This is the main section and it specifies the name of another section that contains all the options for the

option. This section can be overridden with the

command line switch.

See

for a description.

See

for a description.

The file containing the hexadecimal serial number of the last time stamp response created. This number is incremented by 1 for each response. If the file does not exist at the time of response generation, a new file is created with serial number 1. This parameter is mandatory.

TSA signing certificate, in PEM format. The same as the

command line option.

A set of PEM-encoded certificates that need to be included in the response. The same as the

command line option.

The private key of the TSA, in PEM format. The same as the

command line option.

The default policy to use when the request does not mandate any policy. The same as the

command line option.

Comma separated list of policies that are also acceptable by the TSA and used only if the request explicitly specifies one of them.

The list of message digest algorithms that the TSA accepts. At least one algorithm must be specified. This parameter is mandatory.

The accuracy of the time source of the TSA in seconds, milliseconds and microseconds. For example, secs:1, millisecs:500, microsecs:100. If any of the components is missing, zero is assumed for that field.

The maximum number of digits, which represent the fraction of seconds, that need to be included in the time field. The trailing zeroes must be removed from the time, so there might actually be fewer digits or no fraction of seconds at all. The maximum value is 6; the default is 0.

If this option is yes, the responses generated by this TSA can always be ordered, even if the time difference between two responses is less than the sum of their accuracies. The default is no.

Set this option to yes if the subject name of the TSA must be included in the TSA name field of the response. The default is no.

The SignedData objects created by the TSA always contain the certificate identifier of the signing certificate in a signed attribute (see RFC 2634, Enhanced Security Services). If this option is set to yes and either the

variable or the

option is specified then the certificate identifiers of the chain will also be included in the SigningCertificate signed attribute. If this variable is set to no, only the signing certificate identifier is included. The default is no.

The

command verifies certificate chains.

The options are as follows:

A

of trusted certificates. The

should contain multiple certificates in PEM format, concatenated together.

A

of trusted certificates. The certificates, or symbolic links to them, should have names of the form

where

is the hashed certificate subject name (see the

option of the

utility).

Verify the signature on the self-signed root CA. This is disabled by default because it doesn't add any security.

The

should contain one or more CRLs in PEM format.

Check end entity certificate validity by attempting to look up a valid CRL. If a valid CRL cannot be found, an error occurs.

Check the validity of all certificates in the chain by attempting to look up valid CRLs.

Set policy variable require-explicit-policy (RFC 3280).

Enable extended CRL features such as indirect CRLs and alternate CRL signing keys.

Print a usage message.

Ignore critical extensions instead of rejecting the certificate.

Set policy variable inhibit-any-policy (RFC 3280).

Set policy variable inhibit-policy-mapping (RFC 3280).

Print diagnostics relating to searches for the issuer certificate of the current certificate showing why each candidate issuer certificate was rejected. The presence of rejection messages does not itself imply that anything is wrong: during the normal verify process several rejections may take place.

Use the legacy X.509 certificate chain verification code.

Enable certificate policy processing.

The intended use for the certificate. Without this option no chain verification will be done. Currently accepted uses are

and

A

of trusted certificates. The

should contain multiple certificates.

A

of untrusted certificates. The

should contain multiple certificates.

Print extra information about the operations being performed.

Disable workarounds for broken certificates which have to be disabled for strict X.509 compliance.

One or more PEM

to verify. If no certificate files are included, an attempt is made to read a certificate from standard input. If the first certificate filename begins with a dash, use a lone dash to mark the last option.

The

program uses the same functions as the internal SSL and S/MIME verification, with one crucial difference: wherever possible an attempt is made to continue after an error, whereas normally the verify operation would halt on the first error. This allows all the problems with a certificate chain to be determined.

The verify operation consists of a number of separate steps. Firstly a certificate chain is built up starting from the supplied certificate and ending in the root CA. It is an error if the whole chain cannot be built up. The chain is built up by looking up the issuer's certificate of the current certificate. If a certificate is found which is its own issuer, it is assumed to be the root CA.

All certificates whose subject name matches the issuer name of the current certificate are subject to further tests. The relevant authority key identifier components of the current certificate (if present) must match the subject key identifier (if present) and issuer and serial number of the candidate issuer; in addition the

extension of the candidate issuer (if present) must permit certificate signing.

The lookup first looks in the list of untrusted certificates and if no match is found the remaining lookups are from the trusted certificates. The root CA is always looked up in the trusted certificate list: if the certificate to verify is a root certificate, then an exact match must be found in the trusted list.

The second operation is to check every untrusted certificate's extensions for consistency with the supplied purpose. If the

option is not included, then no checks are done. The supplied or

certificate must have extensions compatible with the supplied purpose and all other certificates must also be valid CA certificates. The precise extensions required are described in more detail in the

section below.

The third operation is to check the trust settings on the root CA. The root CA should be trusted for the supplied purpose. A certificate with no trust settings is considered to be valid for all purposes.

The final operation is to check the validity of the certificate chain. The validity period is checked against the current system time and the

and

dates in the certificate. The certificate signatures are also checked at this point.

If all operations complete successfully, the certificate is considered valid. If any operation fails then the certificate is not valid. When a verify operation fails, the output messages can be somewhat cryptic. The general form of the error message is:

server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024-bit) error 24 at 1 depth lookup:invalid CA certificate

The first line contains the name of the certificate being verified, followed by the subject name of the certificate. The second line contains the error number as defined by the

constants in

the associated error message documented in

and the depth. The depth is the number of the certificate being verified when a problem was detected starting with zero for the certificate being verified itself, then 1 for the CA that signed the certificate and so on.

The

command is used to print out version information about

The options are as follows:

All information: this is the same as setting all the other flags.

The date the current version of

was built.

setting.

Compilation flags.

Platform setting.

The current

version.

The

command is a multi-purpose certificate utility. It can be used to display certificate information, convert certificates to various forms, sign certificate requests like a

or edit certificate trust settings.

The following are x509 input, output, and general purpose options:

The input file to read from, or standard input if not specified. This option cannot be used with

The input format. Normally, the command will expect an X.509 certificate, but this can change if other options such as

or

are present.

The digest to use. This affects any signing or display option that uses a message digest, such as the

and

options. If not specified, MD5 is used. SHA1 is always used with DSA keys.

The output file to write to, or standard output if none is specified.

The output format.

The key password source.

The following are x509 display options:

Output the certificate in the form of a C source file.

Customise the output format used with

either using a list of comma-separated options or by specifying

multiple times. The default behaviour is to print all fields. The options are as follows:

Equivalent to

and

Equivalent to no output options at all.

Print unsupported certificate extensions.

Hex dump unsupported extensions.

Print an error message for unsupported certificate extensions.

ASN.1 parse unsupported extensions.

Do not print certificate trust information.

Do not print X509V3 extensions.

Do not print header (Certificate and Data) information.

Do not print the issuer name.

Do not print the public key.

Do not print the serial number.

Do not give a hexadecimal dump of the certificate signature.

Do not print the signature algorithm used.

Do not print the subject name.

Do not print the

and

(validity) fields.

Do not print the version number.

Print the start and expiry date of a certificate.

Output the email addresses, if any.

Print the expiry date of the certificate; that is, the

date.

Print the digest of the DER-encoded version of the whole certificate.

A synonym for

Print the issuer name.

Print the hash of the certificate issuer name.

Print the hash of the certificate issuer name using the older algorithm as used by

versions before 1.0.0.

Print the value of the modulus of the public key contained in the certificate.

This option causes the

argument to be interpreted with full support for multivalued RDNs, for example

If

is not used, the UID value is set to

Customise how the subject or issuer names are displayed, either using a list of comma-separated options or by specifying

multiple times. The default behaviour is to use the

format. The options, which can be preceded by a dash to turn them off, are as follows:

Align field values for a more readable output. Only usable with

Use the old format, equivalent to specifying no options at all.

Reverse the fields of the DN, as required by RFC 2253. As a side effect, this also reverses the order of multiple AVAs.

Dump all fields. When used with

it allows the DER encoding of the structure to be unambiguously determined.

Any fields that need to be hexdumped are dumped using the DER encoding of the field. Otherwise just the content octets will be displayed. Both options use the RFC 2253 #XXXX… format.

Dump non-character string types (for example OCTET STRING); usually, non-character string types are displayed as though each content octet represents a single character.

Dump any field whose OID is not recognised by

Escape the

characters required by RFC 2253 in a field that is

Additionally,

is escaped at the beginning of a string and a space character at the beginning or end of a string.

Escape control characters. That is, those with ASCII values less than 0x20 (space) and the delete (0x7f) character. They are escaped using the RFC 2253 \XX notation (where XX are two hex digits representing the character value).

Escape characters with the MSB set; that is, with ASCII values larger than 127.

A multiline format. Equivalent to

and

Do not attempt to interpret multibyte characters. That is, content octets are merely dumped as though one octet represents each character. This is useful for diagnostic purposes but results in rather odd looking output.

Alter how the field name is displayed:

does not display the field at all;

uses the short name form (CN for

for example);

uses the long form.

represents the OID in numerical form and is useful for diagnostic purpose.

A one line format which is more readable than

Equivalent to

and

Displays names compatible with RFC 2253. Equivalent to

and

Determine the field separators: the first character is between RDNs and the second between multiple AVAs (multiple AVAs are very rare and their use is discouraged). The options ending in

additionally place a space after the separator to make it more readable.

uses a linefeed character for the RDN separator and a spaced

for the AVA separator, as well as indenting the fields by four characters. If no field separator is specified then

is used by default.

Show the type of the ASN.1 character string. The type precedes the field contents. For example

Place spaces round the

character which follows the field name.

Escape some characters by surrounding the whole string with

characters. Without the option, all escaping is done with the

character.

Convert all strings to UTF8 format first, as required by RFC 2253. On a UTF8 compatible terminal, the use of this option (and not setting

may result in the correct display of multibyte characters. Usually, multibyte characters larger than 0xff are represented using the format \UXXXX for 16 bits and \WXXXXXXXX for 32 bits, and any UTF8Strings are converted to their character form first.

Print the next serial number.

Do not output the encoded version of the request.

Print the OCSP responder addresses, if any.

Print OCSP hash values for the subject name and public key.

Print the public key.

Print the certificate serial number.

Pass options to the signature algorithm during sign or certify operations. The names and values of these options are algorithm-specific.

Print the start date of the certificate; that is, the

date.

Print the subject name.

Print the hash of the certificate subject name. This is used in

to form an index to allow certificates in a directory to be looked up by subject name.

Print the hash of the certificate subject name using the older algorithm as used by

versions before 1.0.0.

Print the full certificate in text form.

A trusted certificate is a certificate which has several additional pieces of information attached to it such as the permitted and prohibited uses of the certificate and an alias. When a certificate is being verified, at least one certificate must be trusted. By default, a trusted certificate must be stored locally and be a root CA. The following are x509 trust settings options:

Add a prohibited use. Accepts the same values as the

option.

Add a trusted certificate use. Any object name can be used here, but currently only

(SSL client use),

(SSL server use), and

(S/MIME email) are used.

Output the certificate alias.

Clear all the prohibited or rejected uses of the certificate.

Clear all the permitted or trusted uses of the certificate.

Perform tests on the certificate extensions. The same code is used when verifying untrusted certificates in chains, so this section is useful if a chain is rejected by the verify code.

The

extension CA flag is used to determine whether the certificate can be used as a CA. If the CA flag is true, it is a CA; if the CA flag is false, it is not a CA. All CAs should have the CA flag set to true.

If the

extension is absent, then the certificate is considered to be a possible CA; other extensions are checked according to the intended use of the certificate. A warning is given in this case because the certificate should really not be regarded as a CA. However it is allowed to be a CA to work around some broken software.

If the certificate is a V1 certificate (and thus has no extensions) and it is self-signed, it is also assumed to be a CA but a warning is again given. This is to work around the problem of Verisign roots which are V1 self-signed certificates.

If the

extension is present, then additional restraints are made on the uses of the certificate. A CA certificate must have the

bit set if the

extension is present.

The extended key usage extension places additional restrictions on the certificate uses. If this extension is present, whether critical or not, the key can only be used for the purposes specified.

A complete description of each test is given below. The comments about

and

and V1 certificates above apply to all CA certificates.

The extended key usage extension must be absent or include the web client authentication OID.

must be absent or it must have the

bit set. The Netscape certificate type must be absent or it must have the SSL client bit set.

The extended key usage extension must be absent or include the web client authentication OID. The Netscape certificate type must be absent or it must have the SSL CA bit set: this is used as a workaround if the

extension is absent.

The extended key usage extension must be absent or include the web server authentication and/or one of the SGC OIDs.

must be absent or it must have the

set, the

set, or both bits set. The Netscape certificate type must be absent or have the SSL server bit set.

The extended key usage extension must be absent or include the web server authentication and/or one of the SGC OIDs. The Netscape certificate type must be absent or the SSL CA bit must be set: this is used as a workaround if the

extension is absent.

For Netscape SSL clients to connect to an SSL server; it must have the

bit set if the

extension is present. This isn't always valid because some cipher suites use the key for digital signing. Otherwise it is the same as a normal SSL server.

The extended key usage extension must be absent or include the email protection OID. The Netscape certificate type must be absent or should have the S/MIME bit set. If the S/MIME bit is not set in Netscape certificate type, then the SSL client bit is tolerated as an alternative but a warning is shown: this is because some Verisign certificates don't set the S/MIME bit.

In addition to the common S/MIME client tests, the

bit must be set if the

extension is present.

In addition to the common S/MIME tests, the

bit must be set if the

extension is present.

The extended key usage extension must be absent or include the email protection OID. The Netscape certificate type must be absent or must have the S/MIME CA bit set: this is used as a workaround if the

extension is absent.

The

extension must be absent or it must have the CRL signing bit set.

The normal CA tests apply, except the

extension must be present.

Set the alias of the certificate, allowing the certificate to be referred to using a nickname, such as

Output a trusted certificate (the default if any trust settings are modified). An ordinary or trusted certificate can be input, but by default an ordinary certificate is output and any trust settings are discarded.

The

utility can be used to sign certificates and requests: it can thus behave like a mini CA. The following are x509 signing options:

The CA certificate to be used for signing. When this option is present,

behaves like a mini CA. The input file is signed by the CA using this option; that is, its issuer name is set to the subject name of the CA and it is digitally signed using the CA's private key.

This option is normally combined with the

option. Without the

option, the input is a certificate which must be self-signed.

Create the CA serial number file if it does not exist instead of generating an error. The file will contain the serial number

and the certificate being signed will have

as its serial number.

The format of the CA certificate file. The default is

Set the CA private key to sign a certificate with. Otherwise it is assumed that the CA private key is present in the CA certificate file.

The format of the CA private key. The default is

Use the serial number in

to sign a certificate. The file should consist of one line containing an even number of hex digits with the serial number to use. After each use the serial number is incremented and written out to the file again.

The default filename consists of the CA certificate file base name with

appended. For example, if the CA certificate file is called

it expects to find a serial number file called

Check whether the certificate expires in the next

seconds. If so, exit with return value 1; otherwise exit with return value 0.

Delete any extensions from a certificate. This option is used when a certificate is being created from another certificate (for example with the

or the

options). Normally, all extensions are retained.

The number of days to make a certificate valid for. The default is 30 days.

The section to add certificate extensions from. If this option is not specified, the extensions should either be contained in the unnamed (default) section or the default section should contain a variable called

which contains the section to use.

File containing certificate extensions to use. If not specified, no extensions are added to the certificate.

Set the public key of the certificate to the public key contained in

The format of the key file used in the

and

options.

Generate a new certificate using the subject given by

and signed by

If no public key is provided with

the resulting certificate is self-signed. This option cannot be used with

or

Expect a certificate request on input instead of a certificate. This option cannot be used with

The issuer name to use.

must be formatted as /type0=value0/type1=value1/type2=…; characters may be escaped by

(backslash); no spaces are skipped.

The serial number to use. This option can be used with either the

or

options. If used in conjunction with the

option, the serial number file (as specified by the

or

options) is not used.

The serial number can be decimal or hex (if preceded by

Negative serial numbers can also be specified but their use is not recommended.

The subject name to use.

must be formatted as /type0=value0/type1=value1/type2=…; characters may be escaped by

(backslash); no spaces are skipped.

Self-sign

using the supplied private key.

If the input file is a certificate, it sets the issuer name to the subject name (i.e. makes it self-signed), changes the public key to the supplied value, and changes the start and end dates. The start date is set to the current time and the end date is set to a value determined by the

option. Any certificate extensions are retained unless the

option is supplied.

If the input is a certificate request, a self-signed certificate is created using the supplied private key using the subject name in the request.

Interpret field values read from a terminal or obtained from a configuration file as UTF-8 strings. By default, they are interpreted as ASCII.

Convert a certificate into a certificate request. The

option is used to pass the required private key.

Several commands share a common syntax, as detailed below.

Password arguments, typically specified using

and

for input and output passwords, allow passwords to be obtained from a variety of sources. Both of these options take a single argument, described below. If no password argument is given and a password is required, then the user is prompted to enter one: this will typically be read from the current terminal with echoing turned off.

The actual password is

Since the password is visible to utilities, this form should only be used where security is not important.

Obtain the password from the environment variable

Since the environment of other processes is visible, this option should be used with caution.

The first line of

is the password. If the same

argument is supplied to

and

then the first line will be used for the input password and the next line for the output password.

need not refer to a regular file: it could, for example, refer to a device or named pipe.

Read the password from the file descriptor

This can be used to send the data via a pipe, for example.

Read the password from standard input.

Input/output formats, typically specified using

and

indicate the format being read from or written to. The argument is case insensitive.

Distinguished Encoding Rules (DER) is a binary format.

Insecure legacy format.

Privacy Enhanced Mail (PEM) is base64-encoded.

Private Key format.

An SMIME format message.

Plain ASCII text.

The following environment variables affect the execution of

The location of the master configuration file.

Default config directory for

Unused.

Default private key directory.

Default configuration file for

Default configuration file for

certificates.