[BACK]Return to openssl.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / openssl

Annotation of src/usr.bin/openssl/openssl.1, Revision 1.92

1.92    ! schwarze    1: .\" $OpenBSD: openssl.1,v 1.91 2018/03/30 23:03:31 schwarze Exp $
1.1       jsing       2: .\" ====================================================================
                      3: .\" Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
                      4: .\"
                      5: .\" Redistribution and use in source and binary forms, with or without
                      6: .\" modification, are permitted provided that the following conditions
                      7: .\" are met:
                      8: .\"
                      9: .\" 1. Redistributions of source code must retain the above copyright
                     10: .\"    notice, this list of conditions and the following disclaimer.
                     11: .\"
                     12: .\" 2. Redistributions in binary form must reproduce the above copyright
                     13: .\"    notice, this list of conditions and the following disclaimer in
                     14: .\"    the documentation and/or other materials provided with the
                     15: .\"    distribution.
                     16: .\"
                     17: .\" 3. All advertising materials mentioning features or use of this
                     18: .\"    software must display the following acknowledgment:
                     19: .\"    "This product includes software developed by the OpenSSL Project
                     20: .\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
                     21: .\"
                     22: .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
                     23: .\"    endorse or promote products derived from this software without
                     24: .\"    prior written permission. For written permission, please contact
                     25: .\"    openssl-core@openssl.org.
                     26: .\"
                     27: .\" 5. Products derived from this software may not be called "OpenSSL"
                     28: .\"    nor may "OpenSSL" appear in their names without prior written
                     29: .\"    permission of the OpenSSL Project.
                     30: .\"
                     31: .\" 6. Redistributions of any form whatsoever must retain the following
                     32: .\"    acknowledgment:
                     33: .\"    "This product includes software developed by the OpenSSL Project
                     34: .\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
                     35: .\"
                     36: .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
                     37: .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     38: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
                     39: .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
                     40: .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
                     41: .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
                     42: .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
                     43: .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     44: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
                     45: .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
                     46: .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
                     47: .\" OF THE POSSIBILITY OF SUCH DAMAGE.
                     48: .\" ====================================================================
                     49: .\"
                     50: .\" This product includes cryptographic software written by Eric Young
                     51: .\" (eay@cryptsoft.com).  This product includes software written by Tim
                     52: .\" Hudson (tjh@cryptsoft.com).
                     53: .\"
                     54: .\"
                     55: .\" Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
                     56: .\" All rights reserved.
                     57: .\"
                     58: .\" This package is an SSL implementation written
                     59: .\" by Eric Young (eay@cryptsoft.com).
                     60: .\" The implementation was written so as to conform with Netscapes SSL.
                     61: .\"
                     62: .\" This library is free for commercial and non-commercial use as long as
                     63: .\" the following conditions are aheared to.  The following conditions
                     64: .\" apply to all code found in this distribution, be it the RC4, RSA,
                     65: .\" lhash, DES, etc., code; not just the SSL code.  The SSL documentation
                     66: .\" included with this distribution is covered by the same copyright terms
                     67: .\" except that the holder is Tim Hudson (tjh@cryptsoft.com).
                     68: .\"
                     69: .\" Copyright remains Eric Young's, and as such any Copyright notices in
                     70: .\" the code are not to be removed.
                     71: .\" If this package is used in a product, Eric Young should be given attribution
                     72: .\" as the author of the parts of the library used.
                     73: .\" This can be in the form of a textual message at program startup or
                     74: .\" in documentation (online or textual) provided with the package.
                     75: .\"
                     76: .\" Redistribution and use in source and binary forms, with or without
                     77: .\" modification, are permitted provided that the following conditions
                     78: .\" are met:
                     79: .\" 1. Redistributions of source code must retain the copyright
                     80: .\"    notice, this list of conditions and the following disclaimer.
                     81: .\" 2. Redistributions in binary form must reproduce the above copyright
                     82: .\"    notice, this list of conditions and the following disclaimer in the
                     83: .\"    documentation and/or other materials provided with the distribution.
                     84: .\" 3. All advertising materials mentioning features or use of this software
                     85: .\"    must display the following acknowledgement:
                     86: .\"    "This product includes cryptographic software written by
                     87: .\"     Eric Young (eay@cryptsoft.com)"
                     88: .\"    The word 'cryptographic' can be left out if the rouines from the library
                     89: .\"    being used are not cryptographic related :-).
                     90: .\" 4. If you include any Windows specific code (or a derivative thereof) from
                     91: .\"    the apps directory (application code) you must include an
                     92: .\"    acknowledgement:
                     93: .\"    "This product includes software written by Tim Hudson
                     94: .\"     (tjh@cryptsoft.com)"
                     95: .\"
                     96: .\" THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
                     97: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     98: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     99: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
                    100: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                    101: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                    102: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                    103: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                    104: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                    105: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                    106: .\" SUCH DAMAGE.
                    107: .\"
                    108: .\" The licence and distribution terms for any publically available version or
                    109: .\" derivative of this code cannot be changed.  i.e. this code cannot simply be
                    110: .\" copied and put under another distribution licence
                    111: .\" [including the GNU Public Licence.]
                    112: .\"
1.91      schwarze  113: .Dd $Mdocdate: March 30 2018 $
1.1       jsing     114: .Dt OPENSSL 1
                    115: .Os
                    116: .Sh NAME
                    117: .Nm openssl
                    118: .Nd OpenSSL command line tool
                    119: .Sh SYNOPSIS
                    120: .Nm
1.90      schwarze  121: .Ar command
1.1       jsing     122: .Op Ar command_opts
                    123: .Op Ar command_args
                    124: .Pp
                    125: .Nm
1.13      bentley   126: .Cm list-standard-commands |
                    127: .Cm list-message-digest-commands |
                    128: .Cm list-cipher-commands |
                    129: .Cm list-cipher-algorithms |
                    130: .Cm list-message-digest-algorithms |
1.1       jsing     131: .Cm list-public-key-algorithms
                    132: .Pp
                    133: .Nm
1.39      jmc       134: .Cm no- Ns Ar command
1.1       jsing     135: .Sh DESCRIPTION
                    136: .Nm OpenSSL
1.31      jmc       137: is a cryptography toolkit implementing the
                    138: Transport Layer Security
1.1       jsing     139: .Pq TLS v1
1.31      jmc       140: network protocol,
                    141: as well as related cryptography standards.
1.1       jsing     142: .Pp
                    143: The
                    144: .Nm
                    145: program is a command line tool for using the various
                    146: cryptography functions of
1.39      jmc       147: .Nm openssl Ns 's
1.33      jmc       148: crypto library from the shell.
1.1       jsing     149: .Pp
                    150: The pseudo-commands
                    151: .Cm list-standard-commands , list-message-digest-commands ,
                    152: and
                    153: .Cm list-cipher-commands
                    154: output a list
                    155: .Pq one entry per line
                    156: of the names of all standard commands, message digest commands,
                    157: or cipher commands, respectively, that are available in the present
                    158: .Nm
                    159: utility.
                    160: .Pp
                    161: The pseudo-commands
                    162: .Cm list-cipher-algorithms
                    163: and
                    164: .Cm list-message-digest-algorithms
                    165: list all cipher and message digest names,
                    166: one entry per line.
                    167: Aliases are listed as:
                    168: .Pp
1.33      jmc       169: .D1 from => to
1.1       jsing     170: .Pp
                    171: The pseudo-command
                    172: .Cm list-public-key-algorithms
                    173: lists all supported public key algorithms.
                    174: .Pp
                    175: The pseudo-command
1.39      jmc       176: .Cm no- Ns Ar command
1.1       jsing     177: tests whether a command of the
                    178: specified name is available.
1.39      jmc       179: If
                    180: .Ar command
                    181: does not exist,
1.1       jsing     182: it returns 0
                    183: and prints
1.39      jmc       184: .Cm no- Ns Ar command ;
1.1       jsing     185: otherwise it returns 1 and prints
1.39      jmc       186: .Ar command .
                    187: In both cases, the output goes to stdout and nothing is printed to stderr.
1.1       jsing     188: Additional command line arguments are always ignored.
                    189: Since for each cipher there is a command of the same name,
                    190: this provides an easy way for shell scripts to test for the
                    191: availability of ciphers in the
                    192: .Nm
                    193: program.
                    194: .Pp
                    195: .Sy Note :
1.39      jmc       196: .Cm no- Ns Ar command
1.1       jsing     197: is not able to detect pseudo-commands such as
                    198: .Cm quit ,
                    199: .Cm list- Ns Ar ... Ns Cm -commands ,
                    200: or
1.39      jmc       201: .Cm no- Ns Ar command
1.1       jsing     202: itself.
                    203: .Sh ASN1PARSE
                    204: .nr nS 1
                    205: .Nm "openssl asn1parse"
                    206: .Op Fl i
                    207: .Op Fl dlimit Ar number
                    208: .Op Fl dump
                    209: .Op Fl genconf Ar file
                    210: .Op Fl genstr Ar str
                    211: .Op Fl in Ar file
1.34      jmc       212: .Op Fl inform Cm der | pem | txt
1.1       jsing     213: .Op Fl length Ar number
                    214: .Op Fl noout
                    215: .Op Fl offset Ar number
                    216: .Op Fl oid Ar file
                    217: .Op Fl out Ar file
                    218: .Op Fl strparse Ar offset
                    219: .nr nS 0
                    220: .Pp
                    221: The
                    222: .Nm asn1parse
                    223: command is a diagnostic utility that can parse ASN.1 structures.
                    224: It can also be used to extract data from ASN.1 formatted data.
                    225: .Pp
                    226: The options are as follows:
                    227: .Bl -tag -width Ds
                    228: .It Fl dlimit Ar number
                    229: Dump the first
                    230: .Ar number
                    231: bytes of unknown data in hex form.
                    232: .It Fl dump
                    233: Dump unknown data in hex form.
                    234: .It Fl genconf Ar file , Fl genstr Ar str
                    235: Generate encoded data based on string
                    236: .Ar str ,
                    237: file
                    238: .Ar file ,
1.34      jmc       239: or both, using the format described in
                    240: .Xr ASN1_generate_nconf 3 .
1.1       jsing     241: If only
                    242: .Ar file
                    243: is present then the string is obtained from the default section
                    244: using the name
                    245: .Dq asn1 .
1.84      jmc       246: The encoded data is passed through the ASN.1 parser and printed out as
1.1       jsing     247: though it came from a file;
                    248: the contents can thus be examined and written to a file using the
                    249: .Fl out
                    250: option.
                    251: .It Fl i
1.34      jmc       252: Indent the output according to the
1.1       jsing     253: .Qq depth
                    254: of the structures.
                    255: .It Fl in Ar file
1.41      jmc       256: The input file to read from, or standard input if not specified.
1.34      jmc       257: .It Fl inform Cm der | pem | txt
1.1       jsing     258: The input format.
                    259: .It Fl length Ar number
1.34      jmc       260: Number of bytes to parse; the default is until end of file.
1.1       jsing     261: .It Fl noout
1.46      jmc       262: Do not output the parsed version of the input file.
1.1       jsing     263: .It Fl offset Ar number
1.34      jmc       264: Starting offset to begin parsing; the default is start of file.
1.1       jsing     265: .It Fl oid Ar file
                    266: A file containing additional object identifiers
                    267: .Pq OIDs .
                    268: If an OID
                    269: .Pq object identifier
                    270: is not part of
1.34      jmc       271: .Nm openssl Ns 's
1.1       jsing     272: internal table it will be represented in
                    273: numerical form
                    274: .Pq for example 1.2.3.4 .
1.34      jmc       275: .Pp
1.1       jsing     276: Each line consists of three columns:
                    277: the first column is the OID in numerical format and should be followed by
                    278: whitespace.
                    279: The second column is the
1.34      jmc       280: .Qq short name ,
1.1       jsing     281: which is a single word followed by whitespace.
                    282: The final column is the rest of the line and is the
                    283: .Qq long name .
                    284: .Nm asn1parse
                    285: displays the long name.
1.34      jmc       286: .It Fl out Ar file
                    287: The DER-encoded output file; the default is no encoded output
                    288: (useful when combined with
                    289: .Fl strparse ) .
                    290: .It Fl strparse Ar offset
                    291: Parse the content octets of the ASN.1 object starting at
                    292: .Ar offset .
                    293: This option can be used multiple times to
                    294: .Qq drill down
                    295: into a nested structure.
                    296: .El
1.1       jsing     297: .Sh CA
                    298: .nr nS 1
                    299: .Nm "openssl ca"
                    300: .Op Fl batch
                    301: .Op Fl cert Ar file
                    302: .Op Fl config Ar file
1.91      schwarze  303: .Op Fl create_serial
1.1       jsing     304: .Op Fl crl_CA_compromise Ar time
                    305: .Op Fl crl_compromise Ar time
                    306: .Op Fl crl_hold Ar instruction
                    307: .Op Fl crl_reason Ar reason
                    308: .Op Fl crldays Ar days
                    309: .Op Fl crlexts Ar section
                    310: .Op Fl crlhours Ar hours
                    311: .Op Fl days Ar arg
                    312: .Op Fl enddate Ar date
                    313: .Op Fl extensions Ar section
                    314: .Op Fl extfile Ar section
                    315: .Op Fl gencrl
                    316: .Op Fl in Ar file
                    317: .Op Fl infiles
1.91      schwarze  318: .Op Fl key Ar password
1.1       jsing     319: .Op Fl keyfile Ar arg
1.91      schwarze  320: .Op Fl keyform Cm pem | der
1.1       jsing     321: .Op Fl md Ar arg
                    322: .Op Fl msie_hack
1.91      schwarze  323: .Op Fl multivalue\-rdn
1.1       jsing     324: .Op Fl name Ar section
                    325: .Op Fl noemailDN
                    326: .Op Fl notext
                    327: .Op Fl out Ar file
                    328: .Op Fl outdir Ar dir
                    329: .Op Fl passin Ar arg
                    330: .Op Fl policy Ar arg
                    331: .Op Fl preserveDN
                    332: .Op Fl revoke Ar file
1.91      schwarze  333: .Op Fl selfsign
1.1       jsing     334: .Op Fl spkac Ar file
                    335: .Op Fl ss_cert Ar file
                    336: .Op Fl startdate Ar date
                    337: .Op Fl status Ar serial
                    338: .Op Fl subj Ar arg
                    339: .Op Fl updatedb
1.91      schwarze  340: .Op Fl utf8
1.1       jsing     341: .Op Fl verbose
                    342: .nr nS 0
                    343: .Pp
                    344: The
                    345: .Nm ca
1.35      jmc       346: command is a minimal certificate authority (CA) application.
1.1       jsing     347: It can be used to sign certificate requests in a variety of forms
1.35      jmc       348: and generate certificate revocation lists (CRLs).
1.1       jsing     349: It also maintains a text database of issued certificates and their status.
                    350: .Pp
1.35      jmc       351: The options relevant to CAs are as follows:
1.1       jsing     352: .Bl -tag -width "XXXX"
                    353: .It Fl batch
1.41      jmc       354: Batch mode.
1.1       jsing     355: In this mode no questions will be asked
                    356: and all certificates will be certified automatically.
                    357: .It Fl cert Ar file
                    358: The CA certificate file.
                    359: .It Fl config Ar file
1.72      jmc       360: Specify an alternative configuration file.
1.91      schwarze  361: .It Fl create_serial
                    362: If reading the serial from the text file as specified in the
                    363: configuration fails, create a new random serial to be used as the
                    364: next serial number.
1.1       jsing     365: .It Fl days Ar arg
                    366: The number of days to certify the certificate for.
                    367: .It Fl enddate Ar date
1.41      jmc       368: Set the expiry date.
1.88      jmc       369: The format of the date is [YY]YYMMDDHHMMSSZ,
                    370: with all four year digits required for dates from 2050 onwards.
1.1       jsing     371: .It Fl extensions Ar section
                    372: The section of the configuration file containing certificate extensions
                    373: to be added when a certificate is issued (defaults to
1.35      jmc       374: .Cm x509_extensions
1.1       jsing     375: unless the
                    376: .Fl extfile
                    377: option is used).
                    378: If no extension section is present, a V1 certificate is created.
                    379: If the extension section is present
                    380: .Pq even if it is empty ,
                    381: then a V3 certificate is created.
1.91      schwarze  382: See the
                    383: .Xr x509v3.cnf 5
                    384: manual page for details of the extension section format.
1.1       jsing     385: .It Fl extfile Ar file
                    386: An additional configuration
                    387: .Ar file
                    388: to read certificate extensions from
                    389: (using the default section unless the
                    390: .Fl extensions
                    391: option is also used).
                    392: .It Fl in Ar file
                    393: An input
                    394: .Ar file
                    395: containing a single certificate request to be signed by the CA.
                    396: .It Fl infiles
                    397: If present, this should be the last option; all subsequent arguments
                    398: are assumed to be the names of files containing certificate requests.
1.91      schwarze  399: .It Fl key Ar password
                    400: The
                    401: .Fa password
                    402: used to encrypt the private key.
1.35      jmc       403: Since on some systems the command line arguments are visible,
                    404: this option should be used with caution.
1.1       jsing     405: .It Fl keyfile Ar file
                    406: The private key to sign requests with.
1.91      schwarze  407: .It Fl keyform Cm pem | der
1.1       jsing     408: Private key file format.
1.91      schwarze  409: The default is
                    410: .Cm pem .
1.1       jsing     411: .It Fl md Ar alg
                    412: The message digest to use.
                    413: Possible values include
                    414: .Ar md5
                    415: and
                    416: .Ar sha1 .
                    417: This option also applies to CRLs.
                    418: .It Fl msie_hack
                    419: This is a legacy option to make
                    420: .Nm ca
                    421: work with very old versions of the IE certificate enrollment control
                    422: .Qq certenr3 .
                    423: It used UniversalStrings for almost everything.
                    424: Since the old control has various security bugs,
                    425: its use is strongly discouraged.
                    426: The newer control
                    427: .Qq Xenroll
                    428: does not need this option.
1.91      schwarze  429: .It Fl multivalue\-rdn
                    430: This option causes the
                    431: .Fl subj
                    432: argument to be interpreted with full support for multivalued RDNs,
                    433: for example
                    434: .Qq "/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe" .
                    435: If
                    436: .Fl multivalue\-rdn
                    437: is not used, the UID value is set to
                    438: .Qq "123456+CN=John Doe" .
1.1       jsing     439: .It Fl name Ar section
                    440: Specifies the configuration file
                    441: .Ar section
                    442: to use (overrides
                    443: .Cm default_ca
                    444: in the
                    445: .Cm ca
                    446: section).
                    447: .It Fl noemailDN
                    448: The DN of a certificate can contain the EMAIL field if present in the
1.30      mmcc      449: request DN, however it is good policy just having the email set into
1.1       jsing     450: the
1.35      jmc       451: .Cm altName
1.1       jsing     452: extension of the certificate.
                    453: When this option is set, the EMAIL field is removed from the certificate's
                    454: subject and set only in the, eventually present, extensions.
                    455: The
                    456: .Ar email_in_dn
                    457: keyword can be used in the configuration file to enable this behaviour.
                    458: .It Fl notext
                    459: Don't output the text form of a certificate to the output file.
                    460: .It Fl out Ar file
                    461: The output file to output certificates to.
                    462: The default is standard output.
1.91      schwarze  463: The certificate details will also be printed out to this file in
                    464: PEM format, except that
                    465: .Fl spkac
                    466: outputs DER format.
1.1       jsing     467: .It Fl outdir Ar directory
                    468: The
                    469: .Ar directory
                    470: to output certificates to.
                    471: The certificate will be written to a file consisting of the
                    472: serial number in hex with
                    473: .Qq .pem
                    474: appended.
                    475: .It Fl passin Ar arg
                    476: The key password source.
                    477: .It Fl policy Ar arg
1.41      jmc       478: Define the CA
1.1       jsing     479: .Qq policy
                    480: to use.
1.35      jmc       481: The policy section in the configuration file
                    482: consists of a set of variables corresponding to certificate DN fields.
                    483: The values may be one of
                    484: .Qq match
                    485: (the value must match the same field in the CA certificate),
                    486: .Qq supplied
                    487: (the value must be present), or
                    488: .Qq optional
                    489: (the value may be present).
                    490: Any fields not mentioned in the policy section
                    491: are silently deleted, unless the
                    492: .Fl preserveDN
                    493: option is set,
                    494: but this can be regarded more of a quirk than intended behaviour.
1.1       jsing     495: .It Fl preserveDN
                    496: Normally, the DN order of a certificate is the same as the order of the
                    497: fields in the relevant policy section.
                    498: When this option is set, the order is the same as the request.
                    499: This is largely for compatibility with the older IE enrollment control
                    500: which would only accept certificates if their DNs matched the order of the
                    501: request.
                    502: This is not needed for Xenroll.
1.91      schwarze  503: .It Fl selfsign
                    504: Indicates the issued certificates are to be signed with the key the
                    505: certificate requests were signed with, given with
                    506: .Fl keyfile .
                    507: Certificate requests signed with a different key are ignored.
                    508: If
                    509: .Fl gencrl ,
                    510: .Fl spkac ,
                    511: or
                    512: .Fl ss_cert
                    513: are given,
                    514: .Fl selfsign
                    515: is ignored.
                    516: .Pp
                    517: A consequence of using
                    518: .Fl selfsign
                    519: is that the self-signed certificate appears among the entries in
                    520: the certificate database (see the configuration option
                    521: .Cm database )
                    522: and uses the same serial number counter as all other certificates
                    523: signed with the self-signed certificate.
1.1       jsing     524: .It Fl spkac Ar file
                    525: A file containing a single Netscape signed public key and challenge,
                    526: and additional field values to be signed by the CA.
1.35      jmc       527: This will usually come from the
                    528: KEYGEN tag in an HTML form to create a new private key.
                    529: It is, however, possible to create SPKACs using the
                    530: .Nm spkac
                    531: utility.
                    532: .Pp
                    533: The file should contain the variable SPKAC set to the value of
                    534: the SPKAC and also the required DN components as name value pairs.
                    535: If it's necessary to include the same component twice,
                    536: then it can be preceded by a number and a
                    537: .Sq \&. .
1.1       jsing     538: .It Fl ss_cert Ar file
                    539: A single self-signed certificate to be signed by the CA.
                    540: .It Fl startdate Ar date
1.41      jmc       541: Set the start date.
1.88      jmc       542: The format of the date is [YY]YYMMDDHHMMSSZ,
                    543: with all four year digits required for dates from 2050 onwards.
1.91      schwarze  544: .It Fl subj Ar arg
                    545: Supersedes the subject name given in the request.
                    546: The
                    547: .Ar arg
                    548: must be formatted as
                    549: .Sm off
                    550: .Pf / Ar type0 Ns = Ar value0 Ns / Ar type 1 Ns = Ar value 1 Ns /
                    551: .Ar type2 Ns = Ar ... ;
                    552: .Sm on
                    553: characters may be escaped by
                    554: .Sq \e
                    555: .Pq backslash ,
                    556: no spaces are skipped.
                    557: .It Fl utf8
                    558: Interpret field values read from a terminal or obtained from a
                    559: configuration file as UTF-8 strings.
                    560: By default, they are interpreted as ASCII.
1.1       jsing     561: .It Fl verbose
1.41      jmc       562: Print extra details about the operations being performed.
1.1       jsing     563: .El
1.35      jmc       564: .Pp
                    565: The options relevant to CRLs are as follows:
1.1       jsing     566: .Bl -tag -width "XXXX"
                    567: .It Fl crl_CA_compromise Ar time
                    568: This is the same as
                    569: .Fl crl_compromise ,
                    570: except the revocation reason is set to CACompromise.
                    571: .It Fl crl_compromise Ar time
1.41      jmc       572: Set the revocation reason to keyCompromise and the compromise time to
1.1       jsing     573: .Ar time .
                    574: .Ar time
                    575: should be in GeneralizedTime format, i.e. YYYYMMDDHHMMSSZ.
                    576: .It Fl crl_hold Ar instruction
1.41      jmc       577: Set the CRL revocation reason code to certificateHold and the hold
1.1       jsing     578: instruction to
                    579: .Ar instruction
                    580: which must be an OID.
                    581: Although any OID can be used, only holdInstructionNone
                    582: (the use of which is discouraged by RFC 2459), holdInstructionCallIssuer or
                    583: holdInstructionReject will normally be used.
                    584: .It Fl crl_reason Ar reason
                    585: Revocation reason, where
                    586: .Ar reason
                    587: is one of:
                    588: unspecified, keyCompromise, CACompromise, affiliationChanged, superseded,
                    589: cessationOfOperation, certificateHold or removeFromCRL.
                    590: The matching of
                    591: .Ar reason
                    592: is case insensitive.
                    593: Setting any revocation reason will make the CRL v2.
                    594: In practice, removeFromCRL is not particularly useful because it is only used
                    595: in delta CRLs which are not currently implemented.
                    596: .It Fl crldays Ar num
                    597: The number of days before the next CRL is due.
                    598: This is the days from now to place in the CRL
1.35      jmc       599: .Cm nextUpdate
1.1       jsing     600: field.
                    601: .It Fl crlexts Ar section
                    602: The
                    603: .Ar section
                    604: of the configuration file containing CRL extensions to include.
                    605: If no CRL extension section is present then a V1 CRL is created;
                    606: if the CRL extension section is present
1.81      jmc       607: (even if it is empty)
1.1       jsing     608: then a V2 CRL is created.
1.81      jmc       609: The CRL extensions specified are CRL extensions and not CRL entry extensions.
                    610: It should be noted that some software can't handle V2 CRLs.
1.91      schwarze  611: See the
                    612: .Xr x509v3.cnf 5
                    613: manual page for details of the extension section format.
1.1       jsing     614: .It Fl crlhours Ar num
                    615: The number of hours before the next CRL is due.
                    616: .It Fl gencrl
1.41      jmc       617: Generate a CRL based on information in the index file.
1.1       jsing     618: .It Fl revoke Ar file
                    619: A
                    620: .Ar file
                    621: containing a certificate to revoke.
1.91      schwarze  622: .It Fl status Ar serial
                    623: Show the status of the certificate with serial number
                    624: .Ar serial .
                    625: .It Fl updatedb
                    626: Update the database index to purge expired certificates.
1.1       jsing     627: .El
                    628: .Pp
1.35      jmc       629: Many of the options can be set in the
                    630: .Cm ca
                    631: section of the configuration file
                    632: (or in the default section of the configuration file),
                    633: specified using
                    634: .Cm default_ca
                    635: or
                    636: .Fl name .
                    637: The options
                    638: .Cm preserve
                    639: and
                    640: .Cm msie_hack
                    641: are read directly from the
                    642: .Cm ca
                    643: section.
1.1       jsing     644: .Pp
                    645: Many of the configuration file options are identical to command line
                    646: options.
                    647: Where the option is present in the configuration file and the command line,
                    648: the command line value is used.
                    649: Where an option is described as mandatory, then it must be present in
                    650: the configuration file or the command line equivalent
                    651: .Pq if any
                    652: used.
                    653: .Bl -tag -width "XXXX"
1.35      jmc       654: .It Cm certificate
1.1       jsing     655: The same as
                    656: .Fl cert .
                    657: It gives the file containing the CA certificate.
                    658: Mandatory.
1.35      jmc       659: .It Cm copy_extensions
1.1       jsing     660: Determines how extensions in certificate requests should be handled.
                    661: If set to
1.35      jmc       662: .Cm none
1.1       jsing     663: or this option is not present, then extensions are
                    664: ignored and not copied to the certificate.
                    665: If set to
1.35      jmc       666: .Cm copy ,
1.1       jsing     667: then any extensions present in the request that are not already present
                    668: are copied to the certificate.
                    669: If set to
1.35      jmc       670: .Cm copyall ,
1.1       jsing     671: then all extensions in the request are copied to the certificate:
                    672: if the extension is already present in the certificate it is deleted first.
1.35      jmc       673: .Pp
                    674: The
                    675: .Cm copy_extensions
                    676: option should be used with caution.
                    677: If care is not taken, it can be a security risk.
                    678: For example, if a certificate request contains a
                    679: .Cm basicConstraints
                    680: extension with CA:TRUE and the
                    681: .Cm copy_extensions
                    682: value is set to
                    683: .Cm copyall
                    684: and the user does not spot
1.91      schwarze  685: this when the certificate is displayed, then this will hand the requester
1.35      jmc       686: a valid CA certificate.
                    687: .Pp
                    688: This situation can be avoided by setting
                    689: .Cm copy_extensions
                    690: to
                    691: .Cm copy
                    692: and including
                    693: .Cm basicConstraints
                    694: with CA:FALSE in the configuration file.
                    695: Then if the request contains a
                    696: .Cm basicConstraints
                    697: extension, it will be ignored.
1.1       jsing     698: .Pp
                    699: The main use of this option is to allow a certificate request to supply
                    700: values for certain extensions such as
1.35      jmc       701: .Cm subjectAltName .
                    702: .It Cm crl_extensions
1.1       jsing     703: The same as
                    704: .Fl crlexts .
1.35      jmc       705: .It Cm crlnumber
1.1       jsing     706: A text file containing the next CRL number to use in hex.
                    707: The CRL number will be inserted in the CRLs only if this file exists.
                    708: If this file is present, it must contain a valid CRL number.
1.35      jmc       709: .It Cm database
1.1       jsing     710: The text database file to use.
                    711: Mandatory.
                    712: This file must be present, though initially it will be empty.
1.35      jmc       713: .It Cm default_crl_hours , default_crl_days
1.1       jsing     714: The same as the
                    715: .Fl crlhours
                    716: and
                    717: .Fl crldays
                    718: options.
                    719: These will only be used if neither command line option is present.
                    720: At least one of these must be present to generate a CRL.
1.35      jmc       721: .It Cm default_days
1.1       jsing     722: The same as the
                    723: .Fl days
                    724: option.
                    725: The number of days to certify a certificate for.
1.35      jmc       726: .It Cm default_enddate
1.1       jsing     727: The same as the
                    728: .Fl enddate
                    729: option.
                    730: Either this option or
1.35      jmc       731: .Cm default_days
1.1       jsing     732: .Pq or the command line equivalents
                    733: must be present.
1.35      jmc       734: .It Cm default_md
1.1       jsing     735: The same as the
                    736: .Fl md
                    737: option.
                    738: The message digest to use.
                    739: Mandatory.
1.35      jmc       740: .It Cm default_startdate
1.1       jsing     741: The same as the
                    742: .Fl startdate
                    743: option.
                    744: The start date to certify a certificate for.
                    745: If not set, the current time is used.
1.35      jmc       746: .It Cm email_in_dn
1.1       jsing     747: The same as
                    748: .Fl noemailDN .
                    749: If the EMAIL field is to be removed from the DN of the certificate,
                    750: simply set this to
                    751: .Qq no .
                    752: If not present, the default is to allow for the EMAIL field in the
                    753: certificate's DN.
1.35      jmc       754: .It Cm msie_hack
1.1       jsing     755: The same as
                    756: .Fl msie_hack .
1.35      jmc       757: .It Cm name_opt , cert_opt
1.1       jsing     758: These options allow the format used to display the certificate details
                    759: when asking the user to confirm signing.
                    760: All the options supported by the
                    761: .Nm x509
                    762: utilities'
                    763: .Fl nameopt
                    764: and
                    765: .Fl certopt
                    766: switches can be used here, except that
1.35      jmc       767: .Cm no_signame
1.1       jsing     768: and
1.35      jmc       769: .Cm no_sigdump
1.1       jsing     770: are permanently set and cannot be disabled
                    771: (this is because the certificate signature cannot be displayed because
                    772: the certificate has not been signed at this point).
                    773: .Pp
                    774: For convenience, the value
1.35      jmc       775: .Cm ca_default
1.1       jsing     776: is accepted by both to produce a reasonable output.
                    777: .Pp
                    778: If neither option is present, the format used in earlier versions of
1.35      jmc       779: .Nm openssl
1.1       jsing     780: is used.
1.81      jmc       781: Use of the old format is strongly discouraged
                    782: because it only displays fields mentioned in the
1.35      jmc       783: .Cm policy
1.1       jsing     784: section,
                    785: mishandles multicharacter string types and does not display extensions.
1.35      jmc       786: .It Cm new_certs_dir
1.1       jsing     787: The same as the
                    788: .Fl outdir
                    789: command line option.
                    790: It specifies the directory where new certificates will be placed.
                    791: Mandatory.
1.35      jmc       792: .It Cm oid_file
1.1       jsing     793: This specifies a file containing additional object identifiers.
                    794: Each line of the file should consist of the numerical form of the
                    795: object identifier followed by whitespace, then the short name followed
                    796: by whitespace and finally the long name.
1.35      jmc       797: .It Cm oid_section
1.1       jsing     798: This specifies a section in the configuration file containing extra
                    799: object identifiers.
                    800: Each line should consist of the short name of the object identifier
                    801: followed by
                    802: .Sq =
                    803: and the numerical form.
                    804: The short and long names are the same when this option is used.
1.35      jmc       805: .It Cm policy
1.1       jsing     806: The same as
                    807: .Fl policy .
                    808: Mandatory.
1.35      jmc       809: .It Cm preserve
1.1       jsing     810: The same as
                    811: .Fl preserveDN .
1.35      jmc       812: .It Cm private_key
1.1       jsing     813: Same as the
                    814: .Fl keyfile
                    815: option.
                    816: The file containing the CA private key.
                    817: Mandatory.
1.35      jmc       818: .It Cm serial
1.1       jsing     819: A text file containing the next serial number to use in hex.
                    820: Mandatory.
                    821: This file must be present and contain a valid serial number.
1.35      jmc       822: .It Cm unique_subject
1.1       jsing     823: If the value
1.35      jmc       824: .Cm yes
1.1       jsing     825: is given, the valid certificate entries in the
                    826: database must have unique subjects.
                    827: If the value
1.35      jmc       828: .Cm no
1.1       jsing     829: is given,
                    830: several valid certificate entries may have the exact same subject.
                    831: The default value is
1.35      jmc       832: .Cm yes .
                    833: .It Cm x509_extensions
1.1       jsing     834: The same as
                    835: .Fl extensions .
                    836: .El
                    837: .Sh CIPHERS
                    838: .Nm openssl ciphers
                    839: .Op Fl hVv
                    840: .Op Ar cipherlist
                    841: .Pp
                    842: The
                    843: .Nm ciphers
                    844: command converts
1.36      jmc       845: .Nm openssl
1.1       jsing     846: cipher lists into ordered SSL cipher preference lists.
1.41      jmc       847: It can be used as a way to determine the appropriate cipher list.
1.1       jsing     848: .Pp
                    849: The options are as follows:
                    850: .Bl -tag -width Ds
                    851: .It Fl h , \&?
                    852: Print a brief usage message.
                    853: .It Fl V
1.36      jmc       854: Verbose.
1.92    ! schwarze  855: List ciphers with cipher suite code in hex format,
        !           856: cipher name, and a complete description of protocol version,
        !           857: key exchange, authentication, encryption, and mac algorithms.
1.36      jmc       858: .It Fl v
1.1       jsing     859: Like
1.36      jmc       860: .Fl V ,
                    861: but without cipher suite codes.
1.1       jsing     862: .It Ar cipherlist
                    863: A cipher list to convert to a cipher preference list.
                    864: If it is not included, the default cipher list will be used.
1.36      jmc       865: .Pp
                    866: The cipher list consists of one or more cipher strings
1.1       jsing     867: separated by colons.
                    868: Commas or spaces are also acceptable separators, but colons are normally used.
                    869: .Pp
1.36      jmc       870: The actual cipher string can take several different forms:
1.1       jsing     871: .Pp
1.36      jmc       872: It can consist of a single cipher suite, such as RC4-SHA.
1.1       jsing     873: .Pp
                    874: It can represent a list of cipher suites containing a certain algorithm,
                    875: or cipher suites of a certain type.
1.36      jmc       876: For example SHA1 represents all cipher suites using the digest algorithm SHA1.
                    877: .Pp
                    878: Lists of cipher suites can be combined in a single cipher string using the
1.1       jsing     879: .Sq +
1.36      jmc       880: character
                    881: (logical AND operation).
                    882: For example, SHA1+DES represents all cipher suites
                    883: containing the SHA1 and DES algorithms.
1.1       jsing     884: .Pp
                    885: Each cipher string can be optionally preceded by the characters
                    886: .Sq \&! ,
                    887: .Sq - ,
                    888: or
                    889: .Sq + .
                    890: If
                    891: .Sq !\&
                    892: is used, then the ciphers are permanently deleted from the list.
                    893: The ciphers deleted can never reappear in the list even if they are
                    894: explicitly stated.
                    895: If
                    896: .Sq -
                    897: is used, then the ciphers are deleted from the list, but some or
                    898: all of the ciphers can be added again by later options.
                    899: If
                    900: .Sq +
                    901: is used, then the ciphers are moved to the end of the list.
                    902: This option doesn't add any new ciphers, it just moves matching existing ones.
                    903: .Pp
                    904: If none of these characters is present, the string is just interpreted
                    905: as a list of ciphers to be appended to the current preference list.
                    906: If the list includes any ciphers already present, they will be ignored;
                    907: that is, they will not be moved to the end of the list.
                    908: .Pp
                    909: Additionally, the cipher string
1.36      jmc       910: .Cm @STRENGTH
1.1       jsing     911: can be used at any point to sort the current cipher list in order of
                    912: encryption algorithm key length.
1.36      jmc       913: .El
                    914: .Pp
1.1       jsing     915: The following is a list of all permitted cipher strings and their meanings.
                    916: .Bl -tag -width "XXXX"
1.36      jmc       917: .It Cm DEFAULT
1.1       jsing     918: The default cipher list.
                    919: This is determined at compile time and is currently
1.36      jmc       920: .Cm ALL:!aNULL:!eNULL:!SSLv2 .
                    921: This must be the first cipher string specified.
                    922: .It Cm COMPLEMENTOFDEFAULT
1.1       jsing     923: The ciphers included in
1.36      jmc       924: .Cm ALL ,
1.1       jsing     925: but not enabled by default.
                    926: Currently this is
1.36      jmc       927: .Cm ADH .
1.1       jsing     928: Note that this rule does not cover
1.36      jmc       929: .Cm eNULL ,
1.1       jsing     930: which is not included by
1.36      jmc       931: .Cm ALL
1.1       jsing     932: (use
1.36      jmc       933: .Cm COMPLEMENTOFALL
1.1       jsing     934: if necessary).
1.36      jmc       935: .It Cm ALL
1.1       jsing     936: All cipher suites except the
1.36      jmc       937: .Cm eNULL
                    938: ciphers, which must be explicitly enabled.
                    939: .It Cm COMPLEMENTOFALL
1.1       jsing     940: The cipher suites not enabled by
1.36      jmc       941: .Cm ALL ,
1.1       jsing     942: currently being
1.36      jmc       943: .Cm eNULL .
                    944: .It Cm HIGH
1.1       jsing     945: .Qq High
                    946: encryption cipher suites.
                    947: This currently means those with key lengths larger than 128 bits.
1.36      jmc       948: .It Cm MEDIUM
1.1       jsing     949: .Qq Medium
                    950: encryption cipher suites, currently those using 128-bit encryption.
1.36      jmc       951: .It Cm LOW
1.1       jsing     952: .Qq Low
                    953: encryption cipher suites, currently those using 64- or 56-bit encryption
1.9       lteo      954: algorithms.
1.36      jmc       955: .It Cm eNULL , NULL
1.1       jsing     956: The
                    957: .Qq NULL
                    958: ciphers; that is, those offering no encryption.
                    959: Because these offer no encryption at all and are a security risk,
                    960: they are disabled unless explicitly included.
1.36      jmc       961: .It Cm aNULL
1.1       jsing     962: The cipher suites offering no authentication.
                    963: This is currently the anonymous DH algorithms.
                    964: These cipher suites are vulnerable to a
                    965: .Qq man in the middle
                    966: attack, so their use is normally discouraged.
1.36      jmc       967: .It Cm kRSA , RSA
1.1       jsing     968: Cipher suites using RSA key exchange.
1.36      jmc       969: .It Cm kEDH
1.1       jsing     970: Cipher suites using ephemeral DH key agreement.
1.36      jmc       971: .It Cm aRSA
1.1       jsing     972: Cipher suites using RSA authentication, i.e. the certificates carry RSA keys.
1.36      jmc       973: .It Cm aDSS , DSS
1.1       jsing     974: Cipher suites using DSS authentication, i.e. the certificates carry DSS keys.
1.36      jmc       975: .It Cm TLSv1
1.18      jmc       976: TLS v1.0 cipher suites.
1.36      jmc       977: .It Cm DH
1.1       jsing     978: Cipher suites using DH, including anonymous DH.
1.36      jmc       979: .It Cm ADH
1.1       jsing     980: Anonymous DH cipher suites.
1.36      jmc       981: .It Cm AES
1.1       jsing     982: Cipher suites using AES.
1.36      jmc       983: .It Cm 3DES
1.1       jsing     984: Cipher suites using triple DES.
1.36      jmc       985: .It Cm DES
1.1       jsing     986: Cipher suites using DES
                    987: .Pq not triple DES .
1.36      jmc       988: .It Cm RC4
1.1       jsing     989: Cipher suites using RC4.
1.36      jmc       990: .It Cm CAMELLIA
1.9       lteo      991: Cipher suites using Camellia.
1.36      jmc       992: .It Cm CHACHA20
1.9       lteo      993: Cipher suites using ChaCha20.
1.36      jmc       994: .It Cm IDEA
1.9       lteo      995: Cipher suites using IDEA.
1.36      jmc       996: .It Cm MD5
1.1       jsing     997: Cipher suites using MD5.
1.36      jmc       998: .It Cm SHA1 , SHA
1.1       jsing     999: Cipher suites using SHA1.
                   1000: .El
                   1001: .Sh CRL
                   1002: .nr nS 1
                   1003: .Nm "openssl crl"
                   1004: .Op Fl CAfile Ar file
                   1005: .Op Fl CApath Ar dir
                   1006: .Op Fl fingerprint
                   1007: .Op Fl hash
                   1008: .Op Fl in Ar file
1.38      jmc      1009: .Op Fl inform Cm der | pem
1.1       jsing    1010: .Op Fl issuer
                   1011: .Op Fl lastupdate
                   1012: .Op Fl nextupdate
                   1013: .Op Fl noout
                   1014: .Op Fl out Ar file
1.38      jmc      1015: .Op Fl outform Cm der | pem
1.1       jsing    1016: .Op Fl text
                   1017: .nr nS 0
                   1018: .Pp
                   1019: The
                   1020: .Nm crl
                   1021: command processes CRL files in DER or PEM format.
1.37      jmc      1022: .Pp
1.1       jsing    1023: The options are as follows:
                   1024: .Bl -tag -width Ds
                   1025: .It Fl CAfile Ar file
                   1026: Verify the signature on a CRL by looking up the issuing certificate in
                   1027: .Ar file .
                   1028: .It Fl CApath Ar directory
                   1029: Verify the signature on a CRL by looking up the issuing certificate in
                   1030: .Ar dir .
                   1031: This directory must be a standard certificate directory,
                   1032: i.e. a hash of each subject name (using
                   1033: .Cm x509 Fl hash )
                   1034: should be linked to each certificate.
                   1035: .It Fl fingerprint
                   1036: Print the CRL fingerprint.
                   1037: .It Fl hash
                   1038: Output a hash of the issuer name.
                   1039: This can be used to look up CRLs in a directory by issuer name.
                   1040: .It Fl in Ar file
1.37      jmc      1041: The input file to read from, or standard input if not specified.
1.38      jmc      1042: .It Fl inform Cm der | pem
1.37      jmc      1043: The input format.
1.1       jsing    1044: .It Fl issuer
                   1045: Output the issuer name.
                   1046: .It Fl lastupdate
                   1047: Output the
1.37      jmc      1048: .Cm lastUpdate
1.1       jsing    1049: field.
                   1050: .It Fl nextupdate
                   1051: Output the
1.37      jmc      1052: .Cm nextUpdate
1.1       jsing    1053: field.
                   1054: .It Fl noout
1.46      jmc      1055: Do not output the encoded version of the CRL.
1.1       jsing    1056: .It Fl out Ar file
1.37      jmc      1057: The output file to write to, or standard output if not specified.
1.38      jmc      1058: .It Fl outform Cm der | pem
1.37      jmc      1059: The output format.
1.1       jsing    1060: .It Fl text
1.64      jmc      1061: Print the CRL in plain text.
1.1       jsing    1062: .El
                   1063: .Sh CRL2PKCS7
                   1064: .nr nS 1
                   1065: .Nm "openssl crl2pkcs7"
                   1066: .Op Fl certfile Ar file
                   1067: .Op Fl in Ar file
1.40      jmc      1068: .Op Fl inform Cm der | pem
1.1       jsing    1069: .Op Fl nocrl
                   1070: .Op Fl out Ar file
1.40      jmc      1071: .Op Fl outform Cm der | pem
1.1       jsing    1072: .nr nS 0
                   1073: .Pp
                   1074: The
                   1075: .Nm crl2pkcs7
                   1076: command takes an optional CRL and one or more
                   1077: certificates and converts them into a PKCS#7 degenerate
                   1078: .Qq certificates only
                   1079: structure.
                   1080: .Pp
                   1081: The options are as follows:
                   1082: .Bl -tag -width Ds
                   1083: .It Fl certfile Ar file
1.40      jmc      1084: Add the certificates in PEM
1.1       jsing    1085: .Ar file
1.40      jmc      1086: to the PKCS#7 structure.
                   1087: This option can be used more than once
                   1088: to read certificates from multiple files.
1.1       jsing    1089: .It Fl in Ar file
1.40      jmc      1090: Read the CRL from
                   1091: .Ar file ,
                   1092: or standard input if not specified.
                   1093: .It Fl inform Cm der | pem
1.64      jmc      1094: The input format.
1.1       jsing    1095: .It Fl nocrl
                   1096: Normally, a CRL is included in the output file.
                   1097: With this option, no CRL is
                   1098: included in the output file and a CRL is not read from the input file.
                   1099: .It Fl out Ar file
1.40      jmc      1100: Write the PKCS#7 structure to
                   1101: .Ar file ,
                   1102: or standard output if not specified.
                   1103: .It Fl outform Cm der | pem
1.64      jmc      1104: The output format.
1.1       jsing    1105: .El
                   1106: .Sh DGST
                   1107: .nr nS 1
                   1108: .Nm "openssl dgst"
1.43      jmc      1109: .Op Fl cd
1.1       jsing    1110: .Op Fl binary
1.43      jmc      1111: .Op Fl Ar digest
1.1       jsing    1112: .Op Fl hex
                   1113: .Op Fl hmac Ar key
1.43      jmc      1114: .Op Fl keyform Cm pem
1.1       jsing    1115: .Op Fl mac Ar algorithm
                   1116: .Op Fl macopt Ar nm : Ns Ar v
                   1117: .Op Fl out Ar file
                   1118: .Op Fl passin Ar arg
                   1119: .Op Fl prverify Ar file
                   1120: .Op Fl sign Ar file
                   1121: .Op Fl signature Ar file
                   1122: .Op Fl sigopt Ar nm : Ns Ar v
                   1123: .Op Fl verify Ar file
                   1124: .Op Ar
                   1125: .nr nS 0
                   1126: .Pp
                   1127: The digest functions output the message digest of a supplied
                   1128: .Ar file
                   1129: or
                   1130: .Ar files
                   1131: in hexadecimal form.
                   1132: They can also be used for digital signing and verification.
                   1133: .Pp
                   1134: The options are as follows:
                   1135: .Bl -tag -width Ds
                   1136: .It Fl binary
                   1137: Output the digest or signature in binary form.
                   1138: .It Fl c
1.48      jmc      1139: Print the digest in two-digit groups separated by colons.
1.1       jsing    1140: .It Fl d
1.48      jmc      1141: Print BIO debugging information.
1.43      jmc      1142: .It Fl Ar digest
                   1143: Use the specified message
                   1144: .Ar digest .
                   1145: The default is MD5.
                   1146: The available digests can be displayed using
                   1147: .Nm openssl
                   1148: .Cm list-message-digest-commands .
                   1149: The following are equivalent:
                   1150: .Nm openssl dgst
                   1151: .Fl md5
                   1152: and
                   1153: .Nm openssl
                   1154: .Cm md5 .
1.1       jsing    1155: .It Fl hex
                   1156: Digest is to be output as a hex dump.
                   1157: This is the default case for a
                   1158: .Qq normal
                   1159: digest as opposed to a digital signature.
                   1160: .It Fl hmac Ar key
                   1161: Create a hashed MAC using
                   1162: .Ar key .
1.43      jmc      1163: .It Fl keyform Cm pem
1.1       jsing    1164: Specifies the key format to sign the digest with.
                   1165: .It Fl mac Ar algorithm
                   1166: Create a keyed Message Authentication Code (MAC).
                   1167: The most popular MAC algorithm is HMAC (hash-based MAC),
                   1168: but there are other MAC algorithms which are not based on hash.
                   1169: MAC keys and other options should be set via the
                   1170: .Fl macopt
                   1171: parameter.
                   1172: .It Fl macopt Ar nm : Ns Ar v
                   1173: Passes options to the MAC algorithm, specified by
                   1174: .Fl mac .
                   1175: The following options are supported by HMAC:
                   1176: .Bl -tag -width Ds
1.43      jmc      1177: .It Cm key : Ns Ar string
1.1       jsing    1178: Specifies the MAC key as an alphanumeric string
                   1179: (use if the key contain printable characters only).
                   1180: String length must conform to any restrictions of the MAC algorithm.
1.43      jmc      1181: .It Cm hexkey : Ns Ar string
1.1       jsing    1182: Specifies the MAC key in hexadecimal form (two hex digits per byte).
                   1183: Key length must conform to any restrictions of the MAC algorithm.
                   1184: .El
                   1185: .It Fl out Ar file
1.43      jmc      1186: The output file to write to,
                   1187: or standard output if not specified.
1.1       jsing    1188: .It Fl passin Ar arg
                   1189: The key password source.
                   1190: .It Fl prverify Ar file
                   1191: Verify the signature using the private key in
                   1192: .Ar file .
                   1193: The output is either
                   1194: .Qq Verification OK
                   1195: or
                   1196: .Qq Verification Failure .
                   1197: .It Fl sign Ar file
                   1198: Digitally sign the digest using the private key in
                   1199: .Ar file .
                   1200: .It Fl signature Ar file
                   1201: The actual signature to verify.
                   1202: .It Fl sigopt Ar nm : Ns Ar v
                   1203: Pass options to the signature algorithm during sign or verify operations.
                   1204: The names and values of these options are algorithm-specific.
                   1205: .It Fl verify Ar file
                   1206: Verify the signature using the public key in
                   1207: .Ar file .
                   1208: The output is either
                   1209: .Qq Verification OK
                   1210: or
                   1211: .Qq Verification Failure .
                   1212: .It Ar
                   1213: File or files to digest.
                   1214: If no files are specified then standard input is used.
                   1215: .El
                   1216: .Sh DHPARAM
                   1217: .nr nS 1
                   1218: .Nm "openssl dhparam"
                   1219: .Op Fl 2 | 5
                   1220: .Op Fl C
                   1221: .Op Fl check
                   1222: .Op Fl dsaparam
                   1223: .Op Fl in Ar file
1.44      jmc      1224: .Op Fl inform Cm der | pem
1.1       jsing    1225: .Op Fl noout
                   1226: .Op Fl out Ar file
1.44      jmc      1227: .Op Fl outform Cm der | pem
1.1       jsing    1228: .Op Fl text
                   1229: .Op Ar numbits
                   1230: .nr nS 0
                   1231: .Pp
                   1232: The
                   1233: .Nm dhparam
                   1234: command is used to manipulate DH parameter files.
1.44      jmc      1235: Only the older PKCS#3 DH is supported,
                   1236: not the newer X9.42 DH.
1.1       jsing    1237: .Pp
                   1238: The options are as follows:
                   1239: .Bl -tag -width Ds
                   1240: .It Fl 2 , 5
1.44      jmc      1241: The generator to use;
1.1       jsing    1242: 2 is the default.
                   1243: If present, the input file is ignored and parameters are generated instead.
                   1244: .It Fl C
1.44      jmc      1245: Convert the parameters into C code.
1.1       jsing    1246: The parameters can then be loaded by calling the
1.44      jmc      1247: .No get_dh Ns Ar numbits
1.1       jsing    1248: function.
                   1249: .It Fl check
                   1250: Check the DH parameters.
                   1251: .It Fl dsaparam
1.44      jmc      1252: Read or create DSA parameters,
                   1253: converted to DH format on output.
1.1       jsing    1254: Otherwise,
                   1255: .Qq strong
                   1256: primes
                   1257: .Pq such that (p-1)/2 is also prime
                   1258: will be used for DH parameter generation.
                   1259: .Pp
                   1260: DH parameter generation with the
                   1261: .Fl dsaparam
                   1262: option is much faster,
                   1263: and the recommended exponent length is shorter,
                   1264: which makes DH key exchange more efficient.
                   1265: Beware that with such DSA-style DH parameters,
                   1266: a fresh DH key should be created for each use to
                   1267: avoid small-subgroup attacks that may be possible otherwise.
                   1268: .It Fl in Ar file
1.44      jmc      1269: The input file to read from,
                   1270: or standard input if not specified.
                   1271: .It Fl inform Cm der | pem
                   1272: The input format.
1.1       jsing    1273: .It Fl noout
1.46      jmc      1274: Do not output the encoded version of the parameters.
1.44      jmc      1275: .It Fl out Ar file
                   1276: The output file to write to,
                   1277: or standard output if not specified.
                   1278: .It Fl outform Cm der | pem
                   1279: The output format.
                   1280: .It Fl text
1.64      jmc      1281: Print the DH parameters in plain text.
1.1       jsing    1282: .It Ar numbits
1.44      jmc      1283: Generate a parameter set of size
1.1       jsing    1284: .Ar numbits .
                   1285: It must be the last option.
1.16      sthen    1286: If not present, a value of 2048 is used.
1.1       jsing    1287: If this value is present, the input file is ignored and
                   1288: parameters are generated instead.
                   1289: .El
                   1290: .Sh DSA
                   1291: .nr nS 1
                   1292: .Nm "openssl dsa"
                   1293: .Oo
                   1294: .Fl aes128 | aes192 | aes256 |
                   1295: .Fl des | des3
                   1296: .Oc
                   1297: .Op Fl in Ar file
1.45      jmc      1298: .Op Fl inform Cm der | pem
1.1       jsing    1299: .Op Fl modulus
                   1300: .Op Fl noout
                   1301: .Op Fl out Ar file
1.45      jmc      1302: .Op Fl outform Cm der | pem
1.1       jsing    1303: .Op Fl passin Ar arg
                   1304: .Op Fl passout Ar arg
                   1305: .Op Fl pubin
                   1306: .Op Fl pubout
                   1307: .Op Fl text
                   1308: .nr nS 0
                   1309: .Pp
                   1310: The
                   1311: .Nm dsa
                   1312: command processes DSA keys.
                   1313: They can be converted between various forms and their components printed out.
                   1314: .Pp
                   1315: .Sy Note :
                   1316: This command uses the traditional
                   1317: .Nm SSLeay
                   1318: compatible format for private key encryption:
                   1319: newer applications should use the more secure PKCS#8 format using the
                   1320: .Nm pkcs8
                   1321: command.
                   1322: .Pp
                   1323: The options are as follows:
                   1324: .Bl -tag -width Ds
                   1325: .It Xo
                   1326: .Fl aes128 | aes192 | aes256 |
                   1327: .Fl des | des3
                   1328: .Xc
1.45      jmc      1329: Encrypt the private key with the AES, DES, or the triple DES
1.1       jsing    1330: ciphers, respectively, before outputting it.
                   1331: A pass phrase is prompted for.
1.45      jmc      1332: If none of these options are specified, the key is written in plain text.
1.1       jsing    1333: This means that using the
                   1334: .Nm dsa
1.45      jmc      1335: utility to read an encrypted key with no encryption option can be used to
1.1       jsing    1336: remove the pass phrase from a key,
1.45      jmc      1337: or by setting the encryption options it can be used to add or change
1.1       jsing    1338: the pass phrase.
                   1339: These options can only be used with PEM format output files.
                   1340: .It Fl in Ar file
1.45      jmc      1341: The input file to read from,
                   1342: or standard input if not specified.
1.1       jsing    1343: If the key is encrypted, a pass phrase will be prompted for.
1.45      jmc      1344: .It Fl inform Cm der | pem
                   1345: The input format.
1.1       jsing    1346: .It Fl modulus
1.45      jmc      1347: Print the value of the public key component of the key.
1.1       jsing    1348: .It Fl noout
1.46      jmc      1349: Do not output the encoded version of the key.
1.1       jsing    1350: .It Fl out Ar file
1.45      jmc      1351: The output file to write to,
                   1352: or standard output if not specified.
1.1       jsing    1353: If any encryption options are set then a pass phrase will be
                   1354: prompted for.
1.45      jmc      1355: .It Fl outform Cm der | pem
                   1356: The output format.
1.1       jsing    1357: .It Fl passin Ar arg
                   1358: The key password source.
                   1359: .It Fl passout Ar arg
                   1360: The output file password source.
                   1361: .It Fl pubin
1.60      jmc      1362: Read in a public key, not a private key.
1.1       jsing    1363: .It Fl pubout
1.60      jmc      1364: Output a public key, not a private key.
                   1365: Automatically set if the input is a public key.
1.1       jsing    1366: .It Fl text
1.64      jmc      1367: Print the public/private key in plain text.
1.1       jsing    1368: .El
                   1369: .Sh DSAPARAM
                   1370: .nr nS 1
                   1371: .Nm "openssl dsaparam"
                   1372: .Op Fl C
                   1373: .Op Fl genkey
                   1374: .Op Fl in Ar file
1.46      jmc      1375: .Op Fl inform Cm der | pem
1.1       jsing    1376: .Op Fl noout
                   1377: .Op Fl out Ar file
1.46      jmc      1378: .Op Fl outform Cm der | pem
1.1       jsing    1379: .Op Fl text
                   1380: .Op Ar numbits
                   1381: .nr nS 0
                   1382: .Pp
                   1383: The
                   1384: .Nm dsaparam
                   1385: command is used to manipulate or generate DSA parameter files.
                   1386: .Pp
                   1387: The options are as follows:
                   1388: .Bl -tag -width Ds
                   1389: .It Fl C
1.46      jmc      1390: Convert the parameters into C code.
1.1       jsing    1391: The parameters can then be loaded by calling the
1.46      jmc      1392: .No get_dsa Ns Ar XXX
1.1       jsing    1393: function.
                   1394: .It Fl genkey
1.46      jmc      1395: Generate a DSA key either using the specified or generated
1.1       jsing    1396: parameters.
                   1397: .It Fl in Ar file
1.46      jmc      1398: The input file to read from,
                   1399: or standard input if not specified.
1.1       jsing    1400: If the
                   1401: .Ar numbits
1.46      jmc      1402: parameter is included, then this option is ignored.
                   1403: .It Fl inform Cm der | pem
                   1404: The input format.
1.1       jsing    1405: .It Fl noout
1.46      jmc      1406: Do not output the encoded version of the parameters.
                   1407: .It Fl out Ar file
                   1408: The output file to write to,
                   1409: or standard output if not specified.
                   1410: .It Fl outform Cm der | pem
                   1411: The output format.
                   1412: .It Fl text
1.64      jmc      1413: Print the DSA parameters in plain text.
1.1       jsing    1414: .It Ar numbits
1.46      jmc      1415: Generate a parameter set of size
1.1       jsing    1416: .Ar numbits .
1.46      jmc      1417: If this option is included, the input file is ignored.
1.1       jsing    1418: .El
                   1419: .Sh EC
                   1420: .nr nS 1
                   1421: .Nm "openssl ec"
                   1422: .Op Fl conv_form Ar arg
                   1423: .Op Fl des
                   1424: .Op Fl des3
                   1425: .Op Fl in Ar file
1.47      jmc      1426: .Op Fl inform Cm der | pem
1.1       jsing    1427: .Op Fl noout
                   1428: .Op Fl out Ar file
1.47      jmc      1429: .Op Fl outform Cm der | pem
1.1       jsing    1430: .Op Fl param_enc Ar arg
                   1431: .Op Fl param_out
                   1432: .Op Fl passin Ar arg
                   1433: .Op Fl passout Ar arg
                   1434: .Op Fl pubin
                   1435: .Op Fl pubout
                   1436: .Op Fl text
                   1437: .nr nS 0
                   1438: .Pp
                   1439: The
                   1440: .Nm ec
                   1441: command processes EC keys.
                   1442: They can be converted between various
                   1443: forms and their components printed out.
1.47      jmc      1444: .Nm openssl
1.1       jsing    1445: uses the private key format specified in
                   1446: .Dq SEC 1: Elliptic Curve Cryptography
                   1447: .Pq Lk http://www.secg.org/ .
                   1448: To convert an
                   1449: EC private key into the PKCS#8 private key format use the
                   1450: .Nm pkcs8
                   1451: command.
                   1452: .Pp
                   1453: The options are as follows:
                   1454: .Bl -tag -width Ds
                   1455: .It Fl conv_form Ar arg
1.47      jmc      1456: Specify how the points on the elliptic curve are converted
1.1       jsing    1457: into octet strings.
                   1458: Possible values are:
                   1459: .Cm compressed
1.47      jmc      1460: (the default),
1.1       jsing    1461: .Cm uncompressed ,
                   1462: and
                   1463: .Cm hybrid .
                   1464: For more information regarding
1.47      jmc      1465: the point conversion forms see the X9.62 standard.
1.1       jsing    1466: Note:
                   1467: Due to patent issues the
                   1468: .Cm compressed
                   1469: option is disabled by default for binary curves
                   1470: and can be enabled by defining the preprocessor macro
1.47      jmc      1471: .Dv OPENSSL_EC_BIN_PT_COMP
1.1       jsing    1472: at compile time.
                   1473: .It Fl des | des3
1.47      jmc      1474: Encrypt the private key with DES, triple DES, or
1.1       jsing    1475: any other cipher supported by
1.47      jmc      1476: .Nm openssl .
1.1       jsing    1477: A pass phrase is prompted for.
                   1478: If none of these options is specified the key is written in plain text.
                   1479: This means that using the
                   1480: .Nm ec
                   1481: utility to read in an encrypted key with no
                   1482: encryption option can be used to remove the pass phrase from a key,
                   1483: or by setting the encryption options
1.83      naddy    1484: it can be used to add or change the pass phrase.
1.1       jsing    1485: These options can only be used with PEM format output files.
                   1486: .It Fl in Ar file
1.47      jmc      1487: The input file to read a key from,
                   1488: or standard input if not specified.
1.1       jsing    1489: If the key is encrypted a pass phrase will be prompted for.
1.47      jmc      1490: .It Fl inform Cm der | pem
                   1491: The input format.
1.1       jsing    1492: .It Fl noout
1.47      jmc      1493: Do not output the encoded version of the key.
1.1       jsing    1494: .It Fl out Ar file
1.47      jmc      1495: The output filename to write to,
                   1496: or standard output if not specified.
1.1       jsing    1497: If any encryption options are set then a pass phrase will be prompted for.
1.47      jmc      1498: .It Fl outform Cm der | pem
                   1499: The output format.
1.1       jsing    1500: .It Fl param_enc Ar arg
1.47      jmc      1501: Specify how the elliptic curve parameters are encoded.
1.1       jsing    1502: Possible value are:
                   1503: .Cm named_curve ,
                   1504: i.e. the EC parameters are specified by an OID; or
                   1505: .Cm explicit ,
                   1506: where the EC parameters are explicitly given
                   1507: (see RFC 3279 for the definition of the EC parameter structures).
                   1508: The default value is
                   1509: .Cm named_curve .
                   1510: Note: the
                   1511: .Cm implicitlyCA
                   1512: alternative,
                   1513: as specified in RFC 3279,
1.47      jmc      1514: is currently not implemented.
1.1       jsing    1515: .It Fl passin Ar arg
                   1516: The key password source.
                   1517: .It Fl passout Ar arg
                   1518: The output file password source.
                   1519: .It Fl pubin
1.60      jmc      1520: Read in a public key, not a private key.
1.1       jsing    1521: .It Fl pubout
1.60      jmc      1522: Output a public key, not a private key.
                   1523: Automatically set if the input is a public key.
1.1       jsing    1524: .It Fl text
1.64      jmc      1525: Print the public/private key in plain text.
1.1       jsing    1526: .El
                   1527: .Sh ECPARAM
                   1528: .nr nS 1
                   1529: .Nm "openssl ecparam"
                   1530: .Op Fl C
                   1531: .Op Fl check
                   1532: .Op Fl conv_form Ar arg
                   1533: .Op Fl genkey
                   1534: .Op Fl in Ar file
1.48      jmc      1535: .Op Fl inform Cm der | pem
1.1       jsing    1536: .Op Fl list_curves
                   1537: .Op Fl name Ar arg
                   1538: .Op Fl no_seed
                   1539: .Op Fl noout
                   1540: .Op Fl out Ar file
1.48      jmc      1541: .Op Fl outform Cm der | pem
1.1       jsing    1542: .Op Fl param_enc Ar arg
                   1543: .Op Fl text
                   1544: .nr nS 0
                   1545: .Pp
1.48      jmc      1546: The
                   1547: .Nm ecparam
                   1548: command is used to manipulate or generate EC parameter files.
                   1549: .Nm openssl
                   1550: is not able to generate new groups so
                   1551: .Nm ecparam
                   1552: can only create EC parameters from known (named) curves.
                   1553: .Pp
1.1       jsing    1554: The options are as follows:
                   1555: .Bl -tag -width Ds
                   1556: .It Fl C
                   1557: Convert the EC parameters into C code.
                   1558: The parameters can then be loaded by calling the
1.48      jmc      1559: .No get_ec_group_ Ns Ar XXX
1.1       jsing    1560: function.
                   1561: .It Fl check
                   1562: Validate the elliptic curve parameters.
                   1563: .It Fl conv_form Ar arg
                   1564: Specify how the points on the elliptic curve are converted
                   1565: into octet strings.
                   1566: Possible values are:
                   1567: .Cm compressed
1.48      jmc      1568: (the default),
1.1       jsing    1569: .Cm uncompressed ,
                   1570: and
                   1571: .Cm hybrid .
                   1572: For more information regarding
1.48      jmc      1573: the point conversion forms see the X9.62 standard.
1.1       jsing    1574: Note:
                   1575: Due to patent issues the
                   1576: .Cm compressed
                   1577: option is disabled by default for binary curves
                   1578: and can be enabled by defining the preprocessor macro
1.48      jmc      1579: .Dv OPENSSL_EC_BIN_PT_COMP
1.1       jsing    1580: at compile time.
                   1581: .It Fl genkey
                   1582: Generate an EC private key using the specified parameters.
                   1583: .It Fl in Ar file
1.48      jmc      1584: The input file to read from,
                   1585: or standard input if not specified.
                   1586: .It Fl inform Cm der | pem
                   1587: The input format.
1.1       jsing    1588: .It Fl list_curves
1.48      jmc      1589: Print a list of all
1.1       jsing    1590: currently implemented EC parameter names and exit.
                   1591: .It Fl name Ar arg
1.48      jmc      1592: Use the EC parameters with the specified "short" name.
1.1       jsing    1593: .It Fl no_seed
1.48      jmc      1594: Do not include the seed for the parameter generation
                   1595: in the ECParameters structure (see RFC 3279).
1.1       jsing    1596: .It Fl noout
1.48      jmc      1597: Do not output the encoded version of the parameters.
1.1       jsing    1598: .It Fl out Ar file
1.48      jmc      1599: The output file to write to,
                   1600: or standard output if not specified.
                   1601: .It Fl outform Cm der | pem
                   1602: The output format.
1.1       jsing    1603: .It Fl param_enc Ar arg
1.48      jmc      1604: Specify how the elliptic curve parameters are encoded.
1.1       jsing    1605: Possible value are:
                   1606: .Cm named_curve ,
                   1607: i.e. the EC parameters are specified by an OID, or
                   1608: .Cm explicit ,
                   1609: where the EC parameters are explicitly given
                   1610: (see RFC 3279 for the definition of the EC parameter structures).
                   1611: The default value is
                   1612: .Cm named_curve .
                   1613: Note: the
                   1614: .Cm implicitlyCA
                   1615: alternative, as specified in RFC 3279,
1.48      jmc      1616: is currently not implemented.
1.1       jsing    1617: .It Fl text
1.64      jmc      1618: Print the EC parameters in plain text.
1.1       jsing    1619: .El
                   1620: .Sh ENC
                   1621: .nr nS 1
                   1622: .Nm "openssl enc"
                   1623: .Fl ciphername
                   1624: .Op Fl AadePp
                   1625: .Op Fl base64
                   1626: .Op Fl bufsize Ar number
                   1627: .Op Fl debug
                   1628: .Op Fl in Ar file
                   1629: .Op Fl iv Ar IV
                   1630: .Op Fl K Ar key
                   1631: .Op Fl k Ar password
                   1632: .Op Fl kfile Ar file
                   1633: .Op Fl md Ar digest
                   1634: .Op Fl none
                   1635: .Op Fl nopad
                   1636: .Op Fl nosalt
                   1637: .Op Fl out Ar file
                   1638: .Op Fl pass Ar arg
                   1639: .Op Fl S Ar salt
                   1640: .Op Fl salt
                   1641: .nr nS 0
                   1642: .Pp
                   1643: The symmetric cipher commands allow data to be encrypted or decrypted
                   1644: using various block and stream ciphers using keys based on passwords
                   1645: or explicitly provided.
                   1646: Base64 encoding or decoding can also be performed either by itself
                   1647: or in addition to the encryption or decryption.
1.49      jmc      1648: The program can be called either as
                   1649: .Nm openssl Ar ciphername
                   1650: or
                   1651: .Nm openssl enc - Ns Ar ciphername .
                   1652: .Pp
                   1653: Some of the ciphers do not have large keys and others have security
                   1654: implications if not used correctly.
                   1655: All the block ciphers normally use PKCS#5 padding,
                   1656: also known as standard block padding.
                   1657: If padding is disabled, the input data must be a multiple of the cipher
                   1658: block length.
1.1       jsing    1659: .Pp
                   1660: The options are as follows:
                   1661: .Bl -tag -width Ds
                   1662: .It Fl A
                   1663: If the
                   1664: .Fl a
                   1665: option is set, then base64 process the data on one line.
                   1666: .It Fl a , base64
                   1667: Base64 process the data.
                   1668: This means that if encryption is taking place, the data is base64-encoded
                   1669: after encryption.
1.49      jmc      1670: If decryption is set, the input data is base64-decoded before
1.1       jsing    1671: being decrypted.
                   1672: .It Fl bufsize Ar number
                   1673: Set the buffer size for I/O.
                   1674: .It Fl d
                   1675: Decrypt the input data.
                   1676: .It Fl debug
                   1677: Debug the BIOs used for I/O.
                   1678: .It Fl e
1.49      jmc      1679: Encrypt the input data.
                   1680: This is the default.
1.1       jsing    1681: .It Fl in Ar file
1.49      jmc      1682: The input file to read from,
1.57      jmc      1683: or standard input if not specified.
1.1       jsing    1684: .It Fl iv Ar IV
                   1685: The actual
                   1686: .Ar IV
                   1687: .Pq initialisation vector
                   1688: to use:
                   1689: this must be represented as a string comprised only of hex digits.
                   1690: When only the
                   1691: .Ar key
                   1692: is specified using the
                   1693: .Fl K
1.49      jmc      1694: option,
                   1695: the IV must explicitly be defined.
1.1       jsing    1696: When a password is being specified using one of the other options,
1.49      jmc      1697: the IV is generated from this password.
1.1       jsing    1698: .It Fl K Ar key
                   1699: The actual
                   1700: .Ar key
                   1701: to use:
                   1702: this must be represented as a string comprised only of hex digits.
1.49      jmc      1703: If only the key is specified,
                   1704: the IV must also be specified using the
1.1       jsing    1705: .Fl iv
                   1706: option.
                   1707: When both a
                   1708: .Ar key
                   1709: and a
                   1710: .Ar password
                   1711: are specified, the
                   1712: .Ar key
                   1713: given with the
                   1714: .Fl K
1.49      jmc      1715: option will be used and the IV generated from the password will be taken.
1.1       jsing    1716: It probably does not make much sense to specify both
                   1717: .Ar key
                   1718: and
                   1719: .Ar password .
                   1720: .It Fl k Ar password
                   1721: The
                   1722: .Ar password
                   1723: to derive the key from.
                   1724: Superseded by the
                   1725: .Fl pass
                   1726: option.
                   1727: .It Fl kfile Ar file
                   1728: Read the password to derive the key from the first line of
                   1729: .Ar file .
                   1730: Superseded by the
                   1731: .Fl pass
                   1732: option.
                   1733: .It Fl md Ar digest
                   1734: Use
                   1735: .Ar digest
                   1736: to create a key from a pass phrase.
                   1737: .Ar digest
                   1738: may be one of
1.49      jmc      1739: .Cm md5
1.1       jsing    1740: or
1.49      jmc      1741: .Cm sha1 .
1.1       jsing    1742: .It Fl none
                   1743: Use NULL cipher (no encryption or decryption of input).
                   1744: .It Fl nopad
                   1745: Disable standard block padding.
                   1746: .It Fl nosalt
1.49      jmc      1747: Don't use a salt in the key derivation routines.
1.81      jmc      1748: This option should never be used
1.49      jmc      1749: since it makes it possible to perform efficient dictionary
                   1750: attacks on the password and to attack stream cipher encrypted data.
1.1       jsing    1751: .It Fl out Ar file
1.51      jmc      1752: The output file to write to,
1.57      jmc      1753: or standard output if not specified.
1.1       jsing    1754: .It Fl P
1.49      jmc      1755: Print out the salt, key, and IV used, then immediately exit;
1.1       jsing    1756: don't do any encryption or decryption.
                   1757: .It Fl p
1.49      jmc      1758: Print out the salt, key, and IV used.
1.1       jsing    1759: .It Fl pass Ar arg
                   1760: The password source.
                   1761: .It Fl S Ar salt
                   1762: The actual
                   1763: .Ar salt
                   1764: to use:
                   1765: this must be represented as a string comprised only of hex digits.
                   1766: .It Fl salt
1.49      jmc      1767: Use a salt in the key derivation routines (the default).
                   1768: When the salt is being used
                   1769: the first eight bytes of the encrypted data are reserved for the salt:
                   1770: it is randomly generated when encrypting a file and read from the
                   1771: encrypted file when it is decrypted.
1.1       jsing    1772: .El
                   1773: .Sh ERRSTR
                   1774: .Nm openssl errstr
                   1775: .Op Fl stats
                   1776: .Ar errno ...
                   1777: .Pp
                   1778: The
                   1779: .Nm errstr
                   1780: command performs error number to error string conversion,
                   1781: generating a human-readable string representing the error code
                   1782: .Ar errno .
                   1783: The string is obtained through the
                   1784: .Xr ERR_error_string_n 3
                   1785: function and has the following format:
                   1786: .Pp
                   1787: .Dl error:[error code]:[library name]:[function name]:[reason string]
                   1788: .Pp
                   1789: .Bq error code
                   1790: is an 8-digit hexadecimal number.
                   1791: The remaining fields
                   1792: .Bq library name ,
                   1793: .Bq function name ,
                   1794: and
                   1795: .Bq reason string
                   1796: are all ASCII text.
                   1797: .Pp
                   1798: The options are as follows:
                   1799: .Bl -tag -width Ds
                   1800: .It Fl stats
                   1801: Print debugging statistics about various aspects of the hash table.
                   1802: .El
                   1803: .Sh GENDSA
                   1804: .nr nS 1
                   1805: .Nm "openssl gendsa"
                   1806: .Oo
                   1807: .Fl aes128 | aes192 | aes256 |
                   1808: .Fl des | des3
                   1809: .Oc
                   1810: .Op Fl out Ar file
                   1811: .Op Ar paramfile
                   1812: .nr nS 0
                   1813: .Pp
                   1814: The
                   1815: .Nm gendsa
                   1816: command generates a DSA private key from a DSA parameter file
1.51      jmc      1817: (typically generated by the
1.1       jsing    1818: .Nm openssl dsaparam
                   1819: command).
1.51      jmc      1820: DSA key generation is little more than random number generation so it is
                   1821: much quicker than,
                   1822: for example,
                   1823: RSA key generation.
1.1       jsing    1824: .Pp
                   1825: The options are as follows:
                   1826: .Bl -tag -width Ds
                   1827: .It Xo
                   1828: .Fl aes128 | aes192 | aes256 |
                   1829: .Fl des | des3
                   1830: .Xc
1.51      jmc      1831: Encrypt the private key with the AES, DES,
1.1       jsing    1832: or the triple DES ciphers, respectively, before outputting it.
                   1833: A pass phrase is prompted for.
                   1834: If none of these options are specified, no encryption is used.
                   1835: .It Fl out Ar file
1.51      jmc      1836: The output file to write to,
1.57      jmc      1837: or standard output if not specified.
1.1       jsing    1838: .It Ar paramfile
1.51      jmc      1839: Specify the DSA parameter file to use.
1.1       jsing    1840: The parameters in this file determine the size of the private key.
                   1841: .El
                   1842: .Sh GENPKEY
                   1843: .nr nS 1
                   1844: .Nm "openssl genpkey"
                   1845: .Op Fl algorithm Ar alg
                   1846: .Op Ar cipher
                   1847: .Op Fl genparam
                   1848: .Op Fl out Ar file
1.52      jmc      1849: .Op Fl outform Cm der | pem
1.1       jsing    1850: .Op Fl paramfile Ar file
                   1851: .Op Fl pass Ar arg
                   1852: .Op Fl pkeyopt Ar opt : Ns Ar value
                   1853: .Op Fl text
                   1854: .nr nS 0
                   1855: .Pp
                   1856: The
                   1857: .Nm genpkey
                   1858: command generates private keys.
                   1859: The use of this
                   1860: program is encouraged over the algorithm specific utilities
1.22      bcook    1861: because additional algorithm options can be used.
1.1       jsing    1862: .Pp
                   1863: The options are as follows:
                   1864: .Bl -tag -width Ds
                   1865: .It Fl algorithm Ar alg
                   1866: The public key algorithm to use,
                   1867: such as RSA, DSA, or DH.
1.52      jmc      1868: This option must precede any
1.1       jsing    1869: .Fl pkeyopt
                   1870: options.
                   1871: The options
                   1872: .Fl paramfile
                   1873: and
                   1874: .Fl algorithm
                   1875: are mutually exclusive.
                   1876: .It Ar cipher
                   1877: Encrypt the private key with the supplied cipher.
                   1878: Any algorithm name accepted by
1.52      jmc      1879: .Xr EVP_get_cipherbyname 3
                   1880: is acceptable.
1.1       jsing    1881: .It Fl genparam
                   1882: Generate a set of parameters instead of a private key.
1.52      jmc      1883: This option must precede any
1.1       jsing    1884: .Fl algorithm ,
                   1885: .Fl paramfile ,
                   1886: or
                   1887: .Fl pkeyopt
                   1888: options.
                   1889: .It Fl out Ar file
1.52      jmc      1890: The output file to write to,
1.57      jmc      1891: or standard output if not specified.
1.52      jmc      1892: .It Fl outform Cm der | pem
                   1893: The output format.
1.1       jsing    1894: .It Fl paramfile Ar file
1.52      jmc      1895: Some public key algorithms generate a private key based on a set of parameters,
                   1896: which can be supplied using this option.
1.1       jsing    1897: If this option is used the public key
                   1898: algorithm used is determined by the parameters.
1.52      jmc      1899: This option must precede any
1.1       jsing    1900: .Fl pkeyopt
                   1901: options.
                   1902: The options
                   1903: .Fl paramfile
                   1904: and
                   1905: .Fl algorithm
                   1906: are mutually exclusive.
                   1907: .It Fl pass Ar arg
                   1908: The output file password source.
                   1909: .It Fl pkeyopt Ar opt : Ns Ar value
                   1910: Set the public key algorithm option
                   1911: .Ar opt
                   1912: to
1.52      jmc      1913: .Ar value ,
                   1914: as follows:
1.1       jsing    1915: .Bl -tag -width Ds -offset indent
                   1916: .It rsa_keygen_bits : Ns Ar numbits
                   1917: (RSA)
                   1918: The number of bits in the generated key.
1.52      jmc      1919: The default is 2048.
1.1       jsing    1920: .It rsa_keygen_pubexp : Ns Ar value
                   1921: (RSA)
                   1922: The RSA public exponent value.
                   1923: This can be a large decimal or hexadecimal value if preceded by 0x.
1.52      jmc      1924: The default is 65537.
1.1       jsing    1925: .It dsa_paramgen_bits : Ns Ar numbits
                   1926: (DSA)
                   1927: The number of bits in the generated parameters.
1.52      jmc      1928: The default is 1024.
1.1       jsing    1929: .It dh_paramgen_prime_len : Ns Ar numbits
                   1930: (DH)
                   1931: The number of bits in the prime parameter
                   1932: .Ar p .
                   1933: .It dh_paramgen_generator : Ns Ar value
                   1934: (DH)
                   1935: The value to use for the generator
                   1936: .Ar g .
                   1937: .It ec_paramgen_curve : Ns Ar curve
                   1938: (EC)
                   1939: The EC curve to use.
                   1940: .El
1.52      jmc      1941: .It Fl text
1.64      jmc      1942: Print the private/public key in plain text.
1.52      jmc      1943: .El
1.1       jsing    1944: .Sh GENRSA
                   1945: .nr nS 1
                   1946: .Nm "openssl genrsa"
                   1947: .Op Fl 3 | f4
1.53      jmc      1948: .Op Fl aes128 | aes192 | aes256 | des | des3
1.1       jsing    1949: .Op Fl out Ar file
                   1950: .Op Fl passout Ar arg
                   1951: .Op Ar numbits
                   1952: .nr nS 0
                   1953: .Pp
                   1954: The
                   1955: .Nm genrsa
1.53      jmc      1956: command generates an RSA private key,
                   1957: which essentially involves the generation of two prime numbers.
                   1958: When generating the key,
                   1959: various symbols will be output to indicate the progress of the generation.
                   1960: A
                   1961: .Sq \&.
                   1962: represents each number which has passed an initial sieve test;
                   1963: .Sq +
                   1964: means a number has passed a single round of the Miller-Rabin primality test.
                   1965: A newline means that the number has passed all the prime tests
                   1966: (the actual number depends on the key size).
1.1       jsing    1967: .Pp
                   1968: The options are as follows:
                   1969: .Bl -tag -width Ds
                   1970: .It Fl 3 | f4
                   1971: The public exponent to use, either 3 or 65537.
                   1972: The default is 65537.
1.53      jmc      1973: .It Fl aes128 | aes192 | aes256 | des | des3
                   1974: Encrypt the private key with the AES, DES,
1.1       jsing    1975: or the triple DES ciphers, respectively, before outputting it.
                   1976: If none of these options are specified, no encryption is used.
                   1977: If encryption is used, a pass phrase is prompted for,
                   1978: if it is not supplied via the
                   1979: .Fl passout
                   1980: option.
                   1981: .It Fl out Ar file
1.53      jmc      1982: The output file to write to,
1.57      jmc      1983: or standard output if not specified.
1.1       jsing    1984: .It Fl passout Ar arg
                   1985: The output file password source.
                   1986: .It Ar numbits
                   1987: The size of the private key to generate in bits.
                   1988: This must be the last option specified.
                   1989: The default is 2048.
                   1990: .El
                   1991: .Sh NSEQ
                   1992: .Nm openssl nseq
                   1993: .Op Fl in Ar file
                   1994: .Op Fl out Ar file
                   1995: .Op Fl toseq
                   1996: .Pp
                   1997: The
                   1998: .Nm nseq
1.54      jmc      1999: command takes a file containing a Netscape certificate sequence
                   2000: (an alternative to the standard PKCS#7 format)
                   2001: and prints out the certificates contained in it,
                   2002: or takes a file of certificates
                   2003: and converts it into a Netscape certificate sequence.
                   2004: .Pp
1.1       jsing    2005: The options are as follows:
                   2006: .Bl -tag -width Ds
                   2007: .It Fl in Ar file
1.54      jmc      2008: The input file to read from,
                   2009: or standard input if not specified.
1.1       jsing    2010: .It Fl out Ar file
1.54      jmc      2011: The output file to write to,
                   2012: or standard output if not specified.
1.1       jsing    2013: .It Fl toseq
                   2014: Normally, a Netscape certificate sequence will be input and the output
                   2015: is the certificates contained in it.
                   2016: With the
                   2017: .Fl toseq
                   2018: option the situation is reversed:
                   2019: a Netscape certificate sequence is created from a file of certificates.
                   2020: .El
                   2021: .Sh OCSP
                   2022: .nr nS 1
                   2023: .Nm "openssl ocsp"
                   2024: .Op Fl CA Ar file
                   2025: .Op Fl CAfile Ar file
                   2026: .Op Fl CApath Ar directory
                   2027: .Op Fl cert Ar file
                   2028: .Op Fl dgst Ar alg
1.55      jmc      2029: .Op Fl host Ar hostname : Ns Ar port
1.1       jsing    2030: .Op Fl index Ar indexfile
                   2031: .Op Fl issuer Ar file
                   2032: .Op Fl ndays Ar days
                   2033: .Op Fl nmin Ar minutes
                   2034: .Op Fl no_cert_checks
                   2035: .Op Fl no_cert_verify
                   2036: .Op Fl no_certs
                   2037: .Op Fl no_chain
                   2038: .Op Fl no_intern
                   2039: .Op Fl no_nonce
                   2040: .Op Fl no_signature_verify
                   2041: .Op Fl nonce
                   2042: .Op Fl noverify
                   2043: .Op Fl nrequest Ar number
                   2044: .Op Fl out Ar file
                   2045: .Op Fl path Ar path
                   2046: .Op Fl port Ar portnum
                   2047: .Op Fl req_text
                   2048: .Op Fl reqin Ar file
                   2049: .Op Fl reqout Ar file
                   2050: .Op Fl resp_key_id
                   2051: .Op Fl resp_no_certs
                   2052: .Op Fl resp_text
                   2053: .Op Fl respin Ar file
                   2054: .Op Fl respout Ar file
                   2055: .Op Fl rkey Ar file
                   2056: .Op Fl rother Ar file
                   2057: .Op Fl rsigner Ar file
                   2058: .Op Fl serial Ar number
                   2059: .Op Fl sign_other Ar file
                   2060: .Op Fl signer Ar file
                   2061: .Op Fl signkey Ar file
                   2062: .Op Fl status_age Ar age
                   2063: .Op Fl text
                   2064: .Op Fl trust_other
                   2065: .Op Fl url Ar responder_url
                   2066: .Op Fl VAfile Ar file
                   2067: .Op Fl validity_period Ar nsec
                   2068: .Op Fl verify_other Ar file
                   2069: .nr nS 0
                   2070: .Pp
1.55      jmc      2071: The Online Certificate Status Protocol (OCSP)
                   2072: enables applications to determine the (revocation) state
                   2073: of an identified certificate (RFC 2560).
1.1       jsing    2074: .Pp
                   2075: The
                   2076: .Nm ocsp
                   2077: command performs many common OCSP tasks.
                   2078: It can be used to print out requests and responses,
                   2079: create requests and send queries to an OCSP responder,
                   2080: and behave like a mini OCSP server itself.
                   2081: .Pp
                   2082: The options are as follows:
                   2083: .Bl -tag -width Ds
                   2084: .It Fl CAfile Ar file , Fl CApath Ar directory
1.55      jmc      2085: A file or path containing trusted CA certificates,
                   2086: used to verify the signature on the OCSP response.
1.1       jsing    2087: .It Fl cert Ar file
                   2088: Add the certificate
                   2089: .Ar file
                   2090: to the request.
                   2091: The issuer certificate is taken from the previous
                   2092: .Fl issuer
                   2093: option, or an error occurs if no issuer certificate is specified.
                   2094: .It Fl dgst Ar alg
1.55      jmc      2095: Use the digest algorithm
                   2096: .Ar alg
                   2097: for certificate identification in the OCSP request.
1.1       jsing    2098: By default SHA-1 is used.
                   2099: .It Xo
                   2100: .Fl host Ar hostname : Ns Ar port ,
                   2101: .Fl path Ar path
                   2102: .Xc
1.55      jmc      2103: Send
                   2104: the OCSP request to
1.1       jsing    2105: .Ar hostname
1.55      jmc      2106: on
1.1       jsing    2107: .Ar port .
                   2108: .Fl path
                   2109: specifies the HTTP path name to use, or
1.55      jmc      2110: .Pa /
1.1       jsing    2111: by default.
                   2112: .It Fl issuer Ar file
1.81      jmc      2113: The current issuer certificate, in PEM format.
                   2114: Can be used multiple times and must come before any
1.1       jsing    2115: .Fl cert
                   2116: options.
                   2117: .It Fl no_cert_checks
                   2118: Don't perform any additional checks on the OCSP response signer's certificate.
                   2119: That is, do not make any checks to see if the signer's certificate is
                   2120: authorised to provide the necessary status information:
                   2121: as a result this option should only be used for testing purposes.
                   2122: .It Fl no_cert_verify
                   2123: Don't verify the OCSP response signer's certificate at all.
                   2124: Since this option allows the OCSP response to be signed by any certificate,
                   2125: it should only be used for testing purposes.
                   2126: .It Fl no_certs
1.55      jmc      2127: Don't include any certificates in the signed request.
1.1       jsing    2128: .It Fl no_chain
                   2129: Do not use certificates in the response as additional untrusted CA
                   2130: certificates.
                   2131: .It Fl no_intern
                   2132: Ignore certificates contained in the OCSP response
                   2133: when searching for the signer's certificate.
1.55      jmc      2134: The signer's certificate must be specified with either the
1.1       jsing    2135: .Fl verify_other
                   2136: or
                   2137: .Fl VAfile
                   2138: options.
                   2139: .It Fl no_signature_verify
                   2140: Don't check the signature on the OCSP response.
                   2141: Since this option tolerates invalid signatures on OCSP responses,
                   2142: it will normally only be used for testing purposes.
                   2143: .It Fl nonce , no_nonce
1.55      jmc      2144: Add an OCSP nonce extension to a request,
                   2145: or disable an OCSP nonce addition.
1.1       jsing    2146: Normally, if an OCSP request is input using the
                   2147: .Fl respin
1.55      jmc      2148: option no nonce is added:
1.1       jsing    2149: using the
                   2150: .Fl nonce
1.55      jmc      2151: option will force the addition of a nonce.
1.1       jsing    2152: If an OCSP request is being created (using the
                   2153: .Fl cert
                   2154: and
                   2155: .Fl serial
                   2156: options)
1.55      jmc      2157: a nonce is automatically added; specifying
1.1       jsing    2158: .Fl no_nonce
                   2159: overrides this.
                   2160: .It Fl noverify
1.55      jmc      2161: Don't attempt to verify the OCSP response signature or the nonce values.
                   2162: This is normally only be used for debugging
1.1       jsing    2163: since it disables all verification of the responder's certificate.
                   2164: .It Fl out Ar file
1.55      jmc      2165: Specify the output file to write to,
1.57      jmc      2166: or standard output if not specified.
1.1       jsing    2167: .It Fl req_text , resp_text , text
                   2168: Print out the text form of the OCSP request, response, or both, respectively.
                   2169: .It Fl reqin Ar file , Fl respin Ar file
                   2170: Read an OCSP request or response file from
                   2171: .Ar file .
                   2172: These options are ignored
                   2173: if an OCSP request or response creation is implied by other options
                   2174: (for example with the
                   2175: .Fl serial , cert ,
                   2176: and
                   2177: .Fl host
                   2178: options).
                   2179: .It Fl reqout Ar file , Fl respout Ar file
                   2180: Write out the DER-encoded certificate request or response to
                   2181: .Ar file .
                   2182: .It Fl serial Ar num
                   2183: Same as the
                   2184: .Fl cert
                   2185: option except the certificate with serial number
                   2186: .Ar num
                   2187: is added to the request.
                   2188: The serial number is interpreted as a decimal integer unless preceded by
                   2189: .Sq 0x .
1.55      jmc      2190: Negative integers can also be specified
                   2191: by preceding the value with a minus sign.
1.1       jsing    2192: .It Fl sign_other Ar file
                   2193: Additional certificates to include in the signed request.
                   2194: .It Fl signer Ar file , Fl signkey Ar file
                   2195: Sign the OCSP request using the certificate specified in the
                   2196: .Fl signer
                   2197: option and the private key specified by the
                   2198: .Fl signkey
                   2199: option.
                   2200: If the
                   2201: .Fl signkey
                   2202: option is not present, then the private key is read from the same file
                   2203: as the certificate.
                   2204: If neither option is specified, the OCSP request is not signed.
                   2205: .It Fl trust_other
                   2206: The certificates specified by the
                   2207: .Fl verify_other
                   2208: option should be explicitly trusted and no additional checks will be
                   2209: performed on them.
                   2210: This is useful when the complete responder certificate chain is not available
                   2211: or trusting a root CA is not appropriate.
                   2212: .It Fl url Ar responder_url
                   2213: Specify the responder URL.
                   2214: Both HTTP and HTTPS
                   2215: .Pq SSL/TLS
                   2216: URLs can be specified.
                   2217: .It Fl VAfile Ar file
1.55      jmc      2218: A file containing explicitly trusted responder certificates.
1.1       jsing    2219: Equivalent to the
                   2220: .Fl verify_other
                   2221: and
                   2222: .Fl trust_other
                   2223: options.
                   2224: .It Fl validity_period Ar nsec , Fl status_age Ar age
1.55      jmc      2225: The range of times, in seconds, which will be tolerated in an OCSP response.
                   2226: Each certificate status response includes a notBefore time
                   2227: and an optional notAfter time.
1.1       jsing    2228: The current time should fall between these two values,
                   2229: but the interval between the two times may be only a few seconds.
                   2230: In practice the OCSP responder and clients' clocks may not be precisely
                   2231: synchronised and so such a check may fail.
                   2232: To avoid this the
                   2233: .Fl validity_period
                   2234: option can be used to specify an acceptable error range in seconds,
1.55      jmc      2235: the default value being 5 minutes.
1.1       jsing    2236: .Pp
1.55      jmc      2237: If the notAfter time is omitted from a response,
                   2238: it means that new status information is immediately available.
                   2239: In this case the age of the notBefore field is checked
                   2240: to see it is not older than
1.1       jsing    2241: .Ar age
                   2242: seconds old.
                   2243: By default, this additional check is not performed.
                   2244: .It Fl verify_other Ar file
1.55      jmc      2245: A file containing additional certificates to search
                   2246: when attempting to locate the OCSP response signing certificate.
                   2247: Some responders omit the actual signer's certificate from the response,
                   2248: so this can be used to supply the necessary certificate.
1.1       jsing    2249: .El
1.55      jmc      2250: .Pp
                   2251: The options for the OCSP server are as follows:
1.1       jsing    2252: .Bl -tag -width "XXXX"
                   2253: .It Fl CA Ar file
                   2254: CA certificate corresponding to the revocation information in
                   2255: .Ar indexfile .
                   2256: .It Fl index Ar indexfile
                   2257: .Ar indexfile
1.55      jmc      2258: is a text index file in ca format
                   2259: containing certificate revocation information.
1.1       jsing    2260: .Pp
1.55      jmc      2261: If this option is specified,
1.1       jsing    2262: .Nm ocsp
1.55      jmc      2263: is in responder mode, otherwise it is in client mode.
                   2264: The requests the responder processes can be either specified on
1.1       jsing    2265: the command line (using the
                   2266: .Fl issuer
                   2267: and
                   2268: .Fl serial
                   2269: options), supplied in a file (using the
                   2270: .Fl respin
1.55      jmc      2271: option), or via external OCSP clients (if
1.1       jsing    2272: .Ar port
                   2273: or
                   2274: .Ar url
                   2275: is specified).
                   2276: .Pp
1.55      jmc      2277: If this option is present, then the
1.1       jsing    2278: .Fl CA
                   2279: and
                   2280: .Fl rsigner
                   2281: options must also be present.
                   2282: .It Fl nmin Ar minutes , Fl ndays Ar days
                   2283: Number of
                   2284: .Ar minutes
                   2285: or
                   2286: .Ar days
1.55      jmc      2287: when fresh revocation information is available:
                   2288: used in the nextUpdate field.
                   2289: If neither option is present,
                   2290: the nextUpdate field is omitted,
                   2291: meaning fresh revocation information is immediately available.
1.1       jsing    2292: .It Fl nrequest Ar number
1.55      jmc      2293: Exit after receiving
1.1       jsing    2294: .Ar number
1.55      jmc      2295: requests (the default is unlimited).
1.1       jsing    2296: .It Fl port Ar portnum
                   2297: Port to listen for OCSP requests on.
1.55      jmc      2298: May also be specified using the
1.1       jsing    2299: .Fl url
                   2300: option.
                   2301: .It Fl resp_key_id
                   2302: Identify the signer certificate using the key ID;
1.55      jmc      2303: the default is to use the subject name.
1.1       jsing    2304: .It Fl resp_no_certs
                   2305: Don't include any certificates in the OCSP response.
                   2306: .It Fl rkey Ar file
                   2307: The private key to sign OCSP responses with;
                   2308: if not present, the file specified in the
                   2309: .Fl rsigner
                   2310: option is used.
                   2311: .It Fl rother Ar file
                   2312: Additional certificates to include in the OCSP response.
                   2313: .It Fl rsigner Ar file
                   2314: The certificate to sign OCSP responses with.
                   2315: .El
                   2316: .Pp
                   2317: Initially the OCSP responder certificate is located and the signature on
                   2318: the OCSP request checked using the responder certificate's public key.
                   2319: Then a normal certificate verify is performed on the OCSP responder certificate
                   2320: building up a certificate chain in the process.
                   2321: The locations of the trusted certificates used to build the chain can be
                   2322: specified by the
                   2323: .Fl CAfile
                   2324: and
                   2325: .Fl CApath
                   2326: options or they will be looked for in the standard
1.55      jmc      2327: .Nm openssl
                   2328: certificates directory.
1.1       jsing    2329: .Pp
1.55      jmc      2330: If the initial verify fails, the OCSP verify process halts with an error.
1.1       jsing    2331: Otherwise the issuing CA certificate in the request is compared to the OCSP
                   2332: responder certificate: if there is a match then the OCSP verify succeeds.
                   2333: .Pp
                   2334: Otherwise the OCSP responder certificate's CA is checked against the issuing
                   2335: CA certificate in the request.
                   2336: If there is a match and the OCSPSigning extended key usage is present
                   2337: in the OCSP responder certificate, then the OCSP verify succeeds.
                   2338: .Pp
                   2339: Otherwise the root CA of the OCSP responder's CA is checked to see if it
                   2340: is trusted for OCSP signing.
                   2341: If it is, the OCSP verify succeeds.
                   2342: .Pp
                   2343: If none of these checks is successful, the OCSP verify fails.
                   2344: What this effectively means is that if the OCSP responder certificate is
                   2345: authorised directly by the CA it is issuing revocation information about
1.55      jmc      2346: (and it is correctly configured),
1.1       jsing    2347: then verification will succeed.
                   2348: .Pp
1.55      jmc      2349: If the OCSP responder is a global responder,
                   2350: which can give details about multiple CAs
                   2351: and has its own separate certificate chain,
                   2352: then its root CA can be trusted for OCSP signing.
1.1       jsing    2353: Alternatively, the responder certificate itself can be explicitly trusted
                   2354: with the
                   2355: .Fl VAfile
                   2356: option.
                   2357: .Sh PASSWD
                   2358: .nr nS 1
                   2359: .Nm "openssl passwd"
                   2360: .Op Fl 1 | apr1 | crypt
                   2361: .Op Fl in Ar file
                   2362: .Op Fl noverify
                   2363: .Op Fl quiet
                   2364: .Op Fl reverse
                   2365: .Op Fl salt Ar string
                   2366: .Op Fl stdin
                   2367: .Op Fl table
                   2368: .Op Ar password
                   2369: .nr nS 0
                   2370: .Pp
                   2371: The
                   2372: .Nm passwd
1.56      jmc      2373: command computes the hash of a password.
1.1       jsing    2374: .Pp
                   2375: The options are as follows:
                   2376: .Bl -tag -width Ds
                   2377: .It Fl 1
                   2378: Use the MD5 based
                   2379: .Bx
                   2380: password algorithm
1.56      jmc      2381: .Qq 1 .
1.1       jsing    2382: .It Fl apr1
                   2383: Use the
1.56      jmc      2384: .Qq apr1
1.1       jsing    2385: algorithm
1.56      jmc      2386: .Po
                   2387: Apache variant of the
1.1       jsing    2388: .Bx
1.56      jmc      2389: algorithm
                   2390: .Pc .
1.1       jsing    2391: .It Fl crypt
                   2392: Use the
1.56      jmc      2393: .Qq crypt
                   2394: algorithm (the default).
1.1       jsing    2395: .It Fl in Ar file
                   2396: Read passwords from
                   2397: .Ar file .
                   2398: .It Fl noverify
                   2399: Don't verify when reading a password from the terminal.
                   2400: .It Fl quiet
                   2401: Don't output warnings when passwords given on the command line are truncated.
                   2402: .It Fl reverse
                   2403: Switch table columns.
                   2404: This only makes sense in conjunction with the
                   2405: .Fl table
                   2406: option.
                   2407: .It Fl salt Ar string
1.56      jmc      2408: Use the salt specified by
                   2409: .Ar string .
1.1       jsing    2410: When reading a password from the terminal, this implies
                   2411: .Fl noverify .
                   2412: .It Fl stdin
1.56      jmc      2413: Read passwords from standard input.
1.1       jsing    2414: .It Fl table
                   2415: In the output list, prepend the cleartext password and a TAB character
                   2416: to each password hash.
                   2417: .El
                   2418: .Sh PKCS7
                   2419: .nr nS 1
                   2420: .Nm "openssl pkcs7"
                   2421: .Op Fl in Ar file
1.57      jmc      2422: .Op Fl inform Cm der | pem
1.1       jsing    2423: .Op Fl noout
                   2424: .Op Fl out Ar file
1.57      jmc      2425: .Op Fl outform Cm der | pem
1.1       jsing    2426: .Op Fl print_certs
                   2427: .Op Fl text
                   2428: .nr nS 0
                   2429: .Pp
                   2430: The
                   2431: .Nm pkcs7
                   2432: command processes PKCS#7 files in DER or PEM format.
1.57      jmc      2433: The PKCS#7 routines only understand PKCS#7 v 1.5 as specified in RFC 2315.
                   2434: .Pp
1.1       jsing    2435: The options are as follows:
                   2436: .Bl -tag -width Ds
                   2437: .It Fl in Ar file
1.57      jmc      2438: The input file to read from,
                   2439: or standard input if not specified.
                   2440: .It Fl inform Cm der | pem
                   2441: The input format.
1.1       jsing    2442: .It Fl noout
                   2443: Don't output the encoded version of the PKCS#7 structure
                   2444: (or certificates if
                   2445: .Fl print_certs
                   2446: is set).
                   2447: .It Fl out Ar file
1.57      jmc      2448: The output to write to,
                   2449: or standard output if not specified.
                   2450: .It Fl outform Cm der | pem
                   2451: The output format.
1.1       jsing    2452: .It Fl print_certs
1.57      jmc      2453: Print any certificates or CRLs contained in the file,
                   2454: preceded by their subject and issuer names in a one-line format.
1.1       jsing    2455: .It Fl text
1.57      jmc      2456: Print certificate details in full rather than just subject and issuer names.
1.1       jsing    2457: .El
                   2458: .Sh PKCS8
                   2459: .nr nS 1
                   2460: .Nm "openssl pkcs8"
                   2461: .Op Fl embed
                   2462: .Op Fl in Ar file
1.58      jmc      2463: .Op Fl inform Cm der | pem
1.1       jsing    2464: .Op Fl nocrypt
                   2465: .Op Fl noiter
                   2466: .Op Fl nooct
                   2467: .Op Fl nsdb
                   2468: .Op Fl out Ar file
1.58      jmc      2469: .Op Fl outform Cm der | pem
1.1       jsing    2470: .Op Fl passin Ar arg
                   2471: .Op Fl passout Ar arg
                   2472: .Op Fl topk8
                   2473: .Op Fl v1 Ar alg
                   2474: .Op Fl v2 Ar alg
                   2475: .nr nS 0
                   2476: .Pp
                   2477: The
                   2478: .Nm pkcs8
1.58      jmc      2479: command processes private keys
                   2480: (both encrypted and unencrypted)
                   2481: in PKCS#8 format
                   2482: with a variety of PKCS#5 (v1.5 and v2.0) and PKCS#12 algorithms.
                   2483: The default encryption is only 56 bits;
                   2484: keys encrypted using PKCS#5 v2.0 algorithms and high iteration counts
                   2485: are more secure.
                   2486: .Pp
1.1       jsing    2487: The options are as follows:
                   2488: .Bl -tag -width Ds
                   2489: .It Fl embed
1.58      jmc      2490: Generate DSA keys in a broken format.
                   2491: The DSA parameters are embedded inside the PrivateKey structure.
1.84      jmc      2492: In this form the OCTET STRING contains an ASN.1 SEQUENCE consisting of
1.1       jsing    2493: two structures:
1.84      jmc      2494: a SEQUENCE containing the parameters and an ASN.1 INTEGER containing
1.1       jsing    2495: the private key.
                   2496: .It Fl in Ar file
1.58      jmc      2497: The input file to read from,
                   2498: or standard input if not specified.
1.1       jsing    2499: If the key is encrypted, a pass phrase will be prompted for.
1.58      jmc      2500: .It Fl inform Cm der | pem
                   2501: The input format.
1.1       jsing    2502: .It Fl nocrypt
1.58      jmc      2503: Generate an unencrypted PrivateKeyInfo structure.
                   2504: This option does not encrypt private keys at all
                   2505: and should only be used when absolutely necessary.
1.1       jsing    2506: .It Fl noiter
                   2507: Use an iteration count of 1.
                   2508: See the
                   2509: .Sx PKCS12
                   2510: section below for a detailed explanation of this option.
                   2511: .It Fl nooct
1.58      jmc      2512: Generate RSA private keys in a broken format that some software uses.
1.1       jsing    2513: Specifically the private key should be enclosed in an OCTET STRING,
                   2514: but some software just includes the structure itself without the
                   2515: surrounding OCTET STRING.
                   2516: .It Fl nsdb
1.58      jmc      2517: Generate DSA keys in a broken format compatible with Netscape
1.1       jsing    2518: private key databases.
1.58      jmc      2519: The PrivateKey contains a SEQUENCE
                   2520: consisting of the public and private keys, respectively.
1.1       jsing    2521: .It Fl out Ar file
1.58      jmc      2522: The output file to write to,
                   2523: or standard output if none is specified.
1.1       jsing    2524: If any encryption options are set, a pass phrase will be prompted for.
1.58      jmc      2525: .It Fl outform Cm der | pem
                   2526: The output format.
1.1       jsing    2527: .It Fl passin Ar arg
                   2528: The key password source.
                   2529: .It Fl passout Ar arg
                   2530: The output file password source.
                   2531: .It Fl topk8
1.58      jmc      2532: Read a traditional format private key and write a PKCS#8 format key.
1.1       jsing    2533: .It Fl v1 Ar alg
1.58      jmc      2534: Specify a PKCS#5 v1.5 or PKCS#12 algorithm to use.
                   2535: .Pp
                   2536: .Bl -tag -width "XXXX" -compact
                   2537: .It PBE-MD5-DES
                   2538: 56-bit DES.
                   2539: .It PBE-SHA1-RC2-64 | PBE-MD5-RC2-64 | PBE-SHA1-DES
                   2540: 64-bit RC2 or 56-bit DES.
                   2541: .It PBE-SHA1-RC4-128 | PBE-SHA1-RC4-40 | PBE-SHA1-3DES
                   2542: .It PBE-SHA1-2DES | PBE-SHA1-RC2-128 | PBE-SHA1-RC2-40
                   2543: PKCS#12 password-based encryption algorithm,
                   2544: which allow strong encryption algorithms like triple DES or 128-bit RC2.
                   2545: .El
1.1       jsing    2546: .It Fl v2 Ar alg
1.58      jmc      2547: Use PKCS#5 v2.0 algorithms.
                   2548: Supports algorithms such as 168-bit triple DES or 128-bit RC2,
                   2549: however not many implementations support PKCS#5 v2.0 yet
                   2550: (if using private keys with
                   2551: .Nm openssl
                   2552: this doesn't matter).
1.1       jsing    2553: .Pp
                   2554: .Ar alg
1.58      jmc      2555: is the encryption algorithm to use;
                   2556: valid values include des, des3, and rc2.
                   2557: It is recommended that des3 is used.
1.1       jsing    2558: .El
                   2559: .Sh PKCS12
                   2560: .nr nS 1
                   2561: .Nm "openssl pkcs12"
1.59      jmc      2562: .Op Fl aes128 | aes192 | aes256 | des | des3
1.1       jsing    2563: .Op Fl cacerts
                   2564: .Op Fl CAfile Ar file
                   2565: .Op Fl caname Ar name
                   2566: .Op Fl CApath Ar directory
                   2567: .Op Fl certfile Ar file
                   2568: .Op Fl certpbe Ar alg
                   2569: .Op Fl chain
                   2570: .Op Fl clcerts
                   2571: .Op Fl CSP Ar name
                   2572: .Op Fl descert
                   2573: .Op Fl export
                   2574: .Op Fl in Ar file
                   2575: .Op Fl info
                   2576: .Op Fl inkey Ar file
                   2577: .Op Fl keyex
                   2578: .Op Fl keypbe Ar alg
                   2579: .Op Fl keysig
                   2580: .Op Fl macalg Ar alg
                   2581: .Op Fl maciter
                   2582: .Op Fl name Ar name
                   2583: .Op Fl nocerts
                   2584: .Op Fl nodes
                   2585: .Op Fl noiter
                   2586: .Op Fl nokeys
                   2587: .Op Fl nomac
                   2588: .Op Fl nomaciter
                   2589: .Op Fl nomacver
                   2590: .Op Fl noout
                   2591: .Op Fl out Ar file
                   2592: .Op Fl passin Ar arg
                   2593: .Op Fl passout Ar arg
                   2594: .Op Fl twopass
                   2595: .nr nS 0
                   2596: .Pp
                   2597: The
                   2598: .Nm pkcs12
                   2599: command allows PKCS#12 files
                   2600: .Pq sometimes referred to as PFX files
                   2601: to be created and parsed.
                   2602: By default, a PKCS#12 file is parsed;
                   2603: a PKCS#12 file can be created by using the
                   2604: .Fl export
1.59      jmc      2605: option.
                   2606: .Pp
                   2607: The options for parsing a PKCS12 file are as follows:
1.1       jsing    2608: .Bl -tag -width "XXXX"
1.59      jmc      2609: .It Fl aes128 | aes192 | aes256 | des | des3
                   2610: Encrypt private keys
                   2611: using AES, DES, or triple DES, respectively.
1.1       jsing    2612: The default is triple DES.
                   2613: .It Fl cacerts
                   2614: Only output CA certificates
                   2615: .Pq not client certificates .
                   2616: .It Fl clcerts
                   2617: Only output client certificates
                   2618: .Pq not CA certificates .
                   2619: .It Fl in Ar file
1.59      jmc      2620: The input file to read from,
                   2621: or standard input if not specified.
1.1       jsing    2622: .It Fl info
                   2623: Output additional information about the PKCS#12 file structure,
                   2624: algorithms used, and iteration counts.
                   2625: .It Fl nocerts
1.59      jmc      2626: Do not output certificates.
1.1       jsing    2627: .It Fl nodes
1.59      jmc      2628: Do not encrypt private keys.
1.1       jsing    2629: .It Fl nokeys
1.59      jmc      2630: Do not output private keys.
1.1       jsing    2631: .It Fl nomacver
1.59      jmc      2632: Do not attempt to verify the integrity MAC before reading the file.
1.1       jsing    2633: .It Fl noout
1.59      jmc      2634: Do not output the keys and certificates to the output file
1.1       jsing    2635: version of the PKCS#12 file.
                   2636: .It Fl out Ar file
1.59      jmc      2637: The output file to write to,
                   2638: or standard output if not specified.
1.1       jsing    2639: .It Fl passin Ar arg
                   2640: The key password source.
                   2641: .It Fl passout Ar arg
                   2642: The output file password source.
                   2643: .It Fl twopass
                   2644: Prompt for separate integrity and encryption passwords: most software
                   2645: always assumes these are the same so this option will render such
                   2646: PKCS#12 files unreadable.
                   2647: .El
1.59      jmc      2648: .Pp
                   2649: The options for PKCS12 file creation are as follows:
1.1       jsing    2650: .Bl -tag -width "XXXX"
                   2651: .It Fl CAfile Ar file
                   2652: CA storage as a file.
                   2653: .It Fl CApath Ar directory
                   2654: CA storage as a directory.
1.59      jmc      2655: The directory must be a standard certificate directory:
1.1       jsing    2656: that is, a hash of each subject name (using
1.59      jmc      2657: .Nm x509 Fl hash )
1.1       jsing    2658: should be linked to each certificate.
                   2659: .It Fl caname Ar name
1.59      jmc      2660: Specify the
1.1       jsing    2661: .Qq friendly name
                   2662: for other certificates.
1.59      jmc      2663: May be used multiple times to specify names for all certificates
1.1       jsing    2664: in the order they appear.
                   2665: .It Fl certfile Ar file
                   2666: A file to read additional certificates from.
                   2667: .It Fl certpbe Ar alg , Fl keypbe Ar alg
1.59      jmc      2668: Specify the algorithm used to encrypt the private key and
1.1       jsing    2669: certificates to be selected.
1.59      jmc      2670: Any PKCS#5 v1.5 or PKCS#12 PBE algorithm name can be used.
1.1       jsing    2671: If a cipher name
                   2672: (as output by the
                   2673: .Cm list-cipher-algorithms
                   2674: command) is specified then it
                   2675: is used with PKCS#5 v2.0.
                   2676: For interoperability reasons it is advisable to only use PKCS#12 algorithms.
                   2677: .It Fl chain
1.59      jmc      2678: Include the entire certificate chain of the user certificate.
1.1       jsing    2679: The standard CA store is used for this search.
                   2680: If the search fails, it is considered a fatal error.
                   2681: .It Fl CSP Ar name
                   2682: Write
                   2683: .Ar name
                   2684: as a Microsoft CSP name.
                   2685: .It Fl descert
                   2686: Encrypt the certificate using triple DES; this may render the PKCS#12
                   2687: file unreadable by some
                   2688: .Qq export grade
                   2689: software.
                   2690: By default, the private key is encrypted using triple DES and the
                   2691: certificate using 40-bit RC2.
                   2692: .It Fl export
1.59      jmc      2693: Create a PKCS#12 file (rather than parsing one).
1.1       jsing    2694: .It Fl in Ar file
1.59      jmc      2695: The input file to read from,
1.81      jmc      2696: or standard input if not specified.
1.1       jsing    2697: The order doesn't matter but one private key and its corresponding
                   2698: certificate should be present.
                   2699: If additional certificates are present, they will also be included
                   2700: in the PKCS#12 file.
                   2701: .It Fl inkey Ar file
1.59      jmc      2702: File to read a private key from.
1.1       jsing    2703: If not present, a private key must be present in the input file.
                   2704: .It Fl keyex | keysig
1.59      jmc      2705: Specify whether the private key is to be used for key exchange or just signing.
1.1       jsing    2706: Normally,
                   2707: .Qq export grade
                   2708: software will only allow 512-bit RSA keys to be
                   2709: used for encryption purposes, but arbitrary length keys for signing.
                   2710: The
                   2711: .Fl keysig
                   2712: option marks the key for signing only.
                   2713: Signing only keys can be used for S/MIME signing, authenticode
1.66      jmc      2714: (ActiveX control signing)
1.59      jmc      2715: and SSL client authentication.
1.1       jsing    2716: .It Fl macalg Ar alg
                   2717: Specify the MAC digest algorithm.
1.59      jmc      2718: The default is SHA1.
1.1       jsing    2719: .It Fl maciter
1.66      jmc      2720: Included for compatibility only:
1.59      jmc      2721: it used to be needed to use MAC iterations counts
                   2722: but they are now used by default.
1.1       jsing    2723: .It Fl name Ar name
1.59      jmc      2724: Specify the
1.1       jsing    2725: .Qq friendly name
                   2726: for the certificate and private key.
                   2727: This name is typically displayed in list boxes by software importing the file.
                   2728: .It Fl nomac
                   2729: Don't attempt to provide the MAC integrity.
                   2730: .It Fl nomaciter , noiter
1.59      jmc      2731: Affect the iteration counts on the MAC and key algorithms.
1.1       jsing    2732: .Pp
                   2733: To discourage attacks by using large dictionaries of common passwords,
                   2734: the algorithm that derives keys from passwords can have an iteration count
                   2735: applied to it: this causes a certain part of the algorithm to be repeated
                   2736: and slows it down.
                   2737: The MAC is used to check the file integrity but since it will normally
                   2738: have the same password as the keys and certificates it could also be attacked.
                   2739: By default, both MAC and encryption iteration counts are set to 2048;
                   2740: using these options the MAC and encryption iteration counts can be set to 1.
                   2741: Since this reduces the file security you should not use these options
                   2742: unless you really have to.
                   2743: Most software supports both MAC and key iteration counts.
                   2744: .It Fl out Ar file
1.59      jmc      2745: The output file to write to,
                   2746: or standard output if not specified.
1.1       jsing    2747: .It Fl passin Ar arg
                   2748: The key password source.
                   2749: .It Fl passout Ar arg
                   2750: The output file password source.
                   2751: .El
                   2752: .Sh PKEY
                   2753: .nr nS 1
                   2754: .Nm "openssl pkey"
                   2755: .Op Ar cipher
                   2756: .Op Fl in Ar file
1.60      jmc      2757: .Op Fl inform Cm der | pem
1.1       jsing    2758: .Op Fl noout
                   2759: .Op Fl out Ar file
1.60      jmc      2760: .Op Fl outform Cm der | pem
1.1       jsing    2761: .Op Fl passin Ar arg
                   2762: .Op Fl passout Ar arg
                   2763: .Op Fl pubin
                   2764: .Op Fl pubout
                   2765: .Op Fl text
                   2766: .Op Fl text_pub
                   2767: .nr nS 0
                   2768: .Pp
                   2769: The
                   2770: .Nm pkey
                   2771: command processes public or private keys.
                   2772: They can be converted between various forms
                   2773: and their components printed out.
                   2774: .Pp
                   2775: The options are as follows:
                   2776: .Bl -tag -width Ds
                   2777: .It Ar cipher
1.60      jmc      2778: Encrypt the private key with the specified cipher.
1.1       jsing    2779: Any algorithm name accepted by
1.60      jmc      2780: .Xr EVP_get_cipherbyname 3
1.1       jsing    2781: is acceptable, such as
                   2782: .Cm des3 .
                   2783: .It Fl in Ar file
1.60      jmc      2784: The input file to read from,
                   2785: or standard input if not specified.
1.1       jsing    2786: If the key is encrypted a pass phrase will be prompted for.
1.60      jmc      2787: .It Fl inform Cm der | pem
                   2788: The input format.
1.1       jsing    2789: .It Fl noout
                   2790: Do not output the encoded version of the key.
                   2791: .It Fl out Ar file
1.60      jmc      2792: The output file to write to,
                   2793: or standard output if not specified.
1.1       jsing    2794: If any encryption options are set then a pass phrase
                   2795: will be prompted for.
1.60      jmc      2796: .It Fl outform Cm der | pem
                   2797: The output format.
1.1       jsing    2798: .It Fl passin Ar arg
                   2799: The key password source.
                   2800: .It Fl passout Ar arg
                   2801: The output file password source.
                   2802: .It Fl pubin
1.60      jmc      2803: Read in a public key, not a private key.
1.1       jsing    2804: .It Fl pubout
1.60      jmc      2805: Output a public key, not a private key.
                   2806: Automatically set if the input is a public key.
1.1       jsing    2807: .It Fl text
1.64      jmc      2808: Print the public/private key in plain text.
1.1       jsing    2809: .It Fl text_pub
                   2810: Print out only public key components
                   2811: even if a private key is being processed.
                   2812: .El
                   2813: .Sh PKEYPARAM
                   2814: .Cm openssl pkeyparam
                   2815: .Op Fl in Ar file
                   2816: .Op Fl noout
                   2817: .Op Fl out Ar file
                   2818: .Op Fl text
                   2819: .Pp
                   2820: The
1.61      jmc      2821: .Nm pkeyparam
1.1       jsing    2822: command processes public or private keys.
1.61      jmc      2823: The key type is determined by the PEM headers.
1.1       jsing    2824: .Pp
                   2825: The options are as follows:
                   2826: .Bl -tag -width Ds
                   2827: .It Fl in Ar file
1.61      jmc      2828: The input file to read from,
                   2829: or standard input if not specified.
1.1       jsing    2830: .It Fl noout
                   2831: Do not output the encoded version of the parameters.
                   2832: .It Fl out Ar file
1.61      jmc      2833: The output file to write to,
                   2834: or standard output if not specified.
1.1       jsing    2835: .It Fl text
1.64      jmc      2836: Print the parameters in plain text.
1.1       jsing    2837: .El
                   2838: .Sh PKEYUTL
                   2839: .nr nS 1
                   2840: .Nm "openssl pkeyutl"
                   2841: .Op Fl asn1parse
                   2842: .Op Fl certin
                   2843: .Op Fl decrypt
                   2844: .Op Fl derive
                   2845: .Op Fl encrypt
                   2846: .Op Fl hexdump
                   2847: .Op Fl in Ar file
                   2848: .Op Fl inkey Ar file
1.62      jmc      2849: .Op Fl keyform Cm der | pem
1.1       jsing    2850: .Op Fl out Ar file
                   2851: .Op Fl passin Ar arg
1.62      jmc      2852: .Op Fl peerform Cm der | pem
1.1       jsing    2853: .Op Fl peerkey Ar file
                   2854: .Op Fl pkeyopt Ar opt : Ns Ar value
                   2855: .Op Fl pubin
                   2856: .Op Fl rev
                   2857: .Op Fl sigfile Ar file
                   2858: .Op Fl sign
                   2859: .Op Fl verify
                   2860: .Op Fl verifyrecover
                   2861: .nr nS 0
                   2862: .Pp
                   2863: The
                   2864: .Nm pkeyutl
                   2865: command can be used to perform public key operations using
                   2866: any supported algorithm.
                   2867: .Pp
                   2868: The options are as follows:
                   2869: .Bl -tag -width Ds
                   2870: .It Fl asn1parse
1.84      jmc      2871: ASN.1 parse the output data.
1.1       jsing    2872: This is useful when combined with the
                   2873: .Fl verifyrecover
1.84      jmc      2874: option when an ASN.1 structure is signed.
1.1       jsing    2875: .It Fl certin
                   2876: The input is a certificate containing a public key.
                   2877: .It Fl decrypt
                   2878: Decrypt the input data using a private key.
                   2879: .It Fl derive
                   2880: Derive a shared secret using the peer key.
                   2881: .It Fl encrypt
                   2882: Encrypt the input data using a public key.
                   2883: .It Fl hexdump
                   2884: Hex dump the output data.
                   2885: .It Fl in Ar file
1.62      jmc      2886: The input file to read from,
                   2887: or standard input if not specified.
1.1       jsing    2888: .It Fl inkey Ar file
                   2889: The input key file.
                   2890: By default it should be a private key.
1.62      jmc      2891: .It Fl keyform Cm der | pem
                   2892: The key format.
1.1       jsing    2893: .It Fl out Ar file
1.62      jmc      2894: The output file to write to,
                   2895: or standard output if not specified.
1.1       jsing    2896: .It Fl passin Ar arg
                   2897: The key password source.
1.62      jmc      2898: .It Fl peerform Cm der | pem
                   2899: The peer key format.
1.1       jsing    2900: .It Fl peerkey Ar file
                   2901: The peer key file, used by key derivation (agreement) operations.
                   2902: .It Fl pkeyopt Ar opt : Ns Ar value
1.62      jmc      2903: Set the public key algorithm option
                   2904: .Ar opt
                   2905: to
                   2906: .Ar value .
                   2907: Unless otherwise mentioned, all algorithms support the format
                   2908: .Ar digest : Ns Ar alg ,
                   2909: which specifies the digest to use
1.1       jsing    2910: for sign, verify, and verifyrecover operations.
                   2911: The value
                   2912: .Ar alg
                   2913: should represent a digest name as used in the
1.62      jmc      2914: .Xr EVP_get_digestbyname 3
                   2915: function.
                   2916: .Pp
1.1       jsing    2917: The RSA algorithm supports the
                   2918: encrypt, decrypt, sign, verify, and verifyrecover operations in general.
                   2919: Some padding modes only support some of these
                   2920: operations however.
                   2921: .Bl -tag -width Ds
                   2922: .It rsa_padding_mode : Ns Ar mode
                   2923: This sets the RSA padding mode.
                   2924: Acceptable values for
                   2925: .Ar mode
                   2926: are
                   2927: .Cm pkcs1
                   2928: for PKCS#1 padding;
                   2929: .Cm none
                   2930: for no padding;
                   2931: .Cm oaep
                   2932: for OAEP mode;
                   2933: .Cm x931
                   2934: for X9.31 mode;
                   2935: and
                   2936: .Cm pss
                   2937: for PSS.
                   2938: .Pp
                   2939: In PKCS#1 padding if the message digest is not set then the supplied data is
                   2940: signed or verified directly instead of using a DigestInfo structure.
                   2941: If a digest is set then a DigestInfo
                   2942: structure is used and its length
                   2943: must correspond to the digest type.
                   2944: For oeap mode only encryption and decryption is supported.
                   2945: For x931 if the digest type is set it is used to format the block data;
                   2946: otherwise the first byte is used to specify the X9.31 digest ID.
                   2947: Sign, verify, and verifyrecover can be performed in this mode.
                   2948: For pss mode only sign and verify are supported and the digest type must be
                   2949: specified.
                   2950: .It rsa_pss_saltlen : Ns Ar len
                   2951: For pss
                   2952: mode only this option specifies the salt length.
                   2953: Two special values are supported:
                   2954: -1 sets the salt length to the digest length.
                   2955: When signing -2 sets the salt length to the maximum permissible value.
                   2956: When verifying -2 causes the salt length to be automatically determined
                   2957: based on the PSS block structure.
                   2958: .El
1.62      jmc      2959: .Pp
1.1       jsing    2960: The DSA algorithm supports the sign and verify operations.
                   2961: Currently there are no additional options other than
                   2962: .Ar digest .
                   2963: Only the SHA1 digest can be used and this digest is assumed by default.
1.62      jmc      2964: .Pp
1.1       jsing    2965: The DH algorithm supports the derive operation
                   2966: and no additional options.
1.62      jmc      2967: .Pp
1.1       jsing    2968: The EC algorithm supports the sign, verify, and derive operations.
                   2969: The sign and verify operations use ECDSA and derive uses ECDH.
                   2970: Currently there are no additional options other than
                   2971: .Ar digest .
                   2972: Only the SHA1 digest can be used and this digest is assumed by default.
1.62      jmc      2973: .It Fl pubin
                   2974: The input file is a public key.
                   2975: .It Fl rev
                   2976: Reverse the order of the input buffer.
                   2977: .It Fl sigfile Ar file
                   2978: Signature file (verify operation only).
                   2979: .It Fl sign
                   2980: Sign the input data and output the signed result.
                   2981: This requires a private key.
                   2982: .It Fl verify
                   2983: Verify the input data against the signature file and indicate if the
                   2984: verification succeeded or failed.
                   2985: .It Fl verifyrecover
                   2986: Verify the input data and output the recovered data.
                   2987: .El
1.1       jsing    2988: .Sh PRIME
                   2989: .Cm openssl prime
                   2990: .Op Fl bits Ar n
                   2991: .Op Fl checks Ar n
                   2992: .Op Fl generate
                   2993: .Op Fl hex
                   2994: .Op Fl safe
                   2995: .Ar p
                   2996: .Pp
                   2997: The
                   2998: .Nm prime
                   2999: command is used to generate prime numbers,
                   3000: or to check numbers for primality.
                   3001: Results are probabilistic:
                   3002: they have an exceedingly high likelihood of being correct,
                   3003: but are not guaranteed.
                   3004: .Pp
                   3005: The options are as follows:
                   3006: .Bl -tag -width Ds
                   3007: .It Fl bits Ar n
                   3008: Specify the number of bits in the generated prime number.
                   3009: Must be used in conjunction with
                   3010: .Fl generate .
                   3011: .It Fl checks Ar n
                   3012: Perform a Miller-Rabin probabilistic primality test with
                   3013: .Ar n
                   3014: iterations.
                   3015: The default is 20.
                   3016: .It Fl generate
                   3017: Generate a pseudo-random prime number.
                   3018: Must be used in conjunction with
                   3019: .Fl bits .
                   3020: .It Fl hex
                   3021: Output in hex format.
                   3022: .It Fl safe
                   3023: Generate only
                   3024: .Qq safe
                   3025: prime numbers
                   3026: (i.e. a prime p so that (p-1)/2 is also prime).
                   3027: .It Ar p
                   3028: Test if number
                   3029: .Ar p
                   3030: is prime.
                   3031: .El
                   3032: .Sh RAND
                   3033: .nr nS 1
                   3034: .Nm "openssl rand"
                   3035: .Op Fl base64
                   3036: .Op Fl hex
                   3037: .Op Fl out Ar file
                   3038: .Ar num
                   3039: .nr nS 0
                   3040: .Pp
                   3041: The
                   3042: .Nm rand
                   3043: command outputs
                   3044: .Ar num
                   3045: pseudo-random bytes.
                   3046: .Pp
                   3047: The options are as follows:
                   3048: .Bl -tag -width Ds
                   3049: .It Fl base64
1.81      jmc      3050: Perform base64 encoding on the output.
1.1       jsing    3051: .It Fl hex
                   3052: Specify hexadecimal output.
                   3053: .It Fl out Ar file
1.63      jmc      3054: The output file to write to,
                   3055: or standard output if not specified.
1.1       jsing    3056: .El
                   3057: .Sh REQ
                   3058: .nr nS 1
                   3059: .Nm "openssl req"
                   3060: .Op Fl asn1-kludge
                   3061: .Op Fl batch
                   3062: .Op Fl config Ar file
                   3063: .Op Fl days Ar n
                   3064: .Op Fl extensions Ar section
                   3065: .Op Fl in Ar file
1.63      jmc      3066: .Op Fl inform Cm der | pem
1.1       jsing    3067: .Op Fl key Ar keyfile
1.63      jmc      3068: .Op Fl keyform Cm der | pem
1.1       jsing    3069: .Op Fl keyout Ar file
1.28      doug     3070: .Op Fl md4 | md5 | sha1
1.1       jsing    3071: .Op Fl modulus
                   3072: .Op Fl nameopt Ar option
                   3073: .Op Fl new
                   3074: .Op Fl newhdr
                   3075: .Op Fl newkey Ar arg
                   3076: .Op Fl no-asn1-kludge
                   3077: .Op Fl nodes
                   3078: .Op Fl noout
                   3079: .Op Fl out Ar file
1.63      jmc      3080: .Op Fl outform Cm der | pem
1.1       jsing    3081: .Op Fl passin Ar arg
                   3082: .Op Fl passout Ar arg
                   3083: .Op Fl pubkey
                   3084: .Op Fl reqexts Ar section
                   3085: .Op Fl reqopt Ar option
                   3086: .Op Fl set_serial Ar n
                   3087: .Op Fl subj Ar arg
                   3088: .Op Fl subject
                   3089: .Op Fl text
                   3090: .Op Fl utf8
                   3091: .Op Fl verbose
                   3092: .Op Fl verify
                   3093: .Op Fl x509
                   3094: .nr nS 0
                   3095: .Pp
                   3096: The
                   3097: .Nm req
                   3098: command primarily creates and processes certificate requests
                   3099: in PKCS#10 format.
                   3100: It can additionally create self-signed certificates,
                   3101: for use as root CAs, for example.
                   3102: .Pp
                   3103: The options are as follows:
                   3104: .Bl -tag -width Ds
                   3105: .It Fl asn1-kludge
1.63      jmc      3106: Produce requests in an invalid format for certain picky CAs.
                   3107: Very few CAs still require the use of this option.
1.1       jsing    3108: .It Fl batch
                   3109: Non-interactive mode.
                   3110: .It Fl config Ar file
1.63      jmc      3111: Specify an alternative configuration file.
1.1       jsing    3112: .It Fl days Ar n
1.63      jmc      3113: Specify the number of days to certify the certificate for.
                   3114: The default is 30 days.
                   3115: Used with the
1.1       jsing    3116: .Fl x509
1.63      jmc      3117: option.
1.1       jsing    3118: .It Fl extensions Ar section , Fl reqexts Ar section
1.63      jmc      3119: Specify alternative sections to include certificate
                   3120: extensions (with
                   3121: .Fl x509 )
                   3122: or certificate request extensions,
                   3123: allowing several different sections to be used in the same configuration file.
1.1       jsing    3124: .It Fl in Ar file
1.63      jmc      3125: The input file to read a request from,
                   3126: or standard input if not specified.
1.1       jsing    3127: A request is only read if the creation options
                   3128: .Fl new
                   3129: and
                   3130: .Fl newkey
                   3131: are not specified.
1.63      jmc      3132: .It Fl inform Cm der | pem
                   3133: The input format.
1.1       jsing    3134: .It Fl key Ar keyfile
1.63      jmc      3135: The file to read the private key from.
1.1       jsing    3136: It also accepts PKCS#8 format private keys for PEM format files.
1.63      jmc      3137: .It Fl keyform Cm der | pem
1.1       jsing    3138: The format of the private key file specified in the
                   3139: .Fl key
                   3140: argument.
1.81      jmc      3141: The default is
                   3142: .Cm pem .
1.1       jsing    3143: .It Fl keyout Ar file
1.63      jmc      3144: The file to write the newly created private key to.
                   3145: If this option is not specified,
                   3146: the filename present in the configuration file is used.
1.4       sthen    3147: .It Fl md5 | sha1 | sha256
1.63      jmc      3148: The message digest to sign the request with.
1.1       jsing    3149: This overrides the digest algorithm specified in the configuration file.
                   3150: .Pp
                   3151: Some public key algorithms may override this choice.
                   3152: For instance, DSA signatures always use SHA1.
                   3153: .It Fl modulus
1.63      jmc      3154: Print the value of the modulus of the public key contained in the request.
1.1       jsing    3155: .It Fl nameopt Ar option , Fl reqopt Ar option
1.63      jmc      3156: Determine how the subject or issuer names are displayed.
1.1       jsing    3157: .Ar option
1.63      jmc      3158: can be a single option or multiple options separated by commas.
1.1       jsing    3159: Alternatively, these options may be used more than once to set multiple options.
                   3160: See the
                   3161: .Sx X509
                   3162: section below for details.
                   3163: .It Fl new
1.63      jmc      3164: Generate a new certificate request.
                   3165: The user is prompted for the relevant field values.
1.1       jsing    3166: The actual fields prompted for and their maximum and minimum sizes
                   3167: are specified in the configuration file and any requested extensions.
                   3168: .Pp
                   3169: If the
                   3170: .Fl key
                   3171: option is not used, it will generate a new RSA private
                   3172: key using information specified in the configuration file.
                   3173: .It Fl newhdr
1.63      jmc      3174: Add the word NEW to the PEM file header and footer lines
1.1       jsing    3175: on the outputed request.
1.63      jmc      3176: Some software and CAs need this.
1.1       jsing    3177: .It Fl newkey Ar arg
1.63      jmc      3178: Create a new certificate request and a new private key.
1.1       jsing    3179: The argument takes one of several forms.
1.63      jmc      3180: .Pp
                   3181: .No rsa : Ns Ar nbits
                   3182: generates an RSA key
1.1       jsing    3183: .Ar nbits
                   3184: in size.
                   3185: If
                   3186: .Ar nbits
1.63      jmc      3187: is omitted
                   3188: the default key size is used.
                   3189: .Pp
                   3190: .No dsa : Ns Ar file
                   3191: generates a DSA key using the parameters in
                   3192: .Ar file .
                   3193: .Pp
                   3194: .No param : Ns Ar file
                   3195: generates a key using the parameters or certificate in
                   3196: .Ar file .
                   3197: .Pp
                   3198: All other algorithms support the form
                   3199: .Ar algorithm : Ns Ar file ,
1.1       jsing    3200: where file may be an algorithm parameter file,
                   3201: created by the
                   3202: .Cm genpkey -genparam
1.14      jmc      3203: command or an X.509 certificate for a key with appropriate algorithm.
1.63      jmc      3204: .Ar file
                   3205: can be omitted,
                   3206: in which case any parameters can be specified via the
1.1       jsing    3207: .Fl pkeyopt
                   3208: option.
                   3209: .It Fl no-asn1-kludge
1.63      jmc      3210: Reverse the effect of
1.1       jsing    3211: .Fl asn1-kludge .
                   3212: .It Fl nodes
1.63      jmc      3213: Do not encrypt the private key.
1.1       jsing    3214: .It Fl noout
1.63      jmc      3215: Do not output the encoded version of the request.
1.1       jsing    3216: .It Fl out Ar file
1.63      jmc      3217: The output file to write to,
                   3218: or standard output if not spceified.
                   3219: .It Fl outform Cm der | pem
                   3220: The output format.
1.1       jsing    3221: .It Fl passin Ar arg
                   3222: The key password source.
                   3223: .It Fl passout Ar arg
                   3224: The output file password source.
                   3225: .It Fl pubkey
1.63      jmc      3226: Output the public key.
1.1       jsing    3227: .It Fl reqopt Ar option
                   3228: Customise the output format used with
                   3229: .Fl text .
                   3230: The
                   3231: .Ar option
                   3232: argument can be a single option or multiple options separated by commas.
1.63      jmc      3233: See also the discussion of
1.1       jsing    3234: .Fl certopt
1.63      jmc      3235: in the
1.1       jsing    3236: .Nm x509
                   3237: command.
                   3238: .It Fl set_serial Ar n
                   3239: Serial number to use when outputting a self-signed certificate.
                   3240: This may be specified as a decimal value or a hex value if preceded by
                   3241: .Sq 0x .
                   3242: It is possible to use negative serial numbers but this is not recommended.
                   3243: .It Fl subj Ar arg
1.63      jmc      3244: Replaces the subject field of an input request
                   3245: with the specified data and output the modified request.
                   3246: .Ar arg
                   3247: must be formatted as /type0=value0/type1=value1/type2=...;
1.1       jsing    3248: characters may be escaped by
                   3249: .Sq \e
1.63      jmc      3250: (backslash);
1.1       jsing    3251: no spaces are skipped.
                   3252: .It Fl subject
1.63      jmc      3253: Print the request subject (or certificate subject if
1.1       jsing    3254: .Fl x509
1.63      jmc      3255: is specified).
1.1       jsing    3256: .It Fl text
1.64      jmc      3257: Print the certificate request in plain text.
1.1       jsing    3258: .It Fl utf8
1.63      jmc      3259: Interpret field values as UTF8 strings, not ASCII.
1.1       jsing    3260: .It Fl verbose
                   3261: Print extra details about the operations being performed.
                   3262: .It Fl verify
1.63      jmc      3263: Verify the signature on the request.
1.1       jsing    3264: .It Fl x509
1.63      jmc      3265: Output a self-signed certificate instead of a certificate request.
                   3266: This is typically used to generate a test certificate or a self-signed root CA.
                   3267: The extensions added to the certificate (if any)
1.1       jsing    3268: are specified in the configuration file.
                   3269: Unless specified using the
                   3270: .Fl set_serial
1.63      jmc      3271: option, 0 is used for the serial number.
1.1       jsing    3272: .El
1.63      jmc      3273: .Pp
1.1       jsing    3274: The configuration options are specified in the
1.63      jmc      3275: .Qq req
1.1       jsing    3276: section of the configuration file.
1.63      jmc      3277: The options available are as follows:
1.1       jsing    3278: .Bl -tag -width "XXXX"
1.63      jmc      3279: .It Cm attributes
                   3280: The section containing any request attributes: its format
1.1       jsing    3281: is the same as
1.63      jmc      3282: .Cm distinguished_name .
                   3283: Typically these may contain the challengePassword or unstructuredName types.
                   3284: They are currently ignored by the
                   3285: .Nm openssl
1.1       jsing    3286: request signing utilities, but some CAs might want them.
1.63      jmc      3287: .It Cm default_bits
                   3288: The default key size, in bits.
                   3289: The default is 2048.
1.1       jsing    3290: It is used if the
                   3291: .Fl new
1.63      jmc      3292: option is used and can be overridden by using the
1.1       jsing    3293: .Fl newkey
                   3294: option.
1.63      jmc      3295: .It Cm default_keyfile
                   3296: The default file to write a private key to,
                   3297: or standard output if not specified.
                   3298: It can be overridden by the
1.1       jsing    3299: .Fl keyout
                   3300: option.
1.63      jmc      3301: .It Cm default_md
                   3302: The digest algorithm to use.
1.1       jsing    3303: Possible values include
1.63      jmc      3304: .Cm md5 ,
                   3305: .Cm sha1
1.1       jsing    3306: and
1.63      jmc      3307: .Cm sha256
                   3308: (the default).
                   3309: It can be overridden on the command line.
                   3310: .It Cm distinguished_name
                   3311: The section containing the distinguished name fields to
1.1       jsing    3312: prompt for when generating a certificate or certificate request.
1.63      jmc      3313: The format is described below.
                   3314: .It Cm encrypt_key
                   3315: If set to
                   3316: .Qq no
                   3317: and a private key is generated, it is not encrypted.
                   3318: It is equivalent to the
1.1       jsing    3319: .Fl nodes
1.63      jmc      3320: option.
1.1       jsing    3321: For compatibility,
1.63      jmc      3322: .Cm encrypt_rsa_key
1.1       jsing    3323: is an equivalent option.
1.63      jmc      3324: .It Cm input_password | output_password
                   3325: The passwords for the input private key file (if present)
                   3326: and the output private key file (if one will be created).
1.1       jsing    3327: The command line options
                   3328: .Fl passin
                   3329: and
                   3330: .Fl passout
                   3331: override the configuration file values.
1.63      jmc      3332: .It Cm oid_file
                   3333: A file containing additional OBJECT IDENTIFIERS.
1.1       jsing    3334: Each line of the file should consist of the numerical form of the
                   3335: object identifier, followed by whitespace, then the short name followed
                   3336: by whitespace and finally the long name.
1.63      jmc      3337: .It Cm oid_section
                   3338: Specify a section in the configuration file containing extra
1.1       jsing    3339: object identifiers.
                   3340: Each line should consist of the short name of the
                   3341: object identifier followed by
                   3342: .Sq =
                   3343: and the numerical form.
                   3344: The short and long names are the same when this option is used.
1.63      jmc      3345: .It Cm prompt
                   3346: If set to
                   3347: .Qq no ,
                   3348: it disables prompting of certificate fields
1.1       jsing    3349: and just takes values from the config file directly.
                   3350: It also changes the expected format of the
1.63      jmc      3351: .Cm distinguished_name
1.1       jsing    3352: and
1.63      jmc      3353: .Cm attributes
1.1       jsing    3354: sections.
1.63      jmc      3355: .It Cm req_extensions
                   3356: The configuration file section containing a list of
1.1       jsing    3357: extensions to add to the certificate request.
                   3358: It can be overridden by the
                   3359: .Fl reqexts
1.63      jmc      3360: option.
                   3361: .It Cm string_mask
                   3362: Limit the string types for encoding certain fields.
1.1       jsing    3363: The following values may be used, limiting strings to the indicated types:
                   3364: .Bl -tag -width "MASK:number"
1.63      jmc      3365: .It Cm utf8only
                   3366: UTF8String.
1.1       jsing    3367: This is the default, as recommended by PKIX in RFC 2459.
1.63      jmc      3368: .It Cm default
                   3369: PrintableString, IA5String, T61String, BMPString, UTF8String.
                   3370: .It Cm pkix
                   3371: PrintableString, IA5String, BMPString, UTF8String.
                   3372: Inspired by the PKIX recommendation in RFC 2459 for certificates
                   3373: generated before 2004, but differs by also permitting IA5String.
                   3374: .It Cm nombstr
                   3375: PrintableString, IA5String, T61String, UniversalString.
                   3376: A workaround for some ancient software that had problems
                   3377: with the variable-sized BMPString and UTF8String types.
1.1       jsing    3378: .It Cm MASK : Ns Ar number
1.63      jmc      3379: An explicit bitmask of permitted types, where
1.1       jsing    3380: .Ar number
                   3381: is a C-style hex, decimal, or octal number that's a bit-wise OR of
                   3382: .Dv B_ASN1_*
                   3383: values from
                   3384: .In openssl/asn1.h .
                   3385: .El
1.63      jmc      3386: .It Cm utf8
                   3387: If set to
                   3388: .Qq yes ,
1.72      jmc      3389: field values are interpreted as UTF8 strings.
1.63      jmc      3390: .It Cm x509_extensions
                   3391: The configuration file section containing a list of
1.1       jsing    3392: extensions to add to a certificate generated when the
                   3393: .Fl x509
                   3394: switch is used.
                   3395: It can be overridden by the
                   3396: .Fl extensions
1.72      jmc      3397: command line switch.
1.1       jsing    3398: .El
1.63      jmc      3399: .Pp
1.1       jsing    3400: There are two separate formats for the distinguished name and attribute
                   3401: sections.
                   3402: If the
                   3403: .Fl prompt
                   3404: option is set to
1.63      jmc      3405: .Qq no ,
1.72      jmc      3406: then these sections just consist of field names and values.
                   3407: If the
1.1       jsing    3408: .Fl prompt
                   3409: option is absent or not set to
1.63      jmc      3410: .Qq no ,
1.72      jmc      3411: then the file contains field prompting information of the form:
1.1       jsing    3412: .Bd -unfilled -offset indent
                   3413: fieldName="prompt"
                   3414: fieldName_default="default field value"
                   3415: fieldName_min= 2
                   3416: fieldName_max= 4
                   3417: .Ed
                   3418: .Pp
                   3419: .Qq fieldName
                   3420: is the field name being used, for example
1.63      jmc      3421: .Cm commonName
                   3422: (or CN).
1.1       jsing    3423: The
                   3424: .Qq prompt
                   3425: string is used to ask the user to enter the relevant details.
                   3426: If the user enters nothing, the default value is used;
                   3427: if no default value is present, the field is omitted.
                   3428: A field can still be omitted if a default value is present,
                   3429: if the user just enters the
                   3430: .Sq \&.
                   3431: character.
                   3432: .Pp
                   3433: The number of characters entered must be between the
1.63      jmc      3434: fieldName_min and fieldName_max limits:
1.1       jsing    3435: there may be additional restrictions based on the field being used
                   3436: (for example
1.63      jmc      3437: .Cm countryName
1.1       jsing    3438: can only ever be two characters long and must fit in a
1.63      jmc      3439: .Cm PrintableString ) .
1.1       jsing    3440: .Pp
                   3441: Some fields (such as
1.63      jmc      3442: .Cm organizationName )
1.1       jsing    3443: can be used more than once in a DN.
                   3444: This presents a problem because configuration files will
                   3445: not recognize the same name occurring twice.
                   3446: To avoid this problem, if the
1.63      jmc      3447: .Cm fieldName
1.1       jsing    3448: contains some characters followed by a full stop, they will be ignored.
                   3449: So, for example, a second
1.63      jmc      3450: .Cm organizationName
1.1       jsing    3451: can be input by calling it
                   3452: .Qq 1.organizationName .
                   3453: .Pp
                   3454: The actual permitted field names are any object identifier short or
                   3455: long names.
                   3456: These are compiled into
1.63      jmc      3457: .Nm openssl
1.1       jsing    3458: and include the usual values such as
1.63      jmc      3459: .Cm commonName , countryName , localityName , organizationName ,
1.89      jmc      3460: .Cm organizationalUnitName , stateOrProvinceName .
1.1       jsing    3461: Additionally,
1.63      jmc      3462: .Cm emailAddress
1.1       jsing    3463: is included as well as
1.63      jmc      3464: .Cm name , surname , givenName , initials
1.1       jsing    3465: and
1.63      jmc      3466: .Cm dnQualifier .
1.1       jsing    3467: .Pp
                   3468: Additional object identifiers can be defined with the
1.63      jmc      3469: .Cm oid_file
1.1       jsing    3470: or
1.63      jmc      3471: .Cm oid_section
1.1       jsing    3472: options in the configuration file.
                   3473: Any additional fields will be treated as though they were a
1.63      jmc      3474: .Cm DirectoryString .
1.1       jsing    3475: .Sh RSA
                   3476: .nr nS 1
                   3477: .Nm "openssl rsa"
1.64      jmc      3478: .Op Fl aes128 | aes192 | aes256 | des | des3
1.1       jsing    3479: .Op Fl check
                   3480: .Op Fl in Ar file
1.64      jmc      3481: .Op Fl inform Cm der | net | pem
1.1       jsing    3482: .Op Fl modulus
                   3483: .Op Fl noout
                   3484: .Op Fl out Ar file
1.64      jmc      3485: .Op Fl outform Cm der | net | pem
1.1       jsing    3486: .Op Fl passin Ar arg
                   3487: .Op Fl passout Ar arg
                   3488: .Op Fl pubin
                   3489: .Op Fl pubout
                   3490: .Op Fl sgckey
                   3491: .Op Fl text
                   3492: .nr nS 0
                   3493: .Pp
                   3494: The
                   3495: .Nm rsa
                   3496: command processes RSA keys.
                   3497: They can be converted between various forms and their components printed out.
1.64      jmc      3498: .Nm rsa
                   3499: uses the traditional
1.1       jsing    3500: .Nm SSLeay
                   3501: compatible format for private key encryption:
                   3502: newer applications should use the more secure PKCS#8 format using the
                   3503: .Nm pkcs8
                   3504: utility.
                   3505: .Pp
                   3506: The options are as follows:
                   3507: .Bl -tag -width Ds
1.64      jmc      3508: .It Fl aes128 | aes192 | aes256 | des | des3
                   3509: Encrypt the private key with the AES, DES,
1.1       jsing    3510: or the triple DES ciphers, respectively, before outputting it.
                   3511: A pass phrase is prompted for.
                   3512: If none of these options are specified, the key is written in plain text.
                   3513: This means that using the
                   3514: .Nm rsa
                   3515: utility to read in an encrypted key with no encryption option can be used
                   3516: to remove the pass phrase from a key, or by setting the encryption options
                   3517: it can be used to add or change the pass phrase.
                   3518: These options can only be used with PEM format output files.
                   3519: .It Fl check
1.64      jmc      3520: Check the consistency of an RSA private key.
1.1       jsing    3521: .It Fl in Ar file
1.64      jmc      3522: The input file to read from,
                   3523: or standard input if not specified.
1.1       jsing    3524: If the key is encrypted, a pass phrase will be prompted for.
1.64      jmc      3525: .It Fl inform Cm der | net | pem
                   3526: The input format.
1.1       jsing    3527: .It Fl noout
1.64      jmc      3528: Do not output the encoded version of the key.
1.1       jsing    3529: .It Fl modulus
1.64      jmc      3530: Print the value of the modulus of the key.
1.1       jsing    3531: .It Fl out Ar file
1.64      jmc      3532: The output file to write to,
                   3533: or standard output if not specified.
                   3534: .It Fl outform Cm der | net | pem
                   3535: The output format.
1.1       jsing    3536: .It Fl passin Ar arg
                   3537: The key password source.
                   3538: .It Fl passout Ar arg
                   3539: The output file password source.
                   3540: .It Fl pubin
1.64      jmc      3541: Read in a public key,
                   3542: not a private key.
1.1       jsing    3543: .It Fl pubout
1.64      jmc      3544: Output a public key,
                   3545: not a private key.
                   3546: Automatically set if the input is a public key.
1.1       jsing    3547: .It Fl sgckey
1.64      jmc      3548: Use the modified NET algorithm used with some versions of Microsoft IIS
                   3549: and SGC keys.
1.1       jsing    3550: .It Fl text
1.64      jmc      3551: Print the public/private key components in plain text.
1.1       jsing    3552: .El
                   3553: .Sh RSAUTL
                   3554: .nr nS 1
                   3555: .Nm "openssl rsautl"
                   3556: .Op Fl asn1parse
                   3557: .Op Fl certin
                   3558: .Op Fl decrypt
                   3559: .Op Fl encrypt
                   3560: .Op Fl hexdump
                   3561: .Op Fl in Ar file
                   3562: .Op Fl inkey Ar file
1.65      jmc      3563: .Op Fl keyform Cm der | pem
1.86      jsing    3564: .Op Fl oaep | pkcs | raw
1.1       jsing    3565: .Op Fl out Ar file
                   3566: .Op Fl pubin
                   3567: .Op Fl sign
                   3568: .Op Fl verify
                   3569: .nr nS 0
                   3570: .Pp
                   3571: The
                   3572: .Nm rsautl
                   3573: command can be used to sign, verify, encrypt and decrypt
                   3574: data using the RSA algorithm.
                   3575: .Pp
                   3576: The options are as follows:
                   3577: .Bl -tag -width Ds
                   3578: .It Fl asn1parse
                   3579: Asn1parse the output data; this is useful when combined with the
                   3580: .Fl verify
                   3581: option.
                   3582: .It Fl certin
                   3583: The input is a certificate containing an RSA public key.
                   3584: .It Fl decrypt
                   3585: Decrypt the input data using an RSA private key.
                   3586: .It Fl encrypt
                   3587: Encrypt the input data using an RSA public key.
                   3588: .It Fl hexdump
                   3589: Hex dump the output data.
                   3590: .It Fl in Ar file
1.65      jmc      3591: The input to read from,
                   3592: or standard input if not specified.
1.1       jsing    3593: .It Fl inkey Ar file
1.65      jmc      3594: The input key file; by default an RSA private key.
                   3595: .It Fl keyform Cm der | pem
1.85      tb       3596: The private key format.
1.65      jmc      3597: The default is
                   3598: .Cm pem .
1.86      jsing    3599: .It Fl oaep | pkcs | raw
1.1       jsing    3600: The padding to use:
1.65      jmc      3601: PKCS#1 OAEP, PKCS#1 v1.5 (the default), or no padding, respectively.
1.1       jsing    3602: For signatures, only
                   3603: .Fl pkcs
                   3604: and
                   3605: .Fl raw
                   3606: can be used.
                   3607: .It Fl out Ar file
1.65      jmc      3608: The output file to write to,
                   3609: or standard output if not specified.
1.1       jsing    3610: .It Fl pubin
                   3611: The input file is an RSA public key.
                   3612: .It Fl sign
                   3613: Sign the input data and output the signed result.
                   3614: This requires an RSA private key.
                   3615: .It Fl verify
                   3616: Verify the input data and output the recovered data.
                   3617: .El
                   3618: .Sh S_CLIENT
                   3619: .nr nS 1
                   3620: .Nm "openssl s_client"
                   3621: .Op Fl 4 | 6
                   3622: .Op Fl bugs
                   3623: .Op Fl CAfile Ar file
                   3624: .Op Fl CApath Ar directory
                   3625: .Op Fl cert Ar file
                   3626: .Op Fl check_ss_sig
                   3627: .Op Fl cipher Ar cipherlist
1.66      jmc      3628: .Op Fl connect Ar host Ns Op : Ns Ar port
1.1       jsing    3629: .Op Fl crl_check
                   3630: .Op Fl crl_check_all
                   3631: .Op Fl crlf
                   3632: .Op Fl debug
                   3633: .Op Fl extended_crl
1.87      jmc      3634: .Op Fl groups
1.1       jsing    3635: .Op Fl ign_eof
                   3636: .Op Fl ignore_critical
                   3637: .Op Fl issuer_checks
                   3638: .Op Fl key Ar keyfile
                   3639: .Op Fl msg
                   3640: .Op Fl nbio
                   3641: .Op Fl nbio_test
                   3642: .Op Fl no_ticket
                   3643: .Op Fl no_tls1
1.6       guenther 3644: .Op Fl no_tls1_1
                   3645: .Op Fl no_tls1_2
1.1       jsing    3646: .Op Fl pause
                   3647: .Op Fl policy_check
                   3648: .Op Fl prexit
1.11      bluhm    3649: .Op Fl proxy Ar host : Ns Ar port
1.1       jsing    3650: .Op Fl psk Ar key
                   3651: .Op Fl psk_identity Ar identity
                   3652: .Op Fl quiet
                   3653: .Op Fl reconnect
1.5       jsing    3654: .Op Fl servername Ar name
1.1       jsing    3655: .Op Fl showcerts
                   3656: .Op Fl starttls Ar protocol
                   3657: .Op Fl state
                   3658: .Op Fl tls1
1.31      jmc      3659: .Op Fl tls1_1
                   3660: .Op Fl tls1_2
1.1       jsing    3661: .Op Fl tlsextdebug
                   3662: .Op Fl verify Ar depth
                   3663: .Op Fl x509_strict
1.19      landry   3664: .Op Fl xmpphost Ar host
1.1       jsing    3665: .nr nS 0
                   3666: .Pp
                   3667: The
                   3668: .Nm s_client
                   3669: command implements a generic SSL/TLS client which connects
                   3670: to a remote host using SSL/TLS.
1.66      jmc      3671: .Pp
                   3672: If a connection is established with an SSL server, any data received
                   3673: from the server is displayed and any key presses will be sent to the
                   3674: server.
                   3675: When used interactively (which means neither
                   3676: .Fl quiet
                   3677: nor
                   3678: .Fl ign_eof
                   3679: have been given), the session will be renegotiated if the line begins with an
                   3680: .Cm R ;
                   3681: if the line begins with a
                   3682: .Cm Q
                   3683: or if end of file is reached, the connection will be closed down.
1.1       jsing    3684: .Pp
                   3685: The options are as follows:
                   3686: .Bl -tag -width Ds
                   3687: .It Fl 4
1.66      jmc      3688: Attempt connections using IPv4 only.
1.1       jsing    3689: .It Fl 6
1.66      jmc      3690: Attempt connections using IPv6 only.
1.1       jsing    3691: .It Fl bugs
1.66      jmc      3692: Enable various workarounds for buggy implementations.
1.1       jsing    3693: .It Fl CAfile Ar file
                   3694: A
                   3695: .Ar file
                   3696: containing trusted certificates to use during server authentication
                   3697: and to use when attempting to build the client certificate chain.
                   3698: .It Fl CApath Ar directory
                   3699: The
                   3700: .Ar directory
                   3701: to use for server certificate verification.
                   3702: This directory must be in
                   3703: .Qq hash format ;
                   3704: see
                   3705: .Fl verify
                   3706: for more information.
                   3707: These are also used when building the client certificate chain.
                   3708: .It Fl cert Ar file
                   3709: The certificate to use, if one is requested by the server.
                   3710: The default is not to use a certificate.
                   3711: .It Xo
                   3712: .Fl check_ss_sig ,
                   3713: .Fl crl_check ,
                   3714: .Fl crl_check_all ,
                   3715: .Fl extended_crl ,
                   3716: .Fl ignore_critical ,
                   3717: .Fl issuer_checks ,
                   3718: .Fl policy_check ,
                   3719: .Fl x509_strict
                   3720: .Xc
                   3721: Set various certificate chain validation options.
                   3722: See the
1.66      jmc      3723: .Nm verify
1.1       jsing    3724: command for details.
                   3725: .It Fl cipher Ar cipherlist
1.66      jmc      3726: Modify the cipher list sent by the client.
1.1       jsing    3727: Although the server determines which cipher suite is used, it should take
                   3728: the first supported cipher in the list sent by the client.
                   3729: See the
1.66      jmc      3730: .Nm ciphers
                   3731: command for more information.
                   3732: .It Fl connect Ar host Ns Op : Ns Ar port
                   3733: The
1.1       jsing    3734: .Ar host
1.66      jmc      3735: and
1.1       jsing    3736: .Ar port
                   3737: to connect to.
                   3738: If not specified, an attempt is made to connect to the local host
                   3739: on port 4433.
                   3740: Alternatively, the host and port pair may be separated using a forward-slash
1.66      jmc      3741: character,
                   3742: which is useful for numeric IPv6 addresses.
1.1       jsing    3743: .It Fl crlf
1.66      jmc      3744: Translate a line feed from the terminal into CR+LF,
                   3745: as required by some servers.
1.1       jsing    3746: .It Fl debug
1.66      jmc      3747: Print extensive debugging information, including a hex dump of all traffic.
1.87      jmc      3748: .It Fl groups Ar ecgroups
                   3749: Specify a colon-separated list of permitted EC curve groups.
1.1       jsing    3750: .It Fl ign_eof
1.66      jmc      3751: Inhibit shutting down the connection when end of file is reached in the input.
1.1       jsing    3752: .It Fl key Ar keyfile
                   3753: The private key to use.
                   3754: If not specified, the certificate file will be used.
                   3755: .It Fl msg
                   3756: Show all protocol messages with hex dump.
                   3757: .It Fl nbio
1.66      jmc      3758: Turn on non-blocking I/O.
1.1       jsing    3759: .It Fl nbio_test
1.66      jmc      3760: Test non-blocking I/O.
1.31      jmc      3761: .It Fl no_tls1 | no_tls1_1 | no_tls1_2
1.66      jmc      3762: Disable the use of TLS1.0, 1.1, and 1.2, respectively.
1.1       jsing    3763: .It Fl no_ticket
                   3764: Disable RFC 4507 session ticket support.
                   3765: .It Fl pause
1.66      jmc      3766: Pause 1 second between each read and write call.
1.1       jsing    3767: .It Fl prexit
                   3768: Print session information when the program exits.
                   3769: This will always attempt
                   3770: to print out information even if the connection fails.
                   3771: Normally, information will only be printed out once if the connection succeeds.
                   3772: This option is useful because the cipher in use may be renegotiated
                   3773: or the connection may fail because a client certificate is required or is
                   3774: requested only after an attempt is made to access a certain URL.
1.66      jmc      3775: Note that the output produced by this option is not always accurate
                   3776: because a connection might never have been established.
1.11      bluhm    3777: .It Fl proxy Ar host : Ns Ar port
                   3778: Use the HTTP proxy at
                   3779: .Ar host
                   3780: and
                   3781: .Ar port .
                   3782: The connection to the proxy is done in cleartext and the
                   3783: .Fl connect
                   3784: argument is given to the proxy.
                   3785: If not specified, localhost is used as final destination.
                   3786: After that, switch the connection through the proxy to the destination
                   3787: to TLS.
1.1       jsing    3788: .It Fl psk Ar key
                   3789: Use the PSK key
                   3790: .Ar key
                   3791: when using a PSK cipher suite.
                   3792: The key is given as a hexadecimal number without the leading 0x,
                   3793: for example -psk 1a2b3c4d.
                   3794: .It Fl psk_identity Ar identity
1.66      jmc      3795: Use the PSK
1.1       jsing    3796: .Ar identity
                   3797: when using a PSK cipher suite.
                   3798: .It Fl quiet
                   3799: Inhibit printing of session and certificate information.
                   3800: This implicitly turns on
                   3801: .Fl ign_eof
                   3802: as well.
                   3803: .It Fl reconnect
1.66      jmc      3804: Reconnect to the same server 5 times using the same session ID; this can
1.1       jsing    3805: be used as a test that session caching is working.
1.5       jsing    3806: .It Fl servername Ar name
                   3807: Include the TLS Server Name Indication (SNI) extension in the ClientHello
                   3808: message, using the specified server
                   3809: .Ar name .
1.1       jsing    3810: .It Fl showcerts
                   3811: Display the whole server certificate chain: normally only the server
                   3812: certificate itself is displayed.
                   3813: .It Fl starttls Ar protocol
1.66      jmc      3814: Send the protocol-specific messages to switch to TLS for communication.
1.1       jsing    3815: .Ar protocol
                   3816: is a keyword for the intended protocol.
                   3817: Currently, the supported keywords are
                   3818: .Qq ftp ,
                   3819: .Qq imap ,
                   3820: .Qq smtp ,
                   3821: .Qq pop3 ,
                   3822: and
                   3823: .Qq xmpp .
                   3824: .It Fl state
1.66      jmc      3825: Print the SSL session states.
1.31      jmc      3826: .It Fl tls1 | tls1_1 | tls1_2
                   3827: Permit only TLS1.0, 1.1, or 1.2, respectively.
1.1       jsing    3828: .It Fl tlsextdebug
1.66      jmc      3829: Print a hex dump of any TLS extensions received from the server.
1.1       jsing    3830: .It Fl verify Ar depth
1.66      jmc      3831: Turn on server certificate verification,
                   3832: with a maximum length of
                   3833: .Ar depth .
1.1       jsing    3834: Currently the verify operation continues after errors so all the problems
                   3835: with a certificate chain can be seen.
                   3836: As a side effect the connection will never fail due to a server
                   3837: certificate verify failure.
1.19      landry   3838: .It Fl xmpphost Ar hostname
1.66      jmc      3839: When used with
1.19      landry   3840: .Fl starttls Ar xmpp ,
1.66      jmc      3841: specify the host for the "to" attribute of the stream element.
1.19      landry   3842: If this option is not specified then the host specified with
                   3843: .Fl connect
                   3844: will be used.
1.1       jsing    3845: .El
                   3846: .Sh S_SERVER
                   3847: .nr nS 1
                   3848: .Nm "openssl s_server"
                   3849: .Op Fl accept Ar port
                   3850: .Op Fl bugs
                   3851: .Op Fl CAfile Ar file
                   3852: .Op Fl CApath Ar directory
                   3853: .Op Fl cert Ar file
                   3854: .Op Fl cipher Ar cipherlist
                   3855: .Op Fl context Ar id
                   3856: .Op Fl crl_check
                   3857: .Op Fl crl_check_all
                   3858: .Op Fl crlf
                   3859: .Op Fl dcert Ar file
                   3860: .Op Fl debug
                   3861: .Op Fl dhparam Ar file
                   3862: .Op Fl dkey Ar file
                   3863: .Op Fl hack
                   3864: .Op Fl HTTP
                   3865: .Op Fl id_prefix Ar arg
                   3866: .Op Fl key Ar keyfile
                   3867: .Op Fl msg
                   3868: .Op Fl nbio
                   3869: .Op Fl nbio_test
                   3870: .Op Fl no_dhe
                   3871: .Op Fl no_tls1
1.6       guenther 3872: .Op Fl no_tls1_1
                   3873: .Op Fl no_tls1_2
1.1       jsing    3874: .Op Fl no_tmp_rsa
                   3875: .Op Fl nocert
                   3876: .Op Fl psk Ar key
                   3877: .Op Fl psk_hint Ar hint
                   3878: .Op Fl quiet
                   3879: .Op Fl serverpref
                   3880: .Op Fl state
                   3881: .Op Fl tls1
1.31      jmc      3882: .Op Fl tls1_1
                   3883: .Op Fl tls1_2
1.1       jsing    3884: .Op Fl Verify Ar depth
                   3885: .Op Fl verify Ar depth
                   3886: .Op Fl WWW
                   3887: .Op Fl www
                   3888: .nr nS 0
                   3889: .Pp
                   3890: The
                   3891: .Nm s_server
                   3892: command implements a generic SSL/TLS server which listens
                   3893: for connections on a given port using SSL/TLS.
                   3894: .Pp
1.67      jmc      3895: If a connection request is established with a client and neither the
                   3896: .Fl www
                   3897: nor the
                   3898: .Fl WWW
                   3899: option has been used, then any data received
                   3900: from the client is displayed and any key presses are sent to the client.
                   3901: Certain single letter commands perform special operations:
                   3902: .Pp
                   3903: .Bl -tag -width "XXXX" -compact
                   3904: .It Ic P
                   3905: Send plain text, which should cause the client to disconnect.
                   3906: .It Ic Q
                   3907: End the current SSL connection and exit.
                   3908: .It Ic q
                   3909: End the current SSL connection, but still accept new connections.
                   3910: .It Ic R
                   3911: Renegotiate the SSL session and request a client certificate.
                   3912: .It Ic r
                   3913: Renegotiate the SSL session.
                   3914: .It Ic S
                   3915: Print out some session cache status information.
                   3916: .El
                   3917: .Pp
1.1       jsing    3918: The options are as follows:
                   3919: .Bl -tag -width Ds
                   3920: .It Fl accept Ar port
1.67      jmc      3921: Listen on TCP
1.1       jsing    3922: .Ar port
1.67      jmc      3923: for connections.
                   3924: The default is port 4433.
1.1       jsing    3925: .It Fl bugs
1.67      jmc      3926: Enable various workarounds for buggy implementations.
1.1       jsing    3927: .It Fl CAfile Ar file
1.67      jmc      3928: A
                   3929: .Ar file
                   3930: containing trusted certificates to use during client authentication
1.1       jsing    3931: and to use when attempting to build the server certificate chain.
                   3932: The list is also used in the list of acceptable client CAs passed to the
                   3933: client when a certificate is requested.
                   3934: .It Fl CApath Ar directory
                   3935: The
                   3936: .Ar directory
                   3937: to use for client certificate verification.
                   3938: This directory must be in
                   3939: .Qq hash format ;
                   3940: see
                   3941: .Fl verify
                   3942: for more information.
                   3943: These are also used when building the server certificate chain.
                   3944: .It Fl cert Ar file
1.67      jmc      3945: The certificate to use: most server's cipher suites require the use of a
                   3946: certificate and some require a certificate with a certain public key type.
                   3947: For example, the DSS cipher suites require a certificate containing a DSS
                   3948: (DSA) key.
1.1       jsing    3949: If not specified, the file
                   3950: .Pa server.pem
                   3951: will be used.
                   3952: .It Fl cipher Ar cipherlist
1.67      jmc      3953: Modify the cipher list used by the server.
1.1       jsing    3954: This allows the cipher list used by the server to be modified.
                   3955: When the client sends a list of supported ciphers, the first client cipher
                   3956: also included in the server list is used.
                   3957: Because the client specifies the preference order, the order of the server
                   3958: cipherlist is irrelevant.
                   3959: See the
1.67      jmc      3960: .Nm ciphers
                   3961: command for more information.
1.1       jsing    3962: .It Fl context Ar id
1.67      jmc      3963: Set the SSL context ID.
1.1       jsing    3964: It can be given any string value.
                   3965: .It Fl crl_check , crl_check_all
                   3966: Check the peer certificate has not been revoked by its CA.
                   3967: The CRLs are appended to the certificate file.
                   3968: .Fl crl_check_all
1.67      jmc      3969: checks all CRLs of all CAs in the chain.
1.1       jsing    3970: .It Fl crlf
1.67      jmc      3971: Translate a line feed from the terminal into CR+LF.
1.1       jsing    3972: .It Fl dcert Ar file , Fl dkey Ar file
                   3973: Specify an additional certificate and private key; these behave in the
                   3974: same manner as the
                   3975: .Fl cert
                   3976: and
                   3977: .Fl key
                   3978: options except there is no default if they are not specified
1.67      jmc      3979: (no additional certificate or key is used).
1.1       jsing    3980: By using RSA and DSS certificates and keys,
                   3981: a server can support clients which only support RSA or DSS cipher suites
                   3982: by using an appropriate certificate.
                   3983: .It Fl debug
1.67      jmc      3984: Print extensive debugging information, including a hex dump of all traffic.
1.1       jsing    3985: .It Fl dhparam Ar file
                   3986: The DH parameter file to use.
                   3987: The ephemeral DH cipher suites generate keys
                   3988: using a set of DH parameters.
                   3989: If not specified, an attempt is made to
                   3990: load the parameters from the server certificate file.
                   3991: If this fails, a static set of parameters hard coded into the
                   3992: .Nm s_server
                   3993: program will be used.
                   3994: .It Fl hack
1.67      jmc      3995: Enables a further workaround for some early Netscape SSL code.
1.1       jsing    3996: .It Fl HTTP
1.67      jmc      3997: Emulate a simple web server.
                   3998: Pages are resolved relative to the current directory.
                   3999: For example if the URL
1.1       jsing    4000: .Pa https://myhost/page.html
                   4001: is requested, the file
                   4002: .Pa ./page.html
                   4003: will be loaded.
                   4004: The files loaded are assumed to contain a complete and correct HTTP
                   4005: response (lines that are part of the HTTP response line and headers
                   4006: must end with CRLF).
                   4007: .It Fl id_prefix Ar arg
                   4008: Generate SSL/TLS session IDs prefixed by
                   4009: .Ar arg .
                   4010: This is mostly useful for testing any SSL/TLS code
1.81      jmc      4011: that wish to deal with multiple servers,
                   4012: when each of which might be generating a unique range of session IDs.
1.1       jsing    4013: .It Fl key Ar keyfile
                   4014: The private key to use.
                   4015: If not specified, the certificate file will be used.
                   4016: .It Fl msg
                   4017: Show all protocol messages with hex dump.
                   4018: .It Fl nbio
1.67      jmc      4019: Turn on non-blocking I/O.
1.1       jsing    4020: .It Fl nbio_test
1.67      jmc      4021: Test non-blocking I/O.
1.1       jsing    4022: .It Fl no_dhe
1.67      jmc      4023: Disable ephemeral DH cipher suites.
1.31      jmc      4024: .It Fl no_tls1 | no_tls1_1 | no_tls1_2
1.67      jmc      4025: Disable the use of TLS1.0, 1.1, and 1.2, respectively.
1.1       jsing    4026: .It Fl no_tmp_rsa
1.67      jmc      4027: Disable temporary RSA key generation.
1.1       jsing    4028: .It Fl nocert
1.67      jmc      4029: Do not use a certificate.
1.1       jsing    4030: This restricts the cipher suites available to the anonymous ones
1.67      jmc      4031: (currently just anonymous DH).
1.1       jsing    4032: .It Fl psk Ar key
                   4033: Use the PSK key
                   4034: .Ar key
                   4035: when using a PSK cipher suite.
                   4036: The key is given as a hexadecimal number without the leading 0x,
                   4037: for example -psk 1a2b3c4d.
                   4038: .It Fl psk_hint Ar hint
                   4039: Use the PSK identity hint
                   4040: .Ar hint
                   4041: when using a PSK cipher suite.
                   4042: .It Fl quiet
                   4043: Inhibit printing of session and certificate information.
                   4044: .It Fl serverpref
                   4045: Use server's cipher preferences.
                   4046: .It Fl state
1.67      jmc      4047: Print the SSL session states.
1.31      jmc      4048: .It Fl tls1 | tls1_1 | tls1_2
                   4049: Permit only TLS1.0, 1.1, or 1.2, respectively.
1.1       jsing    4050: .It Fl WWW
1.67      jmc      4051: Emulate a simple web server.
                   4052: Pages are resolved relative to the current directory.
                   4053: For example if the URL
1.1       jsing    4054: .Pa https://myhost/page.html
                   4055: is requested, the file
                   4056: .Pa ./page.html
                   4057: will be loaded.
                   4058: .It Fl www
1.67      jmc      4059: Send a status message to the client when it connects,
                   4060: including information about the ciphers used and various session parameters.
1.1       jsing    4061: The output is in HTML format so this option will normally be used with a
                   4062: web browser.
                   4063: .It Fl Verify Ar depth , Fl verify Ar depth
1.67      jmc      4064: Request a certificate chain from the client,
                   4065: with a maximum length of
                   4066: .Ar depth .
                   4067: With
                   4068: .Fl Verify ,
                   4069: the client must supply a certificate or an error occurs;
                   4070: with
                   4071: .Fl verify ,
                   4072: a certificate is requested but the client does not have to send one.
1.1       jsing    4073: .El
                   4074: .Sh S_TIME
                   4075: .nr nS 1
                   4076: .Nm "openssl s_time"
                   4077: .Op Fl bugs
                   4078: .Op Fl CAfile Ar file
                   4079: .Op Fl CApath Ar directory
                   4080: .Op Fl cert Ar file
                   4081: .Op Fl cipher Ar cipherlist
1.68      jmc      4082: .Op Fl connect Ar host Ns Op : Ns Ar port
1.1       jsing    4083: .Op Fl key Ar keyfile
                   4084: .Op Fl nbio
                   4085: .Op Fl new
1.20      lteo     4086: .Op Fl no_shutdown
1.1       jsing    4087: .Op Fl reuse
                   4088: .Op Fl time Ar seconds
                   4089: .Op Fl verify Ar depth
                   4090: .Op Fl www Ar page
                   4091: .nr nS 0
                   4092: .Pp
                   4093: The
1.68      jmc      4094: .Nm s_time
1.1       jsing    4095: command implements a generic SSL/TLS client which connects to a
                   4096: remote host using SSL/TLS.
                   4097: It can request a page from the server and includes
                   4098: the time to transfer the payload data in its timing measurements.
                   4099: It measures the number of connections within a given timeframe,
                   4100: the amount of data transferred
                   4101: .Pq if any ,
                   4102: and calculates the average time spent for one connection.
                   4103: .Pp
                   4104: The options are as follows:
                   4105: .Bl -tag -width Ds
                   4106: .It Fl bugs
1.68      jmc      4107: Enable various workarounds for buggy implementations.
1.1       jsing    4108: .It Fl CAfile Ar file
1.68      jmc      4109: A
                   4110: .Ar file
                   4111: containing trusted certificates to use during server authentication
1.1       jsing    4112: and to use when attempting to build the client certificate chain.
                   4113: .It Fl CApath Ar directory
                   4114: The directory to use for server certificate verification.
                   4115: This directory must be in
                   4116: .Qq hash format ;
                   4117: see
                   4118: .Nm verify
                   4119: for more information.
                   4120: These are also used when building the client certificate chain.
                   4121: .It Fl cert Ar file
                   4122: The certificate to use, if one is requested by the server.
                   4123: The default is not to use a certificate.
                   4124: .It Fl cipher Ar cipherlist
1.68      jmc      4125: Modify the cipher list sent by the client.
1.1       jsing    4126: Although the server determines which cipher suite is used,
                   4127: it should take the first supported cipher in the list sent by the client.
                   4128: See the
                   4129: .Nm ciphers
                   4130: command for more information.
1.68      jmc      4131: .It Fl connect Ar host Ns Op : Ns Ar port
                   4132: The host and port to connect to.
1.1       jsing    4133: .It Fl key Ar keyfile
                   4134: The private key to use.
                   4135: If not specified, the certificate file will be used.
                   4136: .It Fl nbio
1.68      jmc      4137: Turn on non-blocking I/O.
1.1       jsing    4138: .It Fl new
1.68      jmc      4139: Perform the timing test using a new session ID for each connection.
1.1       jsing    4140: If neither
                   4141: .Fl new
                   4142: nor
                   4143: .Fl reuse
                   4144: are specified,
                   4145: they are both on by default and executed in sequence.
1.20      lteo     4146: .It Fl no_shutdown
1.21      jmc      4147: Shut down the connection without sending a
1.68      jmc      4148: .Qq close notify
1.20      lteo     4149: shutdown alert to the server.
1.1       jsing    4150: .It Fl reuse
1.68      jmc      4151: Perform the timing test using the same session ID for each connection.
1.1       jsing    4152: If neither
                   4153: .Fl new
                   4154: nor
                   4155: .Fl reuse
                   4156: are specified,
                   4157: they are both on by default and executed in sequence.
                   4158: .It Fl time Ar seconds
1.68      jmc      4159: Limit
1.1       jsing    4160: .Nm s_time
1.68      jmc      4161: benchmarks to the number of
                   4162: .Ar seconds .
1.1       jsing    4163: The default is 30 seconds.
                   4164: .It Fl verify Ar depth
1.68      jmc      4165: Turn on server certificate verification,
                   4166: with a maximum length of
                   4167: .Ar depth .
1.1       jsing    4168: Currently the verify operation continues after errors, so all the problems
                   4169: with a certificate chain can be seen.
                   4170: As a side effect,
                   4171: the connection will never fail due to a server certificate verify failure.
                   4172: .It Fl www Ar page
1.68      jmc      4173: The page to GET from the server.
1.1       jsing    4174: A value of
                   4175: .Sq /
                   4176: gets the index.htm[l] page.
                   4177: If this parameter is not specified,
                   4178: .Nm s_time
                   4179: will only perform the handshake to establish SSL connections
                   4180: but not transfer any payload data.
                   4181: .El
                   4182: .Sh SESS_ID
                   4183: .nr nS 1
                   4184: .Nm "openssl sess_id"
                   4185: .Op Fl cert
                   4186: .Op Fl context Ar ID
                   4187: .Op Fl in Ar file
1.69      jmc      4188: .Op Fl inform Cm der | pem
1.1       jsing    4189: .Op Fl noout
                   4190: .Op Fl out Ar file
1.69      jmc      4191: .Op Fl outform Cm der | pem
1.1       jsing    4192: .Op Fl text
                   4193: .nr nS 0
                   4194: .Pp
                   4195: The
                   4196: .Nm sess_id
                   4197: program processes the encoded version of the SSL session structure and
                   4198: optionally prints out SSL session details
1.69      jmc      4199: (for example the SSL session master key)
1.72      jmc      4200: in human-readable format.
1.1       jsing    4201: .Pp
                   4202: The options are as follows:
                   4203: .Bl -tag -width Ds
                   4204: .It Fl cert
                   4205: If a certificate is present in the session,
                   4206: it will be output using this option;
                   4207: if the
                   4208: .Fl text
                   4209: option is also present, then it will be printed out in text form.
                   4210: .It Fl context Ar ID
1.69      jmc      4211: Set the session
1.1       jsing    4212: .Ar ID .
1.69      jmc      4213: The ID can be any string of characters.
1.1       jsing    4214: .It Fl in Ar file
1.69      jmc      4215: The input file to read from,
                   4216: or standard input if not specified.
                   4217: .It Fl inform Cm der | pem
                   4218: The input format.
                   4219: .Cm der
1.84      jmc      4220: uses an ASN.1 DER-encoded format containing session details.
1.1       jsing    4221: The precise format can vary from one version to the next.
1.69      jmc      4222: .Cm pem
                   4223: is the default format: it consists of the DER
1.1       jsing    4224: format base64-encoded with additional header and footer lines.
                   4225: .It Fl noout
1.69      jmc      4226: Do not output the encoded version of the session.
1.1       jsing    4227: .It Fl out Ar file
1.69      jmc      4228: The output file to write to,
                   4229: or standard output if not specified.
                   4230: .It Fl outform Cm der | pem
                   4231: The output format.
1.1       jsing    4232: .It Fl text
1.69      jmc      4233: Print the various public or private key components in plain text,
                   4234: in addition to the encoded version.
1.1       jsing    4235: .El
                   4236: .Pp
1.69      jmc      4237: The output of
                   4238: .Nm sess_id
                   4239: is composed as follows:
1.1       jsing    4240: .Pp
1.69      jmc      4241: .Bl -tag -width "Verify return code " -offset 3n -compact
                   4242: .It Protocol
                   4243: The protocol in use.
                   4244: .It Cipher
                   4245: The actual raw SSL or TLS cipher code.
                   4246: .It Session-ID
                   4247: The SSL session ID, in hex format.
                   4248: .It Session-ID-ctx
                   4249: The session ID context, in hex format.
                   4250: .It Master-Key
                   4251: The SSL session master key.
                   4252: .It Key-Arg
1.1       jsing    4253: The key argument; this is only used in SSL v2.
1.69      jmc      4254: .It Start Time
                   4255: The session start time.
1.1       jsing    4256: .Ux
                   4257: format.
1.69      jmc      4258: .It Timeout
                   4259: The timeout, in seconds.
                   4260: .It Verify return code
                   4261: The return code when a certificate is verified.
1.1       jsing    4262: .El
                   4263: .Pp
                   4264: Since the SSL session output contains the master key, it is possible to read
                   4265: the contents of an encrypted session using this information.
                   4266: Therefore appropriate security precautions
                   4267: should be taken if the information is being output by a
                   4268: .Qq real
                   4269: application.
                   4270: This is, however, strongly discouraged and should only be used for
                   4271: debugging purposes.
                   4272: .Sh SMIME
                   4273: .nr nS 1
                   4274: .Nm "openssl smime"
                   4275: .Oo
                   4276: .Fl aes128 | aes192 | aes256 | des |
                   4277: .Fl des3 | rc2-40 | rc2-64 | rc2-128
                   4278: .Oc
                   4279: .Op Fl binary
                   4280: .Op Fl CAfile Ar file
                   4281: .Op Fl CApath Ar directory
                   4282: .Op Fl certfile Ar file
                   4283: .Op Fl check_ss_sig
                   4284: .Op Fl content Ar file
                   4285: .Op Fl crl_check
                   4286: .Op Fl crl_check_all
                   4287: .Op Fl decrypt
                   4288: .Op Fl encrypt
                   4289: .Op Fl extended_crl
                   4290: .Op Fl from Ar addr
                   4291: .Op Fl ignore_critical
                   4292: .Op Fl in Ar file
                   4293: .Op Fl indef
1.70      jmc      4294: .Op Fl inform Cm der | pem | smime
1.1       jsing    4295: .Op Fl inkey Ar file
                   4296: .Op Fl issuer_checks
1.70      jmc      4297: .Op Fl keyform Cm pem
1.1       jsing    4298: .Op Fl md Ar digest
                   4299: .Op Fl noattr
                   4300: .Op Fl nocerts
                   4301: .Op Fl nochain
                   4302: .Op Fl nodetach
                   4303: .Op Fl noindef
                   4304: .Op Fl nointern
                   4305: .Op Fl nosigs
                   4306: .Op Fl noverify
                   4307: .Op Fl out Ar file
1.70      jmc      4308: .Op Fl outform Cm der | pem | smime
1.1       jsing    4309: .Op Fl passin Ar arg
                   4310: .Op Fl pk7out
                   4311: .Op Fl policy_check
                   4312: .Op Fl recip Ar file
                   4313: .Op Fl resign
                   4314: .Op Fl sign
                   4315: .Op Fl signer Ar file
                   4316: .Op Fl stream
                   4317: .Op Fl subject Ar s
                   4318: .Op Fl text
                   4319: .Op Fl to Ar addr
                   4320: .Op Fl verify
                   4321: .Op Fl x509_strict
                   4322: .Op Ar cert.pem ...
                   4323: .nr nS 0
                   4324: .Pp
                   4325: The
                   4326: .Nm smime
1.70      jmc      4327: command handles S/MIME mail.
                   4328: It can encrypt, decrypt, sign, and verify S/MIME messages.
                   4329: .Pp
                   4330: The MIME message must be sent without any blank lines between the
                   4331: headers and the output.
                   4332: Some mail programs will automatically add a blank line.
                   4333: Piping the mail directly to an MTA is one way to
                   4334: achieve the correct format.
                   4335: .Pp
                   4336: The supplied message to be signed or encrypted must include the necessary
                   4337: MIME headers or many S/MIME clients won't display it properly (if at all).
                   4338: Use the
                   4339: .Fl text
                   4340: option to automatically add plain text headers.
1.1       jsing    4341: .Pp
1.70      jmc      4342: A
                   4343: .Qq signed and encrypted
                   4344: message is one where a signed message is then encrypted.
                   4345: This can be produced by encrypting an already signed message.
1.1       jsing    4346: .Pp
1.70      jmc      4347: There are a number of operations that can be performed, as follows:
1.1       jsing    4348: .Bl -tag -width "XXXX"
                   4349: .It Fl decrypt
                   4350: Decrypt mail using the supplied certificate and private key.
1.70      jmc      4351: The input file is an encrypted mail message in MIME format.
1.1       jsing    4352: The decrypted mail is written to the output file.
                   4353: .It Fl encrypt
                   4354: Encrypt mail for the given recipient certificates.
1.70      jmc      4355: The input is the message to be encrypted.
                   4356: The output file is the encrypted mail, in MIME format.
1.1       jsing    4357: .It Fl pk7out
1.70      jmc      4358: Take an input message and write out a PEM-encoded PKCS#7 structure.
1.1       jsing    4359: .It Fl resign
                   4360: Resign a message: take an existing message and one or more new signers.
                   4361: .It Fl sign
                   4362: Sign mail using the supplied certificate and private key.
1.70      jmc      4363: The input file is the message to be signed.
                   4364: The signed message, in MIME format, is written to the output file.
1.1       jsing    4365: .It Fl verify
                   4366: Verify signed mail.
1.70      jmc      4367: The input is a signed mail message and the output is the signed data.
1.1       jsing    4368: Both clear text and opaque signing is supported.
                   4369: .El
                   4370: .Pp
1.14      jmc      4371: The remaining options are as follows:
1.1       jsing    4372: .Bl -tag -width "XXXX"
                   4373: .It Xo
                   4374: .Fl aes128 | aes192 | aes256 | des |
                   4375: .Fl des3 | rc2-40 | rc2-64 | rc2-128
                   4376: .Xc
                   4377: The encryption algorithm to use.
1.70      jmc      4378: 128-, 192-, or 256-bit AES, DES (56 bits), triple DES (168 bits),
1.1       jsing    4379: or 40-, 64-, or 128-bit RC2, respectively;
                   4380: if not specified, 40-bit RC2 is
                   4381: used.
                   4382: Only used with
                   4383: .Fl encrypt .
                   4384: .It Fl binary
                   4385: Normally, the input message is converted to
                   4386: .Qq canonical
1.70      jmc      4387: format which uses CR/LF as end of line,
                   4388: as required by the S/MIME specification.
1.1       jsing    4389: When this option is present no translation occurs.
1.70      jmc      4390: This is useful when handling binary data which may not be in MIME format.
1.1       jsing    4391: .It Fl CAfile Ar file
                   4392: A
                   4393: .Ar file
                   4394: containing trusted CA certificates; only used with
                   4395: .Fl verify .
                   4396: .It Fl CApath Ar directory
                   4397: A
                   4398: .Ar directory
                   4399: containing trusted CA certificates; only used with
                   4400: .Fl verify .
                   4401: This directory must be a standard certificate directory:
                   4402: that is, a hash of each subject name (using
                   4403: .Nm x509 -hash )
                   4404: should be linked to each certificate.
                   4405: .It Ar cert.pem ...
                   4406: One or more certificates of message recipients: used when encrypting
                   4407: a message.
                   4408: .It Fl certfile Ar file
                   4409: Allows additional certificates to be specified.
                   4410: When signing, these will be included with the message.
                   4411: When verifying, these will be searched for the signers' certificates.
                   4412: The certificates should be in PEM format.
                   4413: .It Xo
                   4414: .Fl check_ss_sig ,
                   4415: .Fl crl_check ,
                   4416: .Fl crl_check_all ,
                   4417: .Fl extended_crl ,
                   4418: .Fl ignore_critical ,
                   4419: .Fl issuer_checks ,
                   4420: .Fl policy_check ,
                   4421: .Fl x509_strict
                   4422: .Xc
                   4423: Set various certificate chain validation options.
                   4424: See the
1.70      jmc      4425: .Nm verify
1.1       jsing    4426: command for details.
                   4427: .It Fl content Ar file
1.70      jmc      4428: A file containing the detached content.
1.1       jsing    4429: This is only useful with the
                   4430: .Fl verify
1.70      jmc      4431: option,
                   4432: and only usable if the PKCS#7 structure is using the detached
1.1       jsing    4433: signature form where the content is not included.
1.70      jmc      4434: This option will override any content if the input format is S/MIME
                   4435: and it uses the multipart/signed MIME content type.
1.1       jsing    4436: .It Xo
                   4437: .Fl from Ar addr ,
                   4438: .Fl subject Ar s ,
                   4439: .Fl to Ar addr
                   4440: .Xc
                   4441: The relevant mail headers.
                   4442: These are included outside the signed
                   4443: portion of a message so they may be included manually.
1.70      jmc      4444: When signing, many S/MIME
1.1       jsing    4445: mail clients check that the signer's certificate email
                   4446: address matches the From: address.
                   4447: .It Fl in Ar file
1.70      jmc      4448: The input file to read from.
1.1       jsing    4449: .It Fl indef
                   4450: Enable streaming I/O for encoding operations.
                   4451: This permits single pass processing of data without
                   4452: the need to hold the entire contents in memory,
                   4453: potentially supporting very large files.
                   4454: Streaming is automatically set for S/MIME signing with detached
                   4455: data if the output format is SMIME;
                   4456: it is currently off by default for all other operations.
1.70      jmc      4457: .It Fl inform Cm der | pem | smime
                   4458: The input format.
1.1       jsing    4459: .It Fl inkey Ar file
1.70      jmc      4460: The private key to use when signing or decrypting,
                   4461: which must match the corresponding certificate.
1.1       jsing    4462: If this option is not specified, the private key must be included
                   4463: in the certificate file specified with
                   4464: the
                   4465: .Fl recip
                   4466: or
                   4467: .Fl signer
                   4468: file.
                   4469: When signing,
                   4470: this option can be used multiple times to specify successive keys.
1.70      jmc      4471: .It Fl keyform Cm pem
1.1       jsing    4472: Input private key format.
                   4473: .It Fl md Ar digest
                   4474: The digest algorithm to use when signing or resigning.
                   4475: If not present then the default digest algorithm for the signing key is used
                   4476: (usually SHA1).
                   4477: .It Fl noattr
1.70      jmc      4478: Do not include attributes.
1.1       jsing    4479: .It Fl nocerts
1.70      jmc      4480: Do not include the signer's certificate.
1.1       jsing    4481: This will reduce the size of the signed message but the verifier must
                   4482: have a copy of the signer's certificate available locally (passed using the
                   4483: .Fl certfile
                   4484: option, for example).
                   4485: .It Fl nochain
                   4486: Do not do chain verification of signers' certificates: that is,
                   4487: don't use the certificates in the signed message as untrusted CAs.
                   4488: .It Fl nodetach
                   4489: When signing a message use opaque signing: this form is more resistant
                   4490: to translation by mail relays but it cannot be read by mail agents that
1.70      jmc      4491: do not support S/MIME.
                   4492: Without this option cleartext signing with the MIME type
                   4493: multipart/signed is used.
1.1       jsing    4494: .It Fl noindef
1.70      jmc      4495: Disable streaming I/O where it would produce an encoding of indefinite length
                   4496: (currently has no effect).
1.1       jsing    4497: .It Fl nointern
1.70      jmc      4498: Only use certificates specified in the
                   4499: .Fl certfile .
                   4500: The supplied certificates can still be used as untrusted CAs.
1.1       jsing    4501: .It Fl nosigs
1.70      jmc      4502: Do not try to verify the signatures on the message.
1.1       jsing    4503: .It Fl noverify
                   4504: Do not verify the signer's certificate of a signed message.
                   4505: .It Fl out Ar file
1.70      jmc      4506: The output file to write to.
                   4507: .It Fl outform Cm der | pem | smime
                   4508: The output format.
                   4509: The default is smime, which writes an S/MIME format message.
                   4510: .Cm pem
1.1       jsing    4511: and
1.70      jmc      4512: .Cm der
                   4513: change this to write PEM and DER format PKCS#7 structures instead.
1.1       jsing    4514: This currently only affects the output format of the PKCS#7
                   4515: structure; if no PKCS#7 structure is being output (for example with
                   4516: .Fl verify
                   4517: or
                   4518: .Fl decrypt )
                   4519: this option has no effect.
                   4520: .It Fl passin Ar arg
                   4521: The key password source.
                   4522: .It Fl recip Ar file
                   4523: The recipients certificate when decrypting a message.
                   4524: This certificate
                   4525: must match one of the recipients of the message or an error occurs.
                   4526: .It Fl signer Ar file
                   4527: A signing certificate when signing or resigning a message;
                   4528: this option can be used multiple times if more than one signer is required.
                   4529: If a message is being verified, the signer's certificates will be
                   4530: written to this file if the verification was successful.
                   4531: .It Fl stream
                   4532: The same as
                   4533: .Fl indef .
                   4534: .It Fl text
1.70      jmc      4535: Add plain text (text/plain) MIME
1.1       jsing    4536: headers to the supplied message if encrypting or signing.
                   4537: If decrypting or verifying, it strips off text headers:
1.70      jmc      4538: if the decrypted or verified message is not of MIME type text/plain
                   4539: then an error occurs.
1.1       jsing    4540: .El
                   4541: .Pp
1.70      jmc      4542: The exit codes for
                   4543: .Nm smime
                   4544: are as follows:
1.1       jsing    4545: .Pp
1.70      jmc      4546: .Bl -tag -width "XXXX"  -offset 3n -compact
                   4547: .It 0
1.1       jsing    4548: The operation was completely successful.
1.70      jmc      4549: .It 1
1.1       jsing    4550: An error occurred parsing the command options.
1.70      jmc      4551: .It 2
1.1       jsing    4552: One of the input files could not be read.
1.70      jmc      4553: .It 3
                   4554: An error occurred creating the file or when reading the message.
                   4555: .It 4
1.1       jsing    4556: An error occurred decrypting or verifying the message.
1.70      jmc      4557: .It 5
                   4558: An error occurred writing certificates.
1.1       jsing    4559: .El
                   4560: .Sh SPEED
                   4561: .nr nS 1
                   4562: .Nm "openssl speed"
1.71      jmc      4563: .Op Ar algorithm
1.1       jsing    4564: .Op Fl decrypt
                   4565: .Op Fl elapsed
1.71      jmc      4566: .Op Fl evp Ar algorithm
1.1       jsing    4567: .Op Fl mr
                   4568: .Op Fl multi Ar number
                   4569: .nr nS 0
                   4570: .Pp
                   4571: The
                   4572: .Nm speed
                   4573: command is used to test the performance of cryptographic algorithms.
                   4574: .Bl -tag -width "XXXX"
1.71      jmc      4575: .It Ar algorithm
                   4576: Perform the test using
                   4577: .Ar algorithm .
                   4578: The default is to test all algorithms.
1.1       jsing    4579: .It Fl decrypt
1.71      jmc      4580: Time decryption instead of encryption;
                   4581: must be used with
                   4582: .Fl evp .
1.1       jsing    4583: .It Fl elapsed
                   4584: Measure time in real time instead of CPU user time.
1.71      jmc      4585: .It Fl evp Ar algorithm
                   4586: Perform the test using one of the algorithms accepted by
                   4587: .Xr EVP_get_cipherbyname 3 .
1.1       jsing    4588: .It Fl mr
                   4589: Produce machine readable output.
                   4590: .It Fl multi Ar number
                   4591: Run
                   4592: .Ar number
                   4593: benchmarks in parallel.
                   4594: .El
1.77      jmc      4595: .Sh SPKAC
                   4596: .nr nS 1
                   4597: .Nm "openssl spkac"
                   4598: .Op Fl challenge Ar string
                   4599: .Op Fl in Ar file
                   4600: .Op Fl key Ar keyfile
                   4601: .Op Fl noout
                   4602: .Op Fl out Ar file
                   4603: .Op Fl passin Ar arg
                   4604: .Op Fl pubkey
                   4605: .Op Fl spkac Ar spkacname
                   4606: .Op Fl spksect Ar section
                   4607: .Op Fl verify
                   4608: .nr nS 0
                   4609: .Pp
                   4610: The
                   4611: .Nm spkac
                   4612: command processes signed public key and challenge (SPKAC) files.
                   4613: It can print out their contents, verify the signature,
                   4614: and produce its own SPKACs from a supplied private key.
                   4615: .Pp
                   4616: The options are as follows:
                   4617: .Bl -tag -width Ds
                   4618: .It Fl challenge Ar string
                   4619: The challenge string, if an SPKAC is being created.
                   4620: .It Fl in Ar file
                   4621: The input file to read from,
                   4622: or standard input if not specified.
                   4623: Ignored if the
                   4624: .Fl key
                   4625: option is used.
                   4626: .It Fl key Ar keyfile
                   4627: Create an SPKAC file using the private key in
                   4628: .Ar keyfile .
                   4629: The
                   4630: .Fl in , noout , spksect ,
                   4631: and
                   4632: .Fl verify
                   4633: options are ignored, if present.
                   4634: .It Fl noout
                   4635: Do not output the text version of the SPKAC.
                   4636: .It Fl out Ar file
                   4637: The output file to write to,
                   4638: or standard output if not specified.
                   4639: .It Fl passin Ar arg
                   4640: The key password source.
                   4641: .It Fl pubkey
                   4642: Output the public key of an SPKAC.
                   4643: .It Fl spkac Ar spkacname
                   4644: An alternative name for the variable containing the SPKAC.
                   4645: The default is "SPKAC".
                   4646: This option affects both generated and input SPKAC files.
                   4647: .It Fl spksect Ar section
                   4648: An alternative name for the
                   4649: .Ar section
                   4650: containing the SPKAC.
                   4651: .It Fl verify
                   4652: Verify the digital signature on the supplied SPKAC.
                   4653: .El
1.1       jsing    4654: .Sh TS
                   4655: .nr nS 1
                   4656: .Nm "openssl ts"
                   4657: .Fl query
1.29      bcook    4658: .Op Fl md4 | md5 | ripemd160 | sha1
1.1       jsing    4659: .Op Fl cert
                   4660: .Op Fl config Ar configfile
                   4661: .Op Fl data Ar file_to_hash
                   4662: .Op Fl digest Ar digest_bytes
                   4663: .Op Fl in Ar request.tsq
                   4664: .Op Fl no_nonce
                   4665: .Op Fl out Ar request.tsq
                   4666: .Op Fl policy Ar object_id
                   4667: .Op Fl text
                   4668: .nr nS 0
                   4669: .Pp
                   4670: .nr nS 1
                   4671: .Nm "openssl ts"
                   4672: .Fl reply
                   4673: .Op Fl chain Ar certs_file.pem
                   4674: .Op Fl config Ar configfile
                   4675: .Op Fl in Ar response.tsr
                   4676: .Op Fl inkey Ar private.pem
                   4677: .Op Fl out Ar response.tsr
                   4678: .Op Fl passin Ar arg
                   4679: .Op Fl policy Ar object_id
                   4680: .Op Fl queryfile Ar request.tsq
                   4681: .Op Fl section Ar tsa_section
                   4682: .Op Fl signer Ar tsa_cert.pem
                   4683: .Op Fl text
                   4684: .Op Fl token_in
                   4685: .Op Fl token_out
                   4686: .nr nS 0
                   4687: .Pp
                   4688: .nr nS 1
                   4689: .Nm "openssl ts"
                   4690: .Fl verify
                   4691: .Op Fl CAfile Ar trusted_certs.pem
                   4692: .Op Fl CApath Ar trusted_cert_path
                   4693: .Op Fl data Ar file_to_hash
                   4694: .Op Fl digest Ar digest_bytes
                   4695: .Op Fl in Ar response.tsr
                   4696: .Op Fl queryfile Ar request.tsq
                   4697: .Op Fl token_in
                   4698: .Op Fl untrusted Ar cert_file.pem
                   4699: .nr nS 0
                   4700: .Pp
                   4701: The
                   4702: .Nm ts
                   4703: command is a basic Time Stamping Authority (TSA) client and server
                   4704: application as specified in RFC 3161 (Time-Stamp Protocol, TSP).
                   4705: A TSA can be part of a PKI deployment and its role is to provide long
1.72      jmc      4706: term proof of the existence of specific data.
1.1       jsing    4707: Here is a brief description of the protocol:
                   4708: .Bl -enum
                   4709: .It
                   4710: The TSA client computes a one-way hash value for a data file and sends
                   4711: the hash to the TSA.
                   4712: .It
                   4713: The TSA attaches the current date and time to the received hash value,
                   4714: signs them and sends the time stamp token back to the client.
                   4715: By creating this token the TSA certifies the existence of the original
                   4716: data file at the time of response generation.
                   4717: .It
                   4718: The TSA client receives the time stamp token and verifies the
                   4719: signature on it.
                   4720: It also checks if the token contains the same hash
                   4721: value that it had sent to the TSA.
                   4722: .El
                   4723: .Pp
                   4724: There is one DER-encoded protocol data unit defined for transporting a time
                   4725: stamp request to the TSA and one for sending the time stamp response
                   4726: back to the client.
                   4727: The
                   4728: .Nm ts
                   4729: command has three main functions:
                   4730: creating a time stamp request based on a data file;
                   4731: creating a time stamp response based on a request;
                   4732: and verifying if a response corresponds
                   4733: to a particular request or a data file.
                   4734: .Pp
                   4735: There is no support for sending the requests/responses automatically
                   4736: over HTTP or TCP yet as suggested in RFC 3161.
                   4737: Users must send the requests either by FTP or email.
                   4738: .Pp
                   4739: The
                   4740: .Fl query
                   4741: switch can be used for creating and printing a time stamp
                   4742: request with the following options:
                   4743: .Bl -tag -width Ds
                   4744: .It Fl cert
1.72      jmc      4745: Expect the TSA to include its signing certificate in the response.
1.1       jsing    4746: .It Fl config Ar configfile
1.72      jmc      4747: Specify an alternative configuration file.
                   4748: Only the OID section is used.
1.1       jsing    4749: .It Fl data Ar file_to_hash
                   4750: The data file for which the time stamp request needs to be created.
1.72      jmc      4751: The default is standard input.
1.1       jsing    4752: .It Fl digest Ar digest_bytes
1.72      jmc      4753: Specify the message imprint explicitly without the data file.
1.1       jsing    4754: The imprint must be specified in a hexadecimal format,
                   4755: two characters per byte,
1.72      jmc      4756: the bytes optionally separated by colons.
1.1       jsing    4757: The number of bytes must match the message digest algorithm in use.
                   4758: .It Fl in Ar request.tsq
1.72      jmc      4759: A previously created time stamp request in DER
1.1       jsing    4760: format that will be printed into the output file.
1.72      jmc      4761: Useful for examining the content of a request in human-readable format.
1.76      jmc      4762: .It Fl md4 | md5 | ripemd160 | sha | sha1
1.1       jsing    4763: The message digest to apply to the data file.
                   4764: It supports all the message digest algorithms that are supported by the
                   4765: .Nm dgst
                   4766: command.
                   4767: The default is SHA-1.
                   4768: .It Fl no_nonce
1.72      jmc      4769: Specify no nonce in the request.
                   4770: The default, to include a 64-bit long pseudo-random nonce,
                   4771: is recommended to protect against replay attacks.
1.1       jsing    4772: .It Fl out Ar request.tsq
1.72      jmc      4773: The output file to write to,
                   4774: or standard output if not specified.
1.1       jsing    4775: .It Fl policy Ar object_id
                   4776: The policy that the client expects the TSA to use for creating the
                   4777: time stamp token.
1.72      jmc      4778: Either dotted OID notation or OID names defined
1.1       jsing    4779: in the config file can be used.
1.72      jmc      4780: If no policy is requested the TSA uses its own default policy.
1.1       jsing    4781: .It Fl text
1.72      jmc      4782: Output in human-readable text format instead of DER.
1.1       jsing    4783: .El
                   4784: .Pp
                   4785: A time stamp response (TimeStampResp) consists of a response status
                   4786: and the time stamp token itself (ContentInfo),
                   4787: if the token generation was successful.
                   4788: The
                   4789: .Fl reply
                   4790: command is for creating a time stamp
                   4791: response or time stamp token based on a request and printing the
                   4792: response/token in human-readable format.
                   4793: If
                   4794: .Fl token_out
                   4795: is not specified the output is always a time stamp response (TimeStampResp),
                   4796: otherwise it is a time stamp token (ContentInfo).
                   4797: .Bl -tag -width Ds
                   4798: .It Fl chain Ar certs_file.pem
1.72      jmc      4799: The collection of PEM certificates
1.1       jsing    4800: that will be included in the response
                   4801: in addition to the signer certificate if the
                   4802: .Fl cert
                   4803: option was used for the request.
                   4804: This file is supposed to contain the certificate chain
                   4805: for the signer certificate from its issuer upwards.
                   4806: The
                   4807: .Fl reply
                   4808: command does not build a certificate chain automatically.
                   4809: .It Fl config Ar configfile
1.72      jmc      4810: Specify an alternative configuration file.
1.1       jsing    4811: .It Fl in Ar response.tsr
1.72      jmc      4812: Specify a previously created time stamp response (or time stamp token, if
1.1       jsing    4813: .Fl token_in
1.72      jmc      4814: is also specified)
1.1       jsing    4815: in DER format that will be written to the output file.
                   4816: This option does not require a request;
                   4817: it is useful, for example,
1.72      jmc      4818: to examine the content of a response or token
                   4819: or to extract the time stamp token from a response.
1.1       jsing    4820: If the input is a token and the output is a time stamp response a default
1.72      jmc      4821: .Qq granted
1.1       jsing    4822: status info is added to the token.
                   4823: .It Fl inkey Ar private.pem
                   4824: The signer private key of the TSA in PEM format.
                   4825: Overrides the
                   4826: .Cm signer_key
                   4827: config file option.
                   4828: .It Fl out Ar response.tsr
                   4829: The response is written to this file.
                   4830: The format and content of the file depends on other options (see
                   4831: .Fl text
                   4832: and
                   4833: .Fl token_out ) .
                   4834: The default is stdout.
                   4835: .It Fl passin Ar arg
                   4836: The key password source.
                   4837: .It Fl policy Ar object_id
1.72      jmc      4838: The default policy to use for the response.
                   4839: Either dotted OID notation or OID names defined
                   4840: in the config file can be used.
                   4841: If no policy is requested the TSA uses its own default policy.
1.1       jsing    4842: .It Fl queryfile Ar request.tsq
1.72      jmc      4843: The file containing a DER-encoded time stamp request.
1.1       jsing    4844: .It Fl section Ar tsa_section
1.72      jmc      4845: The config file section containing the settings for response generation.
1.1       jsing    4846: .It Fl signer Ar tsa_cert.pem
1.72      jmc      4847: The PEM signer certificate of the TSA.
1.1       jsing    4848: The TSA signing certificate must have exactly one extended key usage
                   4849: assigned to it: timeStamping.
                   4850: The extended key usage must also be critical,
                   4851: otherwise the certificate is going to be refused.
                   4852: Overrides the
                   4853: .Cm signer_cert
                   4854: variable of the config file.
                   4855: .It Fl text
1.72      jmc      4856: Output in human-readable text format instead of DER.
1.1       jsing    4857: .It Fl token_in
1.72      jmc      4858: The input is a DER-encoded time stamp token (ContentInfo)
                   4859: instead of a time stamp response (TimeStampResp).
1.1       jsing    4860: .It Fl token_out
1.72      jmc      4861: The output is a time stamp token (ContentInfo)
                   4862: instead of a time stamp response (TimeStampResp).
1.1       jsing    4863: .El
                   4864: .Pp
                   4865: The
                   4866: .Fl verify
                   4867: command is for verifying if a time stamp response or time stamp token
                   4868: is valid and matches a particular time stamp request or data file.
                   4869: The
                   4870: .Fl verify
                   4871: command does not use the configuration file.
                   4872: .Bl -tag -width Ds
                   4873: .It Fl CAfile Ar trusted_certs.pem
1.72      jmc      4874: The file containing a set of trusted self-signed PEM CA certificates.
                   4875: See
1.1       jsing    4876: .Nm verify
                   4877: for additional details.
                   4878: Either this option or
                   4879: .Fl CApath
                   4880: must be specified.
                   4881: .It Fl CApath Ar trusted_cert_path
1.72      jmc      4882: The directory containing the trused CA certificates of the client.
                   4883: See
1.1       jsing    4884: .Nm verify
                   4885: for additional details.
                   4886: Either this option or
                   4887: .Fl CAfile
                   4888: must be specified.
                   4889: .It Fl data Ar file_to_hash
                   4890: The response or token must be verified against
                   4891: .Ar file_to_hash .
                   4892: The file is hashed with the message digest algorithm specified in the token.
                   4893: The
                   4894: .Fl digest
                   4895: and
                   4896: .Fl queryfile
                   4897: options must not be specified with this one.
                   4898: .It Fl digest Ar digest_bytes
                   4899: The response or token must be verified against the message digest specified
                   4900: with this option.
                   4901: The number of bytes must match the message digest algorithm
                   4902: specified in the token.
                   4903: The
                   4904: .Fl data
                   4905: and
                   4906: .Fl queryfile
                   4907: options must not be specified with this one.
                   4908: .It Fl in Ar response.tsr
                   4909: The time stamp response that needs to be verified, in DER format.
                   4910: This option in mandatory.
                   4911: .It Fl queryfile Ar request.tsq
                   4912: The original time stamp request, in DER format.
                   4913: The
                   4914: .Fl data
                   4915: and
                   4916: .Fl digest
                   4917: options must not be specified with this one.
                   4918: .It Fl token_in
1.72      jmc      4919: The input is a DER-encoded time stamp token (ContentInfo)
                   4920: instead of a time stamp response (TimeStampResp).
1.1       jsing    4921: .It Fl untrusted Ar cert_file.pem
1.72      jmc      4922: Additional untrusted PEM certificates which may be needed
                   4923: when building the certificate chain for the TSA's signing certificate.
1.1       jsing    4924: This file must contain the TSA signing certificate and
                   4925: all intermediate CA certificates unless the response includes them.
                   4926: .El
                   4927: .Pp
1.72      jmc      4928: Options specified on the command line always override
                   4929: the settings in the config file:
1.1       jsing    4930: .Bl -tag -width Ds
                   4931: .It Cm tsa Ar section , Cm default_tsa
                   4932: This is the main section and it specifies the name of another section
                   4933: that contains all the options for the
                   4934: .Fl reply
                   4935: option.
1.72      jmc      4936: This section can be overridden with the
1.1       jsing    4937: .Fl section
                   4938: command line switch.
                   4939: .It Cm oid_file
                   4940: See
                   4941: .Nm ca
                   4942: for a description.
                   4943: .It Cm oid_section
                   4944: See
                   4945: .Nm ca
                   4946: for a description.
                   4947: .It Cm serial
1.72      jmc      4948: The file containing the hexadecimal serial number of the
1.1       jsing    4949: last time stamp response created.
                   4950: This number is incremented by 1 for each response.
1.72      jmc      4951: If the file does not exist at the time of response generation
                   4952: a new file is created with serial number 1.
1.1       jsing    4953: This parameter is mandatory.
                   4954: .It Cm signer_cert
                   4955: TSA signing certificate, in PEM format.
                   4956: The same as the
                   4957: .Fl signer
                   4958: command line option.
                   4959: .It Cm certs
1.72      jmc      4960: A set of PEM-encoded certificates that need to be
1.1       jsing    4961: included in the response.
                   4962: The same as the
                   4963: .Fl chain
                   4964: command line option.
                   4965: .It Cm signer_key
                   4966: The private key of the TSA, in PEM format.
                   4967: The same as the
                   4968: .Fl inkey
                   4969: command line option.
                   4970: .It Cm default_policy
                   4971: The default policy to use when the request does not mandate any policy.
                   4972: The same as the
                   4973: .Fl policy
                   4974: command line option.
                   4975: .It Cm other_policies
                   4976: Comma separated list of policies that are also acceptable by the TSA
                   4977: and used only if the request explicitly specifies one of them.
                   4978: .It Cm digests
                   4979: The list of message digest algorithms that the TSA accepts.
                   4980: At least one algorithm must be specified.
                   4981: This parameter is mandatory.
                   4982: .It Cm accuracy
                   4983: The accuracy of the time source of the TSA in seconds, milliseconds
                   4984: and microseconds.
                   4985: For example, secs:1, millisecs:500, microsecs:100.
                   4986: If any of the components is missing,
                   4987: zero is assumed for that field.
                   4988: .It Cm clock_precision_digits
1.72      jmc      4989: The maximum number of digits, which represent the fraction of seconds,
                   4990: that need to be included in the time field.
1.1       jsing    4991: The trailing zeroes must be removed from the time,
1.72      jmc      4992: so there might actually be fewer digits
1.1       jsing    4993: or no fraction of seconds at all.
                   4994: The maximum value is 6;
                   4995: the default is 0.
                   4996: .It Cm ordering
                   4997: If this option is yes,
                   4998: the responses generated by this TSA can always be ordered,
                   4999: even if the time difference between two responses is less
                   5000: than the sum of their accuracies.
                   5001: The default is no.
                   5002: .It Cm tsa_name
                   5003: Set this option to yes if the subject name of the TSA must be included in
                   5004: the TSA name field of the response.
                   5005: The default is no.
                   5006: .It Cm ess_cert_id_chain
                   5007: The SignedData objects created by the TSA always contain the
                   5008: certificate identifier of the signing certificate in a signed
                   5009: attribute (see RFC 2634, Enhanced Security Services).
                   5010: If this option is set to yes and either the
                   5011: .Cm certs
                   5012: variable or the
                   5013: .Fl chain
                   5014: option is specified then the certificate identifiers of the chain will also
                   5015: be included in the SigningCertificate signed attribute.
                   5016: If this variable is set to no,
                   5017: only the signing certificate identifier is included.
                   5018: The default is no.
                   5019: .El
                   5020: .Sh VERIFY
                   5021: .nr nS 1
                   5022: .Nm "openssl verify"
                   5023: .Op Fl CAfile Ar file
                   5024: .Op Fl CApath Ar directory
                   5025: .Op Fl check_ss_sig
                   5026: .Op Fl crl_check
                   5027: .Op Fl crl_check_all
                   5028: .Op Fl explicit_policy
                   5029: .Op Fl extended_crl
                   5030: .Op Fl help
                   5031: .Op Fl ignore_critical
                   5032: .Op Fl inhibit_any
                   5033: .Op Fl inhibit_map
                   5034: .Op Fl issuer_checks
                   5035: .Op Fl policy_check
                   5036: .Op Fl purpose Ar purpose
                   5037: .Op Fl untrusted Ar file
                   5038: .Op Fl verbose
                   5039: .Op Fl x509_strict
                   5040: .Op Ar certificates
                   5041: .nr nS 0
                   5042: .Pp
                   5043: The
                   5044: .Nm verify
                   5045: command verifies certificate chains.
                   5046: .Pp
                   5047: The options are as follows:
                   5048: .Bl -tag -width Ds
                   5049: .It Fl check_ss_sig
                   5050: Verify the signature on the self-signed root CA.
                   5051: This is disabled by default
                   5052: because it doesn't add any security.
                   5053: .It Fl CAfile Ar file
                   5054: A
                   5055: .Ar file
                   5056: of trusted certificates.
                   5057: The
                   5058: .Ar file
                   5059: should contain multiple certificates in PEM format, concatenated together.
                   5060: .It Fl CApath Ar directory
                   5061: A
                   5062: .Ar directory
                   5063: of trusted certificates.
1.76      jmc      5064: The certificates, or symbolic links to them,
                   5065: should have names of the form
                   5066: .Ar hash Ns .0 ,
                   5067: where
                   5068: .Ar hash
                   5069: is the hashed certificate subject name
                   5070: (see the
1.1       jsing    5071: .Fl hash
                   5072: option of the
                   5073: .Nm x509
                   5074: utility).
                   5075: .It Fl crl_check
1.76      jmc      5076: Check end entity certificate validity by attempting to look up a valid CRL.
1.1       jsing    5077: If a valid CRL cannot be found an error occurs.
                   5078: .It Fl crl_check_all
1.76      jmc      5079: Check the validity of all certificates in the chain by attempting
1.1       jsing    5080: to look up valid CRLs.
                   5081: .It Fl explicit_policy
1.76      jmc      5082: Set policy variable require-explicit-policy (RFC 3280).
1.1       jsing    5083: .It Fl extended_crl
                   5084: Enable extended CRL features such as indirect CRLs and alternate CRL
                   5085: signing keys.
                   5086: .It Fl help
1.76      jmc      5087: Print a usage message.
1.1       jsing    5088: .It Fl ignore_critical
1.76      jmc      5089: Ignore critical extensions instead of rejecting the certificate.
1.1       jsing    5090: .It Fl inhibit_any
1.76      jmc      5091: Set policy variable inhibit-any-policy (RFC 3280).
1.1       jsing    5092: .It Fl inhibit_map
1.76      jmc      5093: Set policy variable inhibit-policy-mapping (RFC 3280).
1.1       jsing    5094: .It Fl issuer_checks
1.76      jmc      5095: Print diagnostics relating to searches for the issuer certificate
                   5096: of the current certificate
                   5097: showing why each candidate issuer certificate was rejected.
                   5098: The presence of rejection messages
                   5099: does not itself imply that anything is wrong:
                   5100: during the normal verify process several rejections may take place.
1.1       jsing    5101: .It Fl policy_check
1.76      jmc      5102: Enable certificate policy processing.
1.1       jsing    5103: .It Fl purpose Ar purpose
                   5104: The intended use for the certificate.
                   5105: Without this option no chain verification will be done.
                   5106: Currently accepted uses are
1.76      jmc      5107: .Cm sslclient , sslserver ,
                   5108: .Cm nssslserver , smimesign ,
                   5109: .Cm smimeencrypt , crlsign ,
                   5110: .Cm any ,
1.1       jsing    5111: and
1.76      jmc      5112: .Cm ocsphelper .
1.1       jsing    5113: .It Fl untrusted Ar file
                   5114: A
                   5115: .Ar file
                   5116: of untrusted certificates.
                   5117: The
                   5118: .Ar file
                   5119: should contain multiple certificates.
                   5120: .It Fl verbose
                   5121: Print extra information about the operations being performed.
                   5122: .It Fl x509_strict
                   5123: Disable workarounds for broken certificates which have to be disabled
                   5124: for strict X.509 compliance.
                   5125: .It Ar certificates
1.76      jmc      5126: One or more PEM
1.1       jsing    5127: .Ar certificates
                   5128: to verify.
                   5129: If no certificate files are included, an attempt is made to read
                   5130: a certificate from standard input.
1.76      jmc      5131: If the first certificate filename begins with a dash,
                   5132: use a lone dash to mark the last option.
1.1       jsing    5133: .El
1.76      jmc      5134: .Pp
1.1       jsing    5135: The
                   5136: .Nm verify
                   5137: program uses the same functions as the internal SSL and S/MIME verification,
1.76      jmc      5138: with one crucial difference:
                   5139: wherever possible an attempt is made to continue after an error,
                   5140: whereas normally the verify operation would halt on the first error.
1.1       jsing    5141: This allows all the problems with a certificate chain to be determined.
                   5142: .Pp
1.76      jmc      5143: The verify operation consists of a number of separate steps.
1.1       jsing    5144: Firstly a certificate chain is built up starting from the supplied certificate
                   5145: and ending in the root CA.
                   5146: It is an error if the whole chain cannot be built up.
                   5147: The chain is built up by looking up the issuer's certificate of the current
                   5148: certificate.
                   5149: If a certificate is found which is its own issuer, it is assumed
                   5150: to be the root CA.
                   5151: .Pp
1.76      jmc      5152: All certificates whose subject name matches the issuer name
1.1       jsing    5153: of the current certificate are subject to further tests.
                   5154: The relevant authority key identifier components of the current certificate
1.76      jmc      5155: (if present) must match the subject key identifier (if present)
                   5156: and issuer and serial number of the candidate issuer;
                   5157: in addition the
                   5158: .Cm keyUsage
                   5159: extension of the candidate issuer (if present) must permit certificate signing.
1.1       jsing    5160: .Pp
                   5161: The lookup first looks in the list of untrusted certificates and if no match
                   5162: is found the remaining lookups are from the trusted certificates.
1.76      jmc      5163: The root CA is always looked up in the trusted certificate list:
                   5164: if the certificate to verify is a root certificate,
                   5165: then an exact match must be found in the trusted list.
1.1       jsing    5166: .Pp
                   5167: The second operation is to check every untrusted certificate's extensions for
                   5168: consistency with the supplied purpose.
                   5169: If the
                   5170: .Fl purpose
                   5171: option is not included, then no checks are done.
                   5172: The supplied or
                   5173: .Qq leaf
                   5174: certificate must have extensions compatible with the supplied purpose
                   5175: and all other certificates must also be valid CA certificates.
                   5176: The precise extensions required are described in more detail in
                   5177: the
1.76      jmc      5178: .Nm X509
1.1       jsing    5179: section below.
                   5180: .Pp
                   5181: The third operation is to check the trust settings on the root CA.
                   5182: The root CA should be trusted for the supplied purpose.
1.76      jmc      5183: A certificate with no trust settings is considered to be valid for
1.1       jsing    5184: all purposes.
                   5185: .Pp
                   5186: The final operation is to check the validity of the certificate chain.
                   5187: The validity period is checked against the current system time and the
1.76      jmc      5188: .Cm notBefore
1.1       jsing    5189: and
1.76      jmc      5190: .Cm notAfter
1.1       jsing    5191: dates in the certificate.
                   5192: The certificate signatures are also checked at this point.
                   5193: .Pp
                   5194: If all operations complete successfully, the certificate is considered
                   5195: valid.
                   5196: If any operation fails then the certificate is not valid.
                   5197: When a verify operation fails, the output messages can be somewhat cryptic.
                   5198: The general form of the error message is:
1.76      jmc      5199: .Bd -literal
                   5200: server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024-bit)
                   5201: error 24 at 1 depth lookup:invalid CA certificate
1.1       jsing    5202: .Ed
                   5203: .Pp
                   5204: The first line contains the name of the certificate being verified, followed by
                   5205: the subject name of the certificate.
                   5206: The second line contains the error number and the depth.
                   5207: The depth is the number of the certificate being verified when a
                   5208: problem was detected starting with zero for the certificate being verified
                   5209: itself, then 1 for the CA that signed the certificate and so on.
                   5210: Finally a text version of the error number is presented.
                   5211: .Pp
                   5212: An exhaustive list of the error codes and messages is shown below; this also
                   5213: includes the name of the error code as defined in the header file
1.12      bentley  5214: .In openssl/x509_vfy.h .
1.76      jmc      5215: Some of the error codes are defined but never returned: these are described as
1.1       jsing    5216: .Qq unused .
                   5217: .Bl -tag -width "XXXX"
1.78      jmc      5218: .It 0 X509_V_OK
1.1       jsing    5219: The operation was successful.
1.78      jmc      5220: .It 2 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT
                   5221: The issuer certificate of an untrusted certificate could not be found.
                   5222: .It 3 X509_V_ERR_UNABLE_TO_GET_CRL
1.1       jsing    5223: The CRL of a certificate could not be found.
1.78      jmc      5224: .It 4 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE
1.1       jsing    5225: The certificate signature could not be decrypted.
1.78      jmc      5226: This means that the actual signature value could not be determined
                   5227: rather than it not matching the expected value.
1.1       jsing    5228: This is only meaningful for RSA keys.
1.78      jmc      5229: .It 5 X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE
                   5230: The CRL signature could not be decrypted.
                   5231: This means that the actual signature value could not be determined
                   5232: rather than it not matching the expected value.
1.1       jsing    5233: Unused.
1.78      jmc      5234: .It 6 X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY
1.1       jsing    5235: The public key in the certificate
1.76      jmc      5236: .Cm SubjectPublicKeyInfo
1.1       jsing    5237: could not be read.
1.78      jmc      5238: .It 7 X509_V_ERR_CERT_SIGNATURE_FAILURE
1.1       jsing    5239: The signature of the certificate is invalid.
1.78      jmc      5240: .It 8 X509_V_ERR_CRL_SIGNATURE_FAILURE
1.1       jsing    5241: The signature of the certificate is invalid.
1.78      jmc      5242: .It 9 X509_V_ERR_CERT_NOT_YET_VALID
1.1       jsing    5243: The certificate is not yet valid: the
1.76      jmc      5244: .Cm notBefore
1.1       jsing    5245: date is after the current time.
1.78      jmc      5246: .It 10 X509_V_ERR_CERT_HAS_EXPIRED
1.1       jsing    5247: The certificate has expired; that is, the
1.76      jmc      5248: .Cm notAfter
1.1       jsing    5249: date is before the current time.
1.78      jmc      5250: .It 11 X509_V_ERR_CRL_NOT_YET_VALID
1.1       jsing    5251: The CRL is not yet valid.
1.78      jmc      5252: .It 12 X509_V_ERR_CRL_HAS_EXPIRED
1.1       jsing    5253: The CRL has expired.
1.78      jmc      5254: .It 13 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD
1.1       jsing    5255: The certificate
1.76      jmc      5256: .Cm notBefore
1.1       jsing    5257: field contains an invalid time.
1.78      jmc      5258: .It 14 X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD
1.1       jsing    5259: The certificate
1.76      jmc      5260: .Cm notAfter
1.1       jsing    5261: field contains an invalid time.
1.78      jmc      5262: .It 15 X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD
1.1       jsing    5263: The CRL
1.76      jmc      5264: .Cm lastUpdate
1.1       jsing    5265: field contains an invalid time.
1.78      jmc      5266: .It 16 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD
1.1       jsing    5267: The CRL
1.76      jmc      5268: .Cm nextUpdate
1.1       jsing    5269: field contains an invalid time.
1.78      jmc      5270: .It 17 X509_V_ERR_OUT_OF_MEM
1.1       jsing    5271: An error occurred trying to allocate memory.
                   5272: This should never happen.
1.78      jmc      5273: .It 18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
1.1       jsing    5274: The passed certificate is self-signed and the same certificate cannot be
                   5275: found in the list of trusted certificates.
1.78      jmc      5276: .It 19 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN
1.1       jsing    5277: The certificate chain could be built up using the untrusted certificates but
                   5278: the root could not be found locally.
1.78      jmc      5279: .It 20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY
1.1       jsing    5280: The issuer certificate of a locally looked up certificate could not be found.
                   5281: This normally means the list of trusted certificates is not complete.
1.78      jmc      5282: .It 21 X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE
1.1       jsing    5283: No signatures could be verified because the chain contains only one
                   5284: certificate and it is not self-signed.
1.78      jmc      5285: .It 22 X509_V_ERR_CERT_CHAIN_TOO_LONG
1.1       jsing    5286: The certificate chain length is greater than the supplied maximum depth.
                   5287: Unused.
1.78      jmc      5288: .It 23 X509_V_ERR_CERT_REVOKED
1.1       jsing    5289: The certificate has been revoked.
1.78      jmc      5290: .It 24 X509_V_ERR_INVALID_CA
1.1       jsing    5291: A CA certificate is invalid.
                   5292: Either it is not a CA or its extensions are not consistent
                   5293: with the supplied purpose.
1.78      jmc      5294: .It 25 X509_V_ERR_PATH_LENGTH_EXCEEDED
1.1       jsing    5295: The
1.76      jmc      5296: .Cm basicConstraints
1.1       jsing    5297: pathlength parameter has been exceeded.
1.78      jmc      5298: .It 26 X509_V_ERR_INVALID_PURPOSE
1.1       jsing    5299: The supplied certificate cannot be used for the specified purpose.
1.78      jmc      5300: .It 27 X509_V_ERR_CERT_UNTRUSTED
1.1       jsing    5301: The root CA is not marked as trusted for the specified purpose.
1.78      jmc      5302: .It 28 X509_V_ERR_CERT_REJECTED
1.1       jsing    5303: The root CA is marked to reject the specified purpose.
1.78      jmc      5304: .It 29 X509_V_ERR_SUBJECT_ISSUER_MISMATCH
1.1       jsing    5305: The current candidate issuer certificate was rejected because its subject name
                   5306: did not match the issuer name of the current certificate.
                   5307: Only displayed when the
                   5308: .Fl issuer_checks
                   5309: option is set.
1.78      jmc      5310: .It 30 X509_V_ERR_AKID_SKID_MISMATCH
1.1       jsing    5311: The current candidate issuer certificate was rejected because its subject key
                   5312: identifier was present and did not match the authority key identifier current
                   5313: certificate.
                   5314: Only displayed when the
                   5315: .Fl issuer_checks
                   5316: option is set.
1.78      jmc      5317: .It 31 X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH
1.1       jsing    5318: The current candidate issuer certificate was rejected because its issuer name
                   5319: and serial number were present and did not match the authority key identifier
                   5320: of the current certificate.
                   5321: Only displayed when the
                   5322: .Fl issuer_checks
                   5323: option is set.
1.78      jmc      5324: .It 32 X509_V_ERR_KEYUSAGE_NO_CERTSIGN
1.1       jsing    5325: The current candidate issuer certificate was rejected because its
1.76      jmc      5326: .Cm keyUsage
1.1       jsing    5327: extension does not permit certificate signing.
1.78      jmc      5328: .It 50 X509_V_ERR_APPLICATION_VERIFICATION
1.1       jsing    5329: An application specific error.
                   5330: Unused.
                   5331: .El
                   5332: .Sh VERSION
                   5333: .Nm openssl version
                   5334: .Op Fl abdfopv
                   5335: .Pp
                   5336: The
                   5337: .Nm version
                   5338: command is used to print out version information about
1.79      jmc      5339: .Nm openssl .
1.1       jsing    5340: .Pp
                   5341: The options are as follows:
                   5342: .Bl -tag -width Ds
                   5343: .It Fl a
                   5344: All information: this is the same as setting all the other flags.
                   5345: .It Fl b
                   5346: The date the current version of
1.79      jmc      5347: .Nm openssl
1.1       jsing    5348: was built.
                   5349: .It Fl d
                   5350: .Ev OPENSSLDIR
                   5351: setting.
                   5352: .It Fl f
                   5353: Compilation flags.
                   5354: .It Fl o
                   5355: Option information: various options set when the library was built.
                   5356: .It Fl p
                   5357: Platform setting.
                   5358: .It Fl v
                   5359: The current
1.79      jmc      5360: .Nm openssl
1.1       jsing    5361: version.
                   5362: .El
                   5363: .Sh X509
                   5364: .nr nS 1
                   5365: .Nm "openssl x509"
                   5366: .Op Fl C
                   5367: .Op Fl addreject Ar arg
                   5368: .Op Fl addtrust Ar arg
                   5369: .Op Fl alias
                   5370: .Op Fl CA Ar file
                   5371: .Op Fl CAcreateserial
1.80      jmc      5372: .Op Fl CAform Cm der | pem
1.1       jsing    5373: .Op Fl CAkey Ar file
1.80      jmc      5374: .Op Fl CAkeyform Cm der | pem
1.1       jsing    5375: .Op Fl CAserial Ar file
                   5376: .Op Fl certopt Ar option
                   5377: .Op Fl checkend Ar arg
                   5378: .Op Fl clrext
                   5379: .Op Fl clrreject
                   5380: .Op Fl clrtrust
                   5381: .Op Fl dates
                   5382: .Op Fl days Ar arg
                   5383: .Op Fl email
                   5384: .Op Fl enddate
                   5385: .Op Fl extensions Ar section
                   5386: .Op Fl extfile Ar file
                   5387: .Op Fl fingerprint
                   5388: .Op Fl hash
                   5389: .Op Fl in Ar file
1.80      jmc      5390: .Op Fl inform Cm der | net | pem
1.1       jsing    5391: .Op Fl issuer
                   5392: .Op Fl issuer_hash
                   5393: .Op Fl issuer_hash_old
1.80      jmc      5394: .Op Fl keyform Cm der | pem
1.29      bcook    5395: .Op Fl md5 | sha1
1.1       jsing    5396: .Op Fl modulus
                   5397: .Op Fl nameopt Ar option
                   5398: .Op Fl noout
                   5399: .Op Fl ocsp_uri
                   5400: .Op Fl ocspid
                   5401: .Op Fl out Ar file
1.80      jmc      5402: .Op Fl outform Cm der | net | pem
1.1       jsing    5403: .Op Fl passin Ar arg
                   5404: .Op Fl pubkey
                   5405: .Op Fl purpose
                   5406: .Op Fl req
                   5407: .Op Fl serial
                   5408: .Op Fl set_serial Ar n
                   5409: .Op Fl setalias Ar arg
                   5410: .Op Fl signkey Ar file
                   5411: .Op Fl startdate
                   5412: .Op Fl subject
                   5413: .Op Fl subject_hash
                   5414: .Op Fl subject_hash_old
                   5415: .Op Fl text
                   5416: .Op Fl trustout
                   5417: .Op Fl x509toreq
                   5418: .nr nS 0
                   5419: .Pp
                   5420: The
                   5421: .Nm x509
                   5422: command is a multi-purpose certificate utility.
                   5423: It can be used to display certificate information, convert certificates to
                   5424: various forms, sign certificate requests like a
                   5425: .Qq mini CA ,
                   5426: or edit certificate trust settings.
                   5427: .Pp
1.80      jmc      5428: The following are x509 input, output, and general purpose options:
1.1       jsing    5429: .Bl -tag -width "XXXX"
                   5430: .It Fl in Ar file
1.80      jmc      5431: The input file to read from,
                   5432: or standard input if not specified.
                   5433: .It Fl inform Cm der | net | pem
                   5434: The input format.
1.1       jsing    5435: Normally, the command will expect an X.509 certificate,
                   5436: but this can change if other options such as
                   5437: .Fl req
                   5438: are present.
1.29      bcook    5439: .It Fl md5 | sha1
1.1       jsing    5440: The digest to use.
                   5441: This affects any signing or display option that uses a message digest,
                   5442: such as the
                   5443: .Fl fingerprint , signkey ,
                   5444: and
                   5445: .Fl CA
                   5446: options.
                   5447: If not specified, MD5 is used.
1.80      jmc      5448: SHA1 is always used with DSA keys.
1.1       jsing    5449: .It Fl out Ar file
1.80      jmc      5450: The output file to write to,
                   5451: or standard output if none is specified.
                   5452: .It Fl outform Cm der | net | pem
                   5453: The output format.
1.1       jsing    5454: .It Fl passin Ar arg
                   5455: The key password source.
                   5456: .El
1.80      jmc      5457: .Pp
                   5458: The following are x509 display options:
1.1       jsing    5459: .Bl -tag -width "XXXX"
                   5460: .It Fl C
1.80      jmc      5461: Output the certificate in the form of a C source file.
1.1       jsing    5462: .It Fl certopt Ar option
                   5463: Customise the output format used with
1.80      jmc      5464: .Fl text ,
                   5465: either using a list of comma-separated options or by specifying
1.1       jsing    5466: .Fl certopt
1.80      jmc      5467: multiple times.
                   5468: The default behaviour is to print all fields.
                   5469: The options are as follows:
                   5470: .Pp
                   5471: .Bl -tag -width "no_extensions" -offset indent -compact
                   5472: .It Cm ca_default
                   5473: Equivalent to
                   5474: .Cm no_issuer , no_pubkey , no_header ,
                   5475: .Cm no_version , no_sigdump ,
                   5476: and
                   5477: .Cm no_signame .
                   5478: .It Cm compatible
                   5479: Equivalent to no output options at all.
                   5480: .It Cm ext_default
                   5481: Print unsupported certificate extensions.
                   5482: .It Cm ext_dump
                   5483: Hex dump unsupported extensions.
                   5484: .It Cm ext_error
                   5485: Print an error message for unsupported certificate extensions.
                   5486: .It Cm ext_parse
1.84      jmc      5487: ASN.1 parse unsupported extensions.
1.80      jmc      5488: .It Cm no_aux
                   5489: Do not print certificate trust information.
                   5490: .It Cm no_extensions
                   5491: Do not print X509V3 extensions.
                   5492: .It Cm no_header
                   5493: Do not print header (Certificate and Data) information.
                   5494: .It Cm no_issuer
                   5495: Do not print the issuer name.
                   5496: .It Cm no_pubkey
                   5497: Do not print the public key.
                   5498: .It Cm no_serial
                   5499: Do not print the serial number.
                   5500: .It Cm no_sigdump
                   5501: Do not give a hexadecimal dump of the certificate signature.
                   5502: .It Cm no_signame
                   5503: Do not print the signature algorithm used.
                   5504: .It Cm no_subject
                   5505: Do not print the subject name.
                   5506: .It Cm no_validity
                   5507: Do not print the
                   5508: .Cm notBefore
                   5509: and
                   5510: .Cm notAfter
                   5511: (validity) fields.
                   5512: .It Cm no_version
                   5513: Do not print the version number.
                   5514: .El
1.1       jsing    5515: .It Fl dates
1.80      jmc      5516: Print the start and expiry date of a certificate.
1.1       jsing    5517: .It Fl email
1.80      jmc      5518: Output the email addresses, if any.
1.1       jsing    5519: .It Fl enddate
1.80      jmc      5520: Print the expiry date of the certificate; that is, the
                   5521: .Cm notAfter
1.1       jsing    5522: date.
                   5523: .It Fl fingerprint
1.80      jmc      5524: Print the digest of the DER-encoded version of the whole certificate.
1.1       jsing    5525: .It Fl hash
                   5526: A synonym for
1.80      jmc      5527: .Fl subject_hash .
1.1       jsing    5528: .It Fl issuer
1.80      jmc      5529: Print the issuer name.
1.1       jsing    5530: .It Fl issuer_hash
1.80      jmc      5531: Print the hash of the certificate issuer name.
1.1       jsing    5532: .It Fl issuer_hash_old
1.80      jmc      5533: Print the hash of the certificate issuer name
                   5534: using the older algorithm as used by
                   5535: .Nm openssl
1.1       jsing    5536: versions before 1.0.0.
                   5537: .It Fl modulus
1.80      jmc      5538: Print the value of the modulus of the public key contained in the certificate.
1.1       jsing    5539: .It Fl nameopt Ar option
1.80      jmc      5540: Customise how the subject or issuer names are displayed,
                   5541: either using a list of comma-separated options or by specifying
1.1       jsing    5542: .Fl nameopt
1.80      jmc      5543: multiple times.
                   5544: The default behaviour is to use the
                   5545: .Cm oneline
                   5546: format.
                   5547: The options,
                   5548: which can be preceded by a dash to turn them off,
                   5549: are as follows:
                   5550: .Bl -tag -width "XXXX"
                   5551: .It Cm align
                   5552: Align field values for a more readable output.
                   5553: Only usable with
                   5554: .Ar sep_multiline .
                   5555: .It Cm compat
                   5556: Use the old format,
                   5557: equivalent to specifying no options at all.
                   5558: .It Cm dn_rev
                   5559: Reverse the fields of the DN, as required by RFC 2253.
                   5560: As a side effect, this also reverses the order of multiple AVAs.
                   5561: .It Cm dump_all
                   5562: Dump all fields.
                   5563: When used with
                   5564: .Ar dump_der ,
                   5565: it allows the DER encoding of the structure to be unambiguously determined.
                   5566: .It Cm dump_der
                   5567: Any fields that need to be hexdumped are
                   5568: dumped using the DER encoding of the field.
                   5569: Otherwise just the content octets will be displayed.
                   5570: Both options use the RFC 2253 #XXXX... format.
                   5571: .It Cm dump_nostr
                   5572: Dump non-character string types
                   5573: (for example OCTET STRING);
                   5574: usually, non-character string types are displayed
                   5575: as though each content octet represents a single character.
                   5576: .It Cm dump_unknown
                   5577: Dump any field whose OID is not recognised by
                   5578: .Nm openssl .
                   5579: .It Cm esc_2253
                   5580: Escape the
                   5581: .Qq special
                   5582: characters required by RFC 2253 in a field that is
                   5583: .Dq \& ,+"<>; .
                   5584: Additionally,
                   5585: .Sq #
                   5586: is escaped at the beginning of a string
                   5587: and a space character at the beginning or end of a string.
                   5588: .It Cm esc_ctrl
                   5589: Escape control characters.
                   5590: That is, those with ASCII values less than 0x20 (space)
                   5591: and the delete (0x7f) character.
                   5592: They are escaped using the RFC 2253 \eXX notation (where XX are two hex
                   5593: digits representing the character value).
                   5594: .It Cm esc_msb
                   5595: Escape characters with the MSB set; that is, with ASCII values larger than
                   5596: 127.
                   5597: .It Cm multiline
                   5598: A multiline format.
                   5599: Equivalent to
                   5600: .Cm esc_ctrl , esc_msb , sep_multiline ,
                   5601: .Cm space_eq , lname ,
                   5602: and
                   5603: .Cm align .
                   5604: .It Cm no_type
                   5605: Do not attempt to interpret multibyte characters.
                   5606: That is, content octets are merely dumped as though one octet
                   5607: represents each character.
                   5608: This is useful for diagnostic purposes
                   5609: but results in rather odd looking output.
                   5610: .It Cm nofname , sname , lname , oid
                   5611: Alter how the field name is displayed:
                   5612: .Cm nofname
                   5613: does not display the field at all;
                   5614: .Cm sname
                   5615: uses the short name form (CN for
                   5616: .Cm commonName ,
                   5617: for example);
                   5618: .Cm lname
                   5619: uses the long form.
                   5620: .Cm oid
                   5621: represents the OID in numerical form and is useful for diagnostic purpose.
                   5622: .It Cm oneline
                   5623: A one line format which is more readable than
                   5624: .Cm RFC2253 .
                   5625: Equivalent to
                   5626: .Cm esc_2253 , esc_ctrl , esc_msb , utf8 ,
                   5627: .Cm dump_nostr , dump_der , use_quote , sep_comma_plus_spc ,
                   5628: .Cm space_eq ,
                   5629: and
                   5630: .Cm sname .
                   5631: .It Cm RFC2253
                   5632: Displays names compatible with RFC 2253.
                   5633: Equivalent to
                   5634: .Cm esc_2253 , esc_ctrl ,
                   5635: .Cm esc_msb , utf8 , dump_nostr , dump_unknown ,
                   5636: .Cm dump_der , sep_comma_plus , dn_rev ,
                   5637: and
                   5638: .Cm sname .
                   5639: .It Cm sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline
                   5640: Determine the field separators:
                   5641: the first character is between RDNs and the second between multiple AVAs
                   5642: (multiple AVAs are very rare and their use is discouraged).
                   5643: The options ending in
                   5644: .Qq space
                   5645: additionally place a space after the separator to make it more readable.
                   5646: .Cm sep_multiline
                   5647: uses a linefeed character for the RDN separator and a spaced
                   5648: .Sq +
                   5649: for the AVA separator,
                   5650: as well as indenting the fields by four characters.
                   5651: .It Cm show_type
1.84      jmc      5652: Show the type of the ASN.1 character string.
1.80      jmc      5653: The type precedes the field contents.
                   5654: For example
                   5655: .Qq BMPSTRING: Hello World .
                   5656: .It Cm space_eq
                   5657: Place spaces round the
                   5658: .Sq =
                   5659: character which follows the field name.
                   5660: .It Cm use_quote
                   5661: Escape some characters by surrounding the whole string with
                   5662: .Sq \&"
                   5663: characters.
                   5664: Without the option, all escaping is done with the
                   5665: .Sq \e
                   5666: character.
                   5667: .It Cm utf8
                   5668: Convert all strings to UTF8 format first, as required by RFC 2253.
                   5669: On a UTF8 compatible terminal,
                   5670: the use of this option (and not setting
                   5671: .Cm esc_msb )
                   5672: may result in the correct display of multibyte characters.
                   5673: Usually, multibyte characters larger than 0xff
                   5674: are represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX
                   5675: for 32 bits,
                   5676: and any UTF8Strings are converted to their character form first.
                   5677: .El
1.1       jsing    5678: .It Fl noout
1.80      jmc      5679: Do not output the encoded version of the request.
1.1       jsing    5680: .It Fl ocsp_uri
1.80      jmc      5681: Print the OCSP responder addresses, if any.
1.1       jsing    5682: .It Fl ocspid
                   5683: Print OCSP hash values for the subject name and public key.
                   5684: .It Fl pubkey
1.80      jmc      5685: Print the public key.
1.1       jsing    5686: .It Fl serial
1.80      jmc      5687: Print the certificate serial number.
1.1       jsing    5688: .It Fl startdate
1.80      jmc      5689: Print the start date of the certificate; that is, the
                   5690: .Cm notBefore
1.1       jsing    5691: date.
                   5692: .It Fl subject
1.80      jmc      5693: Print the subject name.
1.1       jsing    5694: .It Fl subject_hash
1.80      jmc      5695: Print the hash of the certificate subject name.
1.1       jsing    5696: This is used in
1.80      jmc      5697: .Nm openssl
1.1       jsing    5698: to form an index to allow certificates in a directory to be looked up
                   5699: by subject name.
                   5700: .It Fl subject_hash_old
1.80      jmc      5701: Print the hash of the certificate subject name
                   5702: using the older algorithm as used by
                   5703: .Nm openssl
1.1       jsing    5704: versions before 1.0.0.
                   5705: .It Fl text
1.80      jmc      5706: Print the full certificate in text form.
1.1       jsing    5707: .El
                   5708: .Pp
1.80      jmc      5709: A trusted certificate is a certificate which has several
1.1       jsing    5710: additional pieces of information attached to it such as the permitted
1.80      jmc      5711: and prohibited uses of the certificate and an alias.
                   5712: When a certificate is being verified at least one certificate must be trusted.
                   5713: By default, a trusted certificate must be stored locally and be a root CA.
                   5714: The following are x509 trust settings options:
1.1       jsing    5715: .Bl -tag -width "XXXX"
                   5716: .It Fl addreject Ar arg
1.80      jmc      5717: Add a prohibited use.
                   5718: Accepts the same values as the
1.1       jsing    5719: .Fl addtrust
                   5720: option.
                   5721: .It Fl addtrust Ar arg
1.80      jmc      5722: Add a trusted certificate use.
1.1       jsing    5723: Any object name can be used here, but currently only
1.80      jmc      5724: .Cm clientAuth
                   5725: (SSL client use),
                   5726: .Cm serverAuth
                   5727: (SSL server use),
                   5728: and
                   5729: .Cm emailProtection
                   5730: (S/MIME email) are used.
1.1       jsing    5731: .It Fl alias
1.80      jmc      5732: Output the certificate alias.
1.1       jsing    5733: .It Fl clrreject
1.80      jmc      5734: Clear all the prohibited or rejected uses of the certificate.
1.1       jsing    5735: .It Fl clrtrust
1.80      jmc      5736: Clear all the permitted or trusted uses of the certificate.
1.1       jsing    5737: .It Fl purpose
1.80      jmc      5738: Perform tests on the certificate extensions.
                   5739: The same code is used when verifying untrusted certificates in chains,
                   5740: so this section is useful if a chain is rejected by the verify code.
                   5741: .Pp
                   5742: The
                   5743: .Cm basicConstraints
                   5744: extension CA flag is used to determine whether the
                   5745: certificate can be used as a CA.
                   5746: If the CA flag is true, it is a CA;
                   5747: if the CA flag is false, it is not a CA.
                   5748: All CAs should have the CA flag set to true.
                   5749: .Pp
                   5750: If the
                   5751: .Cm basicConstraints
                   5752: extension is absent, then the certificate is
                   5753: considered to be a possible CA;
                   5754: other extensions are checked according to the intended use of the certificate.
                   5755: A warning is given in this case because the certificate should really not
                   5756: be regarded as a CA.
                   5757: However it is allowed to be a CA to work around some broken software.
                   5758: .Pp
                   5759: If the certificate is a V1 certificate
                   5760: (and thus has no extensions) and it is self-signed,
                   5761: it is also assumed to be a CA but a warning is again given.
                   5762: This is to work around the problem of Verisign roots
                   5763: which are V1 self-signed certificates.
                   5764: .Pp
                   5765: If the
                   5766: .Cm keyUsage
                   5767: extension is present, then additional restraints are
                   5768: made on the uses of the certificate.
                   5769: A CA certificate must have the
                   5770: .Cm keyCertSign
                   5771: bit set if the
                   5772: .Cm keyUsage
                   5773: extension is present.
                   5774: .Pp
                   5775: The extended key usage extension places additional restrictions on the
                   5776: certificate uses.
                   5777: If this extension is present, whether critical or not,
                   5778: the key can only be used for the purposes specified.
                   5779: .Pp
                   5780: A complete description of each test is given below.
                   5781: The comments about
                   5782: .Cm basicConstraints
                   5783: and
                   5784: .Cm keyUsage
                   5785: and V1 certificates above apply to all CA certificates.
                   5786: .Bl -tag -width "XXXX"
                   5787: .It SSL Client
                   5788: The extended key usage extension must be absent or include the
                   5789: web client authentication OID.
                   5790: .Cm keyUsage
                   5791: must be absent or it must have the
                   5792: .Cm digitalSignature
                   5793: bit set.
                   5794: The Netscape certificate type must be absent
                   5795: or it must have the SSL client bit set.
                   5796: .It SSL Client CA
                   5797: The extended key usage extension must be absent or include the
                   5798: web client authentication OID.
                   5799: The Netscape certificate type must be absent
                   5800: or it must have the SSL CA bit set:
                   5801: this is used as a workaround if the
                   5802: .Cm basicConstraints
                   5803: extension is absent.
                   5804: .It SSL Server
                   5805: The extended key usage extension must be absent or include the
                   5806: web server authentication and/or one of the SGC OIDs.
                   5807: .Cm keyUsage
                   5808: must be absent or it must have the
                   5809: .Cm digitalSignature
                   5810: set, the
                   5811: .Cm keyEncipherment
                   5812: set, or both bits set.
                   5813: The Netscape certificate type must be absent or have the SSL server bit set.
                   5814: .It SSL Server CA
                   5815: The extended key usage extension must be absent or include the
                   5816: web server authentication and/or one of the SGC OIDs.
                   5817: The Netscape certificate type must be absent or the SSL CA bit must be set:
                   5818: this is used as a workaround if the
                   5819: .Cm basicConstraints
                   5820: extension is absent.
                   5821: .It Netscape SSL Server
                   5822: For Netscape SSL clients to connect to an SSL server; it must have the
                   5823: .Cm keyEncipherment
                   5824: bit set if the
                   5825: .Cm keyUsage
                   5826: extension is present.
                   5827: This isn't always valid because some cipher suites use the key for
                   5828: digital signing.
                   5829: Otherwise it is the same as a normal SSL server.
                   5830: .It Common S/MIME Client Tests
                   5831: The extended key usage extension must be absent or include the
                   5832: email protection OID.
                   5833: The Netscape certificate type must be absent or should have the S/MIME bit set.
                   5834: If the S/MIME bit is not set in Netscape certificate type, then the SSL
                   5835: client bit is tolerated as an alternative but a warning is shown:
                   5836: this is because some Verisign certificates don't set the S/MIME bit.
                   5837: .It S/MIME Signing
                   5838: In addition to the common S/MIME client tests, the
                   5839: .Cm digitalSignature
                   5840: bit must be set if the
                   5841: .Cm keyUsage
                   5842: extension is present.
                   5843: .It S/MIME Encryption
                   5844: In addition to the common S/MIME tests, the
                   5845: .Cm keyEncipherment
                   5846: bit must be set if the
                   5847: .Cm keyUsage
                   5848: extension is present.
                   5849: .It S/MIME CA
                   5850: The extended key usage extension must be absent or include the
                   5851: email protection OID.
                   5852: The Netscape certificate type must be absent
                   5853: or must have the S/MIME CA bit set:
                   5854: this is used as a workaround if the
                   5855: .Cm basicConstraints
                   5856: extension is absent.
                   5857: .It CRL Signing
                   5858: The
                   5859: .Cm keyUsage
                   5860: extension must be absent or it must have the CRL signing bit set.
                   5861: .It CRL Signing CA
                   5862: The normal CA tests apply, except the
                   5863: .Cm basicConstraints
                   5864: extension must be present.
                   5865: .El
1.1       jsing    5866: .It Fl setalias Ar arg
1.80      jmc      5867: Set the alias of the certificate,
                   5868: allowing the certificate to be referred to using a nickname,
                   5869: such as
1.1       jsing    5870: .Qq Steve's Certificate .
                   5871: .It Fl trustout
1.80      jmc      5872: Output a trusted certificate
                   5873: (the default if any trust settings are modified).
1.1       jsing    5874: An ordinary or trusted certificate can be input, but by default an ordinary
                   5875: certificate is output and any trust settings are discarded.
                   5876: .El
1.80      jmc      5877: .Pp
1.1       jsing    5878: The
                   5879: .Nm x509
1.80      jmc      5880: utility can be used to sign certificates and requests:
                   5881: it can thus behave like a mini CA.
                   5882: The following are x509 signing options:
1.1       jsing    5883: .Bl -tag -width "XXXX"
                   5884: .It Fl CA Ar file
1.80      jmc      5885: The CA certificate to be used for signing.
1.1       jsing    5886: When this option is present,
                   5887: .Nm x509
1.80      jmc      5888: behaves like a mini CA.
1.1       jsing    5889: The input file is signed by the CA using this option;
                   5890: that is, its issuer name is set to the subject name of the CA and it is
                   5891: digitally signed using the CA's private key.
                   5892: .Pp
                   5893: This option is normally combined with the
                   5894: .Fl req
                   5895: option.
                   5896: Without the
                   5897: .Fl req
                   5898: option, the input is a certificate which must be self-signed.
                   5899: .It Fl CAcreateserial
1.80      jmc      5900: Create the CA serial number file if it does not exist
                   5901: instead of generating an error.
                   5902: The file will contain the serial number
1.1       jsing    5903: .Sq 02
                   5904: and the certificate being signed will have
                   5905: .Sq 1
                   5906: as its serial number.
1.80      jmc      5907: .It Fl CAform Cm der | pem
1.1       jsing    5908: The format of the CA certificate file.
                   5909: The default is
1.80      jmc      5910: .Cm pem .
1.1       jsing    5911: .It Fl CAkey Ar file
1.80      jmc      5912: Set the CA private key to sign a certificate with.
                   5913: Otherwise it is assumed that the CA private key is present
                   5914: in the CA certificate file.
                   5915: .It Fl CAkeyform Cm der | pem
1.1       jsing    5916: The format of the CA private key.
                   5917: The default is
1.80      jmc      5918: .Cm pem .
1.1       jsing    5919: .It Fl CAserial Ar file
1.80      jmc      5920: Use the serial number in
                   5921: .Ar file
                   5922: to sign a certificate.
                   5923: The file should consist of one line containing an even number of hex digits
1.1       jsing    5924: with the serial number to use.
                   5925: After each use the serial number is incremented and written out
                   5926: to the file again.
                   5927: .Pp
                   5928: The default filename consists of the CA certificate file base name with
                   5929: .Pa .srl
                   5930: appended.
                   5931: For example, if the CA certificate file is called
                   5932: .Pa mycacert.pem ,
                   5933: it expects to find a serial number file called
                   5934: .Pa mycacert.srl .
                   5935: .It Fl checkend Ar arg
                   5936: Check whether the certificate expires in the next
                   5937: .Ar arg
                   5938: seconds.
                   5939: If so, exit with return value 1;
                   5940: otherwise exit with return value 0.
                   5941: .It Fl clrext
                   5942: Delete any extensions from a certificate.
                   5943: This option is used when a certificate is being created from another
                   5944: certificate (for example with the
                   5945: .Fl signkey
                   5946: or the
                   5947: .Fl CA
                   5948: options).
                   5949: Normally, all extensions are retained.
                   5950: .It Fl days Ar arg
1.80      jmc      5951: The number of days to make a certificate valid for.
1.1       jsing    5952: The default is 30 days.
                   5953: .It Fl extensions Ar section
                   5954: The section to add certificate extensions from.
                   5955: If this option is not specified, the extensions should either be
1.80      jmc      5956: contained in the unnamed (default) section
                   5957: or the default section should contain a variable called
1.1       jsing    5958: .Qq extensions
                   5959: which contains the section to use.
                   5960: .It Fl extfile Ar file
                   5961: File containing certificate extensions to use.
                   5962: If not specified, no extensions are added to the certificate.
1.80      jmc      5963: .It Fl keyform Cm der | pem
                   5964: The format of the private key file used in the
1.1       jsing    5965: .Fl signkey
                   5966: option.
                   5967: .It Fl req
1.80      jmc      5968: Expect a certificate request on input instead of a certificate.
1.1       jsing    5969: .It Fl set_serial Ar n
1.80      jmc      5970: The serial number to use.
1.1       jsing    5971: This option can be used with either the
                   5972: .Fl signkey
                   5973: or
                   5974: .Fl CA
                   5975: options.
                   5976: If used in conjunction with the
                   5977: .Fl CA
                   5978: option, the serial number file (as specified by the
                   5979: .Fl CAserial
                   5980: or
                   5981: .Fl CAcreateserial
                   5982: options) is not used.
                   5983: .Pp
                   5984: The serial number can be decimal or hex (if preceded by
                   5985: .Sq 0x ) .
                   5986: Negative serial numbers can also be specified but their use is not recommended.
                   5987: .It Fl signkey Ar file
1.80      jmc      5988: Self-sign
                   5989: .Ar file
                   5990: using the supplied private key.
1.1       jsing    5991: .Pp
                   5992: If the input file is a certificate, it sets the issuer name to the
1.80      jmc      5993: subject name (i.e. makes it self-signed),
1.1       jsing    5994: changes the public key to the supplied value,
                   5995: and changes the start and end dates.
                   5996: The start date is set to the current time and the end date is set to
                   5997: a value determined by the
                   5998: .Fl days
                   5999: option.
                   6000: Any certificate extensions are retained unless the
                   6001: .Fl clrext
                   6002: option is supplied.
                   6003: .Pp
                   6004: If the input is a certificate request, a self-signed certificate
                   6005: is created using the supplied private key using the subject name in
                   6006: the request.
                   6007: .It Fl x509toreq
1.80      jmc      6008: Convert a certificate into a certificate request.
1.1       jsing    6009: The
                   6010: .Fl signkey
                   6011: option is used to pass the required private key.
                   6012: .El
1.38      jmc      6013: .Sh COMMON NOTATION
                   6014: Several commands share a common syntax,
                   6015: as detailed below.
                   6016: .Pp
                   6017: Password arguments, typically specified using
1.33      jmc      6018: .Fl passin
                   6019: and
                   6020: .Fl passout
1.38      jmc      6021: for input and output passwords,
                   6022: allow passwords to be obtained from a variety of sources.
                   6023: Both of these options take a single argument, described below.
1.33      jmc      6024: If no password argument is given and a password is required,
                   6025: then the user is prompted to enter one:
                   6026: this will typically be read from the current terminal with echoing turned off.
1.38      jmc      6027: .Bl -tag -width "pass:password" -offset indent
                   6028: .It Cm pass : Ns Ar password
1.33      jmc      6029: The actual password is
                   6030: .Ar password .
1.38      jmc      6031: Since the password is visible to utilities,
1.33      jmc      6032: this form should only be used where security is not important.
1.38      jmc      6033: .It Cm env : Ns Ar var
1.33      jmc      6034: Obtain the password from the environment variable
                   6035: .Ar var .
1.38      jmc      6036: Since the environment of other processes is visible,
                   6037: this option should be used with caution.
                   6038: .It Cm file : Ns Ar path
1.33      jmc      6039: The first line of
                   6040: .Ar path
                   6041: is the password.
                   6042: If the same
                   6043: .Ar path
                   6044: argument is supplied to
                   6045: .Fl passin
                   6046: and
                   6047: .Fl passout ,
                   6048: then the first line will be used for the input password and the next line
                   6049: for the output password.
                   6050: .Ar path
                   6051: need not refer to a regular file:
                   6052: it could, for example, refer to a device or named pipe.
1.38      jmc      6053: .It Cm fd : Ns Ar number
1.33      jmc      6054: Read the password from the file descriptor
                   6055: .Ar number .
1.38      jmc      6056: This can be used to send the data via a pipe, for example.
                   6057: .It Cm stdin
1.33      jmc      6058: Read the password from standard input.
1.35      jmc      6059: .El
1.38      jmc      6060: .Pp
1.64      jmc      6061: Input/output formats,
1.38      jmc      6062: typically specified using
                   6063: .Fl inform
                   6064: and
                   6065: .Fl outform ,
1.64      jmc      6066: indicate the format being read from or written to.
1.38      jmc      6067: The argument is case insensitive.
                   6068: .Pp
                   6069: .Bl -tag -width Ds -offset indent -compact
                   6070: .It Cm der
                   6071: Distinguished Encoding Rules (DER)
                   6072: is a binary format.
1.64      jmc      6073: .It Cm net
                   6074: Insecure legacy format.
1.38      jmc      6075: .It Cm pem
                   6076: Privacy Enhanced Mail (PEM)
                   6077: is base64-encoded.
1.70      jmc      6078: .It Cm smime
                   6079: An SMIME format message.
1.38      jmc      6080: .It Cm txt
                   6081: Plain ASCII text.
                   6082: .El
1.35      jmc      6083: .Sh ENVIRONMENT
                   6084: The following environment variables affect the execution of
                   6085: .Nm openssl :
1.38      jmc      6086: .Bl -tag -width "/etc/ssl/openssl.cnf"
1.35      jmc      6087: .It Ev OPENSSL_CONF
                   6088: The location of the master configuration file.
1.33      jmc      6089: .El
1.1       jsing    6090: .Sh FILES
                   6091: .Bl -tag -width "/etc/ssl/openssl.cnf" -compact
1.17      sobrado  6092: .It Pa /etc/ssl/
1.1       jsing    6093: Default config directory for
                   6094: .Nm openssl .
1.17      sobrado  6095: .It Pa /etc/ssl/lib/
1.1       jsing    6096: Unused.
1.17      sobrado  6097: .It Pa /etc/ssl/private/
1.1       jsing    6098: Default private key directory.
1.17      sobrado  6099: .It Pa /etc/ssl/openssl.cnf
1.1       jsing    6100: Default configuration file for
                   6101: .Nm openssl .
1.17      sobrado  6102: .It Pa /etc/ssl/x509v3.cnf
1.1       jsing    6103: Default configuration file for
                   6104: .Nm x509
                   6105: certificates.
                   6106: .El
                   6107: .Sh SEE ALSO
1.74      jmc      6108: .Xr acme-client 1 ,
1.26      jmc      6109: .Xr nc 1 ,
1.90      schwarze 6110: .Xr openssl.cnf 5 ,
                   6111: .Xr x509v3.cnf 5 ,
1.1       jsing    6112: .Xr ssl 8 ,
                   6113: .Xr starttls 8
                   6114: .Sh STANDARDS
                   6115: .Rs
                   6116: .%A T. Dierks
                   6117: .%A C. Allen
                   6118: .%D January 1999
                   6119: .%R RFC 2246
                   6120: .%T The TLS Protocol Version 1.0
                   6121: .Re
                   6122: .Pp
                   6123: .Rs
                   6124: .%A M. Wahl
                   6125: .%A S. Killie
                   6126: .%A T. Howes
                   6127: .%D December 1997
                   6128: .%R RFC 2253
                   6129: .%T Lightweight Directory Access Protocol (v3): UTF-8 String Representation of Distinguished Names
                   6130: .Re
                   6131: .Pp
                   6132: .Rs
                   6133: .%A B. Kaliski
                   6134: .%D March 1998
                   6135: .%R RFC 2315
                   6136: .%T PKCS #7: Cryptographic Message Syntax Version 1.5
                   6137: .Re
                   6138: .Pp
                   6139: .Rs
                   6140: .%A R. Housley
                   6141: .%A W. Ford
                   6142: .%A W. Polk
                   6143: .%A D. Solo
                   6144: .%D January 1999
                   6145: .%R RFC 2459
                   6146: .%T Internet X.509 Public Key Infrastructure Certificate and CRL Profile
                   6147: .Re
                   6148: .Pp
                   6149: .Rs
                   6150: .%A M. Myers
                   6151: .%A R. Ankney
                   6152: .%A A. Malpani
                   6153: .%A S. Galperin
                   6154: .%A C. Adams
                   6155: .%D June 1999
                   6156: .%R RFC 2560
                   6157: .%T X.509 Internet Public Key Infrastructure Online Certificate Status Protocol \(en OCSP
                   6158: .Re
                   6159: .Pp
                   6160: .Rs
                   6161: .%A R. Housley
                   6162: .%D June 1999
                   6163: .%R RFC 2630
                   6164: .%T Cryptographic Message Syntax
                   6165: .Re
                   6166: .Pp
                   6167: .Rs
                   6168: .%A P. Chown
                   6169: .%D June 2002
                   6170: .%R RFC 3268
1.24      jmc      6171: .%T Advanced Encryption Standard (AES) Ciphersuites for Transport Layer Security (TLS)
1.1       jsing    6172: .Re