1 .\" $OpenBSD: openssl.1,v 1.94 2018/08/24 20:12:24 tb Exp $
2 .\" ====================================================================
3 .\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
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
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/)"
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.
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.
31 .\" 6. Redistributions of any form whatsoever must retain the following
33 .\" "This product includes software developed by the OpenSSL Project
34 .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
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 .\" ====================================================================
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).
55 .\" Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
56 .\" All rights reserved.
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.
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).
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.
76 .\" Redistribution and use in source and binary forms, with or without
77 .\" modification, are permitted provided that the following conditions
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
93 .\" "This product includes software written by Tim Hudson
94 .\" (tjh@cryptsoft.com)"
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
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.]
113 .Dd $Mdocdate: August 24 2018 $
118 .Nd OpenSSL command line tool
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 |
131 .Cm list-public-key-algorithms
134 .Cm no- Ns Ar command
137 is a cryptography toolkit implementing the
138 Transport Layer Security
141 as well as related cryptography standards.
145 program is a command line tool for using the various
146 cryptography functions of
148 crypto library from the shell.
151 .Cm list-standard-commands , list-message-digest-commands ,
153 .Cm list-cipher-commands
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
162 .Cm list-cipher-algorithms
164 .Cm list-message-digest-algorithms
165 list all cipher and message digest names,
167 Aliases are listed as:
172 .Cm list-public-key-algorithms
173 lists all supported public key algorithms.
176 .Cm no- Ns Ar command
177 tests whether a command of the
178 specified name is available.
184 .Cm no- Ns Ar command ;
185 otherwise it returns 1 and prints
187 In both cases, the output goes to stdout and nothing is printed to stderr.
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
196 .Cm no- Ns Ar command
197 is not able to detect pseudo-commands such as
199 .Cm list- Ns Ar ... Ns Cm -commands ,
201 .Cm no- Ns Ar command
205 .Nm "openssl asn1parse"
207 .Op Fl dlimit Ar number
209 .Op Fl genconf Ar file
212 .Op Fl inform Cm der | pem | txt
213 .Op Fl length Ar number
215 .Op Fl offset Ar number
218 .Op Fl strparse Ar offset
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.
226 The options are as follows:
228 .It Fl dlimit Ar number
231 bytes of unknown data in hex form.
233 Dump unknown data in hex form.
234 .It Fl genconf Ar file , Fl genstr Ar str
235 Generate encoded data based on string
239 or both, using the format described in
240 .Xr ASN1_generate_nconf 3 .
243 is present then the string is obtained from the default section
246 The encoded data is passed through the ASN.1 parser and printed out as
247 though it came from a file;
248 the contents can thus be examined and written to a file using the
252 Indent the output according to the
256 The input file to read from, or standard input if not specified.
257 .It Fl inform Cm der | pem | txt
259 .It Fl length Ar number
260 Number of bytes to parse; the default is until end of file.
262 Do not output the parsed version of the input file.
263 .It Fl offset Ar number
264 Starting offset to begin parsing; the default is start of file.
266 A file containing additional object identifiers
269 .Pq object identifier
272 internal table it will be represented in
274 .Pq for example 1.2.3.4 .
276 Each line consists of three columns:
277 the first column is the OID in numerical format and should be followed by
279 The second column is the
281 which is a single word followed by whitespace.
282 The final column is the rest of the line and is the
285 displays the long name.
287 The DER-encoded output file; the default is no encoded output
288 (useful when combined with
290 .It Fl strparse Ar offset
291 Parse the content octets of the ASN.1 object starting at
293 This option can be used multiple times to
295 into a nested structure.
302 .Op Fl config Ar file
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
312 .Op Fl enddate Ar date
313 .Op Fl extensions Ar section
314 .Op Fl extfile Ar section
318 .Op Fl key Ar password
319 .Op Fl keyfile Ar arg
320 .Op Fl keyform Cm pem | der
323 .Op Fl multivalue\-rdn
324 .Op Fl name Ar section
332 .Op Fl revoke Ar file
335 .Op Fl ss_cert Ar file
336 .Op Fl startdate Ar date
337 .Op Fl status Ar serial
346 command is a minimal certificate authority (CA) application.
347 It can be used to sign certificate requests in a variety of forms
348 and generate certificate revocation lists (CRLs).
349 It also maintains a text database of issued certificates and their status.
351 The options relevant to CAs are as follows:
352 .Bl -tag -width "XXXX"
355 In this mode no questions will be asked
356 and all certificates will be certified automatically.
358 The CA certificate file.
359 .It Fl config Ar file
360 Specify an alternative configuration file.
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
366 The number of days to certify the certificate for.
367 .It Fl enddate Ar date
369 The format of the date is [YY]YYMMDDHHMMSSZ,
370 with all four year digits required for dates from 2050 onwards.
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
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.
384 manual page for details of the extension section format.
385 .It Fl extfile Ar file
386 An additional configuration
388 to read certificate extensions from
389 (using the default section unless the
391 option is also used).
395 containing a single certificate request to be signed by the CA.
397 If present, this should be the last option; all subsequent arguments
398 are assumed to be the names of files containing certificate requests.
399 .It Fl key Ar password
402 used to encrypt the private key.
403 Since on some systems the command line arguments are visible,
404 this option should be used with caution.
405 .It Fl keyfile Ar file
406 The private key to sign requests with.
407 .It Fl keyform Cm pem | der
408 Private key file format.
412 The message digest to use.
413 Possible values include
417 This option also applies to CRLs.
419 This is a legacy option to make
421 work with very old versions of the IE certificate enrollment control
423 It used UniversalStrings for almost everything.
424 Since the old control has various security bugs,
425 its use is strongly discouraged.
428 does not need this option.
429 .It Fl multivalue\-rdn
430 This option causes the
432 argument to be interpreted with full support for multivalued RDNs,
434 .Qq "/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe" .
437 is not used, the UID value is set to
438 .Qq "123456+CN=John Doe" .
439 .It Fl name Ar section
440 Specifies the configuration file
448 The DN of a certificate can contain the EMAIL field if present in the
449 request DN, however it is good policy just having the email set into
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.
457 keyword can be used in the configuration file to enable this behaviour.
459 Don't output the text form of a certificate to the output file.
461 The output file to output certificates to.
462 The default is standard output.
463 The certificate details will also be printed out to this file in
464 PEM format, except that
467 .It Fl outdir 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
476 The key password source.
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
485 (the value must match the same field in the CA certificate),
487 (the value must be present), or
489 (the value may be present).
490 Any fields not mentioned in the policy section
491 are silently deleted, unless the
494 but this can be regarded more of a quirk than intended behaviour.
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
502 This is not needed for Xenroll.
504 Indicates the issued certificates are to be signed with the key the
505 certificate requests were signed with, given with
507 Certificate requests signed with a different key are ignored.
517 A consequence of using
519 is that the self-signed certificate appears among the entries in
520 the certificate database (see the configuration option
522 and uses the same serial number counter as all other certificates
523 signed with the self-signed certificate.
525 A file containing a single Netscape signed public key and challenge,
526 and additional field values to be signed by the CA.
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
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
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
542 The format of the date is [YY]YYMMDDHHMMSSZ,
543 with all four year digits required for dates from 2050 onwards.
545 Supersedes the subject name given in the request.
550 .Pf / Ar type0 Ns = Ar value0 Ns / Ar type 1 Ns = Ar value 1 Ns /
551 .Ar type2 Ns = Ar ... ;
553 characters may be escaped by
556 no spaces are skipped.
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.
562 Print extra details about the operations being performed.
565 The options relevant to CRLs are as follows:
566 .Bl -tag -width "XXXX"
567 .It Fl crl_CA_compromise Ar time
570 except the revocation reason is set to CACompromise.
571 .It Fl crl_compromise Ar time
572 Set the revocation reason to keyCompromise and the compromise time to
575 should be in GeneralizedTime format, i.e. YYYYMMDDHHMMSSZ.
576 .It Fl crl_hold Ar instruction
577 Set the CRL revocation reason code to certificateHold and the hold
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
588 unspecified, keyCompromise, CACompromise, affiliationChanged, superseded,
589 cessationOfOperation, certificateHold or removeFromCRL.
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
601 .It Fl crlexts 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
607 (even if it is empty)
608 then a V2 CRL is created.
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.
613 manual page for details of the extension section format.
614 .It Fl crlhours Ar num
615 The number of hours before the next CRL is due.
617 Generate a CRL based on information in the index file.
618 .It Fl revoke Ar file
621 containing a certificate to revoke.
622 .It Fl status Ar serial
623 Show the status of the certificate with serial number
626 Update the database index to purge expired certificates.
629 Many of the options can be set in the
631 section of the configuration file
632 (or in the default section of the configuration file),
641 are read directly from the
645 Many of the configuration file options are identical to command line
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
653 .Bl -tag -width "XXXX"
657 It gives the file containing the CA certificate.
659 .It Cm copy_extensions
660 Determines how extensions in certificate requests should be handled.
663 or this option is not present, then extensions are
664 ignored and not copied to the certificate.
667 then any extensions present in the request that are not already present
668 are copied to the certificate.
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.
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
680 extension with CA:TRUE and the
684 and the user does not spot
685 this when the certificate is displayed, then this will hand the requester
686 a valid CA certificate.
688 This situation can be avoided by setting
694 with CA:FALSE in the configuration file.
695 Then if the request contains a
697 extension, it will be ignored.
699 The main use of this option is to allow a certificate request to supply
700 values for certain extensions such as
702 .It Cm crl_extensions
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.
710 The text database file to use.
712 This file must be present, though initially it will be empty.
713 .It Cm default_crl_hours , default_crl_days
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.
725 The number of days to certify a certificate for.
726 .It Cm default_enddate
730 Either this option or
732 .Pq or the command line equivalents
738 The message digest to use.
740 .It Cm default_startdate
744 The start date to certify a certificate for.
745 If not set, the current time is used.
749 If the EMAIL field is to be removed from the DN of the certificate,
752 If not present, the default is to allow for the EMAIL field in the
757 .It Cm name_opt , cert_opt
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
766 switches can be used here, except that
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).
774 For convenience, the value
776 is accepted by both to produce a reasonable output.
778 If neither option is present, the format used in earlier versions of
781 Use of the old format is strongly discouraged
782 because it only displays fields mentioned in the
785 mishandles multicharacter string types and does not display extensions.
790 It specifies the directory where new certificates will be placed.
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.
798 This specifies a section in the configuration file containing extra
800 Each line should consist of the short name of the object identifier
803 and the numerical form.
804 The short and long names are the same when this option is used.
816 The file containing the CA private key.
819 A text file containing the next serial number to use in hex.
821 This file must be present and contain a valid serial number.
822 .It Cm unique_subject
825 is given, the valid certificate entries in the
826 database must have unique subjects.
830 several valid certificate entries may have the exact same subject.
833 .It Cm x509_extensions
846 string from the format documented in
847 .Xr SSL_CTX_set_cipher_list 3
848 into an ordered SSL cipher suite preference list.
851 string is specified, the
855 The options are as follows:
858 Print a brief usage message.
861 List ciphers with cipher suite code in hex format,
862 cipher name, and a complete description of protocol version,
863 key exchange, authentication, encryption, and mac algorithms.
867 but without cipher suite codes.
872 .Op Fl CAfile Ar file
877 .Op Fl inform Cm der | pem
883 .Op Fl outform Cm der | pem
889 command processes CRL files in DER or PEM format.
891 The options are as follows:
893 .It Fl CAfile Ar file
894 Verify the signature on a CRL by looking up the issuing certificate in
896 .It Fl CApath Ar directory
897 Verify the signature on a CRL by looking up the issuing certificate in
899 This directory must be a standard certificate directory,
900 i.e. a hash of each subject name (using
902 should be linked to each certificate.
904 Print the CRL fingerprint.
906 Output a hash of the issuer name.
907 This can be used to look up CRLs in a directory by issuer name.
909 The input file to read from, or standard input if not specified.
910 .It Fl inform Cm der | pem
913 Output the issuer name.
923 Do not output the encoded version of the CRL.
925 The output file to write to, or standard output if not specified.
926 .It Fl outform Cm der | pem
929 Print the CRL in plain text.
933 .Nm "openssl crl2pkcs7"
934 .Op Fl certfile Ar file
936 .Op Fl inform Cm der | pem
939 .Op Fl outform Cm der | pem
944 command takes an optional CRL and one or more
945 certificates and converts them into a PKCS#7 degenerate
946 .Qq certificates only
949 The options are as follows:
951 .It Fl certfile Ar file
952 Add the certificates in PEM
954 to the PKCS#7 structure.
955 This option can be used more than once
956 to read certificates from multiple files.
960 or standard input if not specified.
961 .It Fl inform Cm der | pem
964 Normally, a CRL is included in the output file.
965 With this option, no CRL is
966 included in the output file and a CRL is not read from the input file.
968 Write the PKCS#7 structure to
970 or standard output if not specified.
971 .It Fl outform Cm der | pem
982 .Op Fl keyform Cm pem
983 .Op Fl mac Ar algorithm
984 .Op Fl macopt Ar nm : Ns Ar v
987 .Op Fl prverify Ar file
989 .Op Fl signature Ar file
990 .Op Fl sigopt Ar nm : Ns Ar v
991 .Op Fl verify Ar file
995 The digest functions output the message digest of a supplied
1000 They can also be used for digital signing and verification.
1002 The options are as follows:
1005 Output the digest or signature in binary form.
1007 Print the digest in two-digit groups separated by colons.
1009 Print BIO debugging information.
1011 Use the specified message
1014 The available digests can be displayed using
1016 .Cm list-message-digest-commands .
1017 The following are equivalent:
1024 Digest is to be output as a hex dump.
1025 This is the default case for a
1027 digest as opposed to a digital signature.
1029 Create a hashed MAC using
1031 .It Fl keyform Cm pem
1032 Specifies the key format to sign the digest with.
1033 .It Fl mac Ar algorithm
1034 Create a keyed Message Authentication Code (MAC).
1035 The most popular MAC algorithm is HMAC (hash-based MAC),
1036 but there are other MAC algorithms which are not based on hash.
1037 MAC keys and other options should be set via the
1040 .It Fl macopt Ar nm : Ns Ar v
1041 Passes options to the MAC algorithm, specified by
1043 The following options are supported by HMAC:
1045 .It Cm key : Ns Ar string
1046 Specifies the MAC key as an alphanumeric string
1047 (use if the key contain printable characters only).
1048 String length must conform to any restrictions of the MAC algorithm.
1049 .It Cm hexkey : Ns Ar string
1050 Specifies the MAC key in hexadecimal form (two hex digits per byte).
1051 Key length must conform to any restrictions of the MAC algorithm.
1054 The output file to write to,
1055 or standard output if not specified.
1056 .It Fl passin Ar arg
1057 The key password source.
1058 .It Fl prverify Ar file
1059 Verify the signature using the private key in
1061 The output is either
1064 .Qq Verification Failure .
1066 Digitally sign the digest using the private key in
1068 .It Fl signature Ar file
1069 The actual signature to verify.
1070 .It Fl sigopt Ar nm : Ns Ar v
1071 Pass options to the signature algorithm during sign or verify operations.
1072 The names and values of these options are algorithm-specific.
1073 .It Fl verify Ar file
1074 Verify the signature using the public key in
1076 The output is either
1079 .Qq Verification Failure .
1081 File or files to digest.
1082 If no files are specified then standard input is used.
1086 .Nm "openssl dhparam"
1092 .Op Fl inform Cm der | pem
1095 .Op Fl outform Cm der | pem
1102 command is used to manipulate DH parameter files.
1103 Only the older PKCS#3 DH is supported,
1104 not the newer X9.42 DH.
1106 The options are as follows:
1109 The generator to use;
1111 If present, the input file is ignored and parameters are generated instead.
1113 Convert the parameters into C code.
1114 The parameters can then be loaded by calling the
1115 .No get_dh Ns Ar numbits
1118 Check the DH parameters.
1120 Read or create DSA parameters,
1121 converted to DH format on output.
1125 .Pq such that (p-1)/2 is also prime
1126 will be used for DH parameter generation.
1128 DH parameter generation with the
1130 option is much faster,
1131 and the recommended exponent length is shorter,
1132 which makes DH key exchange more efficient.
1133 Beware that with such DSA-style DH parameters,
1134 a fresh DH key should be created for each use to
1135 avoid small-subgroup attacks that may be possible otherwise.
1137 The input file to read from,
1138 or standard input if not specified.
1139 .It Fl inform Cm der | pem
1142 Do not output the encoded version of the parameters.
1144 The output file to write to,
1145 or standard output if not specified.
1146 .It Fl outform Cm der | pem
1149 Print the DH parameters in plain text.
1151 Generate a parameter set of size
1153 It must be the last option.
1154 If not present, a value of 2048 is used.
1155 If this value is present, the input file is ignored and
1156 parameters are generated instead.
1162 .Fl aes128 | aes192 | aes256 |
1166 .Op Fl inform Cm der | pem
1170 .Op Fl outform Cm der | pem
1171 .Op Fl passin Ar arg
1172 .Op Fl passout Ar arg
1180 command processes DSA keys.
1181 They can be converted between various forms and their components printed out.
1184 This command uses the traditional
1186 compatible format for private key encryption:
1187 newer applications should use the more secure PKCS#8 format using the
1191 The options are as follows:
1194 .Fl aes128 | aes192 | aes256 |
1197 Encrypt the private key with the AES, DES, or the triple DES
1198 ciphers, respectively, before outputting it.
1199 A pass phrase is prompted for.
1200 If none of these options are specified, the key is written in plain text.
1201 This means that using the
1203 utility to read an encrypted key with no encryption option can be used to
1204 remove the pass phrase from a key,
1205 or by setting the encryption options it can be used to add or change
1207 These options can only be used with PEM format output files.
1209 The input file to read from,
1210 or standard input if not specified.
1211 If the key is encrypted, a pass phrase will be prompted for.
1212 .It Fl inform Cm der | pem
1215 Print the value of the public key component of the key.
1217 Do not output the encoded version of the key.
1219 The output file to write to,
1220 or standard output if not specified.
1221 If any encryption options are set then a pass phrase will be
1223 .It Fl outform Cm der | pem
1225 .It Fl passin Ar arg
1226 The key password source.
1227 .It Fl passout Ar arg
1228 The output file password source.
1230 Read in a public key, not a private key.
1232 Output a public key, not a private key.
1233 Automatically set if the input is a public key.
1235 Print the public/private key in plain text.
1239 .Nm "openssl dsaparam"
1243 .Op Fl inform Cm der | pem
1246 .Op Fl outform Cm der | pem
1253 command is used to manipulate or generate DSA parameter files.
1255 The options are as follows:
1258 Convert the parameters into C code.
1259 The parameters can then be loaded by calling the
1260 .No get_dsa Ns Ar XXX
1263 Generate a DSA key either using the specified or generated
1266 The input file to read from,
1267 or standard input if not specified.
1270 parameter is included, then this option is ignored.
1271 .It Fl inform Cm der | pem
1274 Do not output the encoded version of the parameters.
1276 The output file to write to,
1277 or standard output if not specified.
1278 .It Fl outform Cm der | pem
1281 Print the DSA parameters in plain text.
1283 Generate a parameter set of size
1285 If this option is included, the input file is ignored.
1290 .Op Fl conv_form Ar arg
1294 .Op Fl inform Cm der | pem
1297 .Op Fl outform Cm der | pem
1298 .Op Fl param_enc Ar arg
1300 .Op Fl passin Ar arg
1301 .Op Fl passout Ar arg
1309 command processes EC keys.
1310 They can be converted between various
1311 forms and their components printed out.
1313 uses the private key format specified in
1314 .Dq SEC 1: Elliptic Curve Cryptography
1315 .Pq Lk http://www.secg.org/ .
1317 EC private key into the PKCS#8 private key format use the
1321 The options are as follows:
1323 .It Fl conv_form Ar arg
1324 Specify how the points on the elliptic curve are converted
1326 Possible values are:
1332 For more information regarding
1333 the point conversion forms see the X9.62 standard.
1335 Due to patent issues the
1337 option is disabled by default for binary curves
1338 and can be enabled by defining the preprocessor macro
1339 .Dv OPENSSL_EC_BIN_PT_COMP
1342 Encrypt the private key with DES, triple DES, or
1343 any other cipher supported by
1345 A pass phrase is prompted for.
1346 If none of these options is specified the key is written in plain text.
1347 This means that using the
1349 utility to read in an encrypted key with no
1350 encryption option can be used to remove the pass phrase from a key,
1351 or by setting the encryption options
1352 it can be used to add or change the pass phrase.
1353 These options can only be used with PEM format output files.
1355 The input file to read a key from,
1356 or standard input if not specified.
1357 If the key is encrypted a pass phrase will be prompted for.
1358 .It Fl inform Cm der | pem
1361 Do not output the encoded version of the key.
1363 The output filename to write to,
1364 or standard output if not specified.
1365 If any encryption options are set then a pass phrase will be prompted for.
1366 .It Fl outform Cm der | pem
1368 .It Fl param_enc Ar arg
1369 Specify how the elliptic curve parameters are encoded.
1372 i.e. the EC parameters are specified by an OID; or
1374 where the EC parameters are explicitly given
1375 (see RFC 3279 for the definition of the EC parameter structures).
1376 The default value is
1381 as specified in RFC 3279,
1382 is currently not implemented.
1383 .It Fl passin Ar arg
1384 The key password source.
1385 .It Fl passout Ar arg
1386 The output file password source.
1388 Read in a public key, not a private key.
1390 Output a public key, not a private key.
1391 Automatically set if the input is a public key.
1393 Print the public/private key in plain text.
1397 .Nm "openssl ecparam"
1400 .Op Fl conv_form Ar arg
1403 .Op Fl inform Cm der | pem
1409 .Op Fl outform Cm der | pem
1410 .Op Fl param_enc Ar arg
1416 command is used to manipulate or generate EC parameter files.
1418 is not able to generate new groups so
1420 can only create EC parameters from known (named) curves.
1422 The options are as follows:
1425 Convert the EC parameters into C code.
1426 The parameters can then be loaded by calling the
1427 .No get_ec_group_ Ns Ar XXX
1430 Validate the elliptic curve parameters.
1431 .It Fl conv_form Ar arg
1432 Specify how the points on the elliptic curve are converted
1434 Possible values are:
1440 For more information regarding
1441 the point conversion forms see the X9.62 standard.
1443 Due to patent issues the
1445 option is disabled by default for binary curves
1446 and can be enabled by defining the preprocessor macro
1447 .Dv OPENSSL_EC_BIN_PT_COMP
1450 Generate an EC private key using the specified parameters.
1452 The input file to read from,
1453 or standard input if not specified.
1454 .It Fl inform Cm der | pem
1458 currently implemented EC parameter names and exit.
1460 Use the EC parameters with the specified "short" name.
1462 Do not include the seed for the parameter generation
1463 in the ECParameters structure (see RFC 3279).
1465 Do not output the encoded version of the parameters.
1467 The output file to write to,
1468 or standard output if not specified.
1469 .It Fl outform Cm der | pem
1471 .It Fl param_enc Ar arg
1472 Specify how the elliptic curve parameters are encoded.
1475 i.e. the EC parameters are specified by an OID, or
1477 where the EC parameters are explicitly given
1478 (see RFC 3279 for the definition of the EC parameter structures).
1479 The default value is
1483 alternative, as specified in RFC 3279,
1484 is currently not implemented.
1486 Print the EC parameters in plain text.
1494 .Op Fl bufsize Ar number
1499 .Op Fl k Ar password
1500 .Op Fl kfile Ar file
1511 The symmetric cipher commands allow data to be encrypted or decrypted
1512 using various block and stream ciphers using keys based on passwords
1513 or explicitly provided.
1514 Base64 encoding or decoding can also be performed either by itself
1515 or in addition to the encryption or decryption.
1516 The program can be called either as
1517 .Nm openssl Ar ciphername
1519 .Nm openssl enc - Ns Ar ciphername .
1521 Some of the ciphers do not have large keys and others have security
1522 implications if not used correctly.
1523 All the block ciphers normally use PKCS#5 padding,
1524 also known as standard block padding.
1525 If padding is disabled, the input data must be a multiple of the cipher
1528 The options are as follows:
1533 option is set, then base64 process the data on one line.
1535 Base64 process the data.
1536 This means that if encryption is taking place, the data is base64-encoded
1538 If decryption is set, the input data is base64-decoded before
1540 .It Fl bufsize Ar number
1541 Set the buffer size for I/O.
1543 Decrypt the input data.
1545 Debug the BIOs used for I/O.
1547 Encrypt the input data.
1548 This is the default.
1550 The input file to read from,
1551 or standard input if not specified.
1555 .Pq initialisation vector
1557 this must be represented as a string comprised only of hex digits.
1560 is specified using the
1563 the IV must explicitly be defined.
1564 When a password is being specified using one of the other options,
1565 the IV is generated from this password.
1570 this must be represented as a string comprised only of hex digits.
1571 If only the key is specified,
1572 the IV must also be specified using the
1583 option will be used and the IV generated from the password will be taken.
1584 It probably does not make much sense to specify both
1588 .It Fl k Ar password
1591 to derive the key from.
1595 .It Fl kfile Ar file
1596 Read the password to derive the key from the first line of
1604 to create a key from a pass phrase.
1611 Use NULL cipher (no encryption or decryption of input).
1613 Disable standard block padding.
1615 Don't use a salt in the key derivation routines.
1616 This option should never be used
1617 since it makes it possible to perform efficient dictionary
1618 attacks on the password and to attack stream cipher encrypted data.
1620 The output file to write to,
1621 or standard output if not specified.
1623 Print out the salt, key, and IV used, then immediately exit;
1624 don't do any encryption or decryption.
1626 Print out the salt, key, and IV used.
1628 The password source.
1633 this must be represented as a string comprised only of hex digits.
1635 Use a salt in the key derivation routines (the default).
1636 When the salt is being used
1637 the first eight bytes of the encrypted data are reserved for the salt:
1638 it is randomly generated when encrypting a file and read from the
1639 encrypted file when it is decrypted.
1648 command performs error number to error string conversion,
1649 generating a human-readable string representing the error code
1651 The string is obtained through the
1652 .Xr ERR_error_string_n 3
1653 function and has the following format:
1655 .Dl error:[error code]:[library name]:[function name]:[reason string]
1658 is an 8-digit hexadecimal number.
1659 The remaining fields
1666 The options are as follows:
1669 Print debugging statistics about various aspects of the hash table.
1673 .Nm "openssl gendsa"
1675 .Fl aes128 | aes192 | aes256 |
1684 command generates a DSA private key from a DSA parameter file
1685 (typically generated by the
1686 .Nm openssl dsaparam
1688 DSA key generation is little more than random number generation so it is
1693 The options are as follows:
1696 .Fl aes128 | aes192 | aes256 |
1699 Encrypt the private key with the AES, DES,
1700 or the triple DES ciphers, respectively, before outputting it.
1701 A pass phrase is prompted for.
1702 If none of these options are specified, no encryption is used.
1704 The output file to write to,
1705 or standard output if not specified.
1707 Specify the DSA parameter file to use.
1708 The parameters in this file determine the size of the private key.
1712 .Nm "openssl genpkey"
1713 .Op Fl algorithm Ar alg
1717 .Op Fl outform Cm der | pem
1718 .Op Fl paramfile Ar file
1720 .Op Fl pkeyopt Ar opt : Ns Ar value
1726 command generates private keys.
1728 program is encouraged over the algorithm specific utilities
1729 because additional algorithm options can be used.
1731 The options are as follows:
1733 .It Fl algorithm Ar alg
1734 The public key algorithm to use,
1735 such as RSA, DSA, or DH.
1736 This option must precede any
1743 are mutually exclusive.
1745 Encrypt the private key with the supplied cipher.
1746 Any algorithm name accepted by
1747 .Xr EVP_get_cipherbyname 3
1750 Generate a set of parameters instead of a private key.
1751 This option must precede any
1758 The output file to write to,
1759 or standard output if not specified.
1760 .It Fl outform Cm der | pem
1762 .It Fl paramfile Ar file
1763 Some public key algorithms generate a private key based on a set of parameters,
1764 which can be supplied using this option.
1765 If this option is used the public key
1766 algorithm used is determined by the parameters.
1767 This option must precede any
1774 are mutually exclusive.
1776 The output file password source.
1777 .It Fl pkeyopt Ar opt : Ns Ar value
1778 Set the public key algorithm option
1783 .Bl -tag -width Ds -offset indent
1784 .It rsa_keygen_bits : Ns Ar numbits
1786 The number of bits in the generated key.
1787 The default is 2048.
1788 .It rsa_keygen_pubexp : Ns Ar value
1790 The RSA public exponent value.
1791 This can be a large decimal or hexadecimal value if preceded by 0x.
1792 The default is 65537.
1793 .It dsa_paramgen_bits : Ns Ar numbits
1795 The number of bits in the generated parameters.
1796 The default is 1024.
1797 .It dh_paramgen_prime_len : Ns Ar numbits
1799 The number of bits in the prime parameter
1801 .It dh_paramgen_generator : Ns Ar value
1803 The value to use for the generator
1805 .It ec_paramgen_curve : Ns Ar curve
1807 The EC curve to use.
1810 Print the private/public key in plain text.
1814 .Nm "openssl genrsa"
1816 .Op Fl aes128 | aes192 | aes256 | des | des3
1818 .Op Fl passout Ar arg
1824 command generates an RSA private key,
1825 which essentially involves the generation of two prime numbers.
1826 When generating the key,
1827 various symbols will be output to indicate the progress of the generation.
1830 represents each number which has passed an initial sieve test;
1832 means a number has passed a single round of the Miller-Rabin primality test.
1833 A newline means that the number has passed all the prime tests
1834 (the actual number depends on the key size).
1836 The options are as follows:
1839 The public exponent to use, either 3 or 65537.
1840 The default is 65537.
1841 .It Fl aes128 | aes192 | aes256 | des | des3
1842 Encrypt the private key with the AES, DES,
1843 or the triple DES ciphers, respectively, before outputting it.
1844 If none of these options are specified, no encryption is used.
1845 If encryption is used, a pass phrase is prompted for,
1846 if it is not supplied via the
1850 The output file to write to,
1851 or standard output if not specified.
1852 .It Fl passout Ar arg
1853 The output file password source.
1855 The size of the private key to generate in bits.
1856 This must be the last option specified.
1857 The default is 2048.
1867 command takes a file containing a Netscape certificate sequence
1868 (an alternative to the standard PKCS#7 format)
1869 and prints out the certificates contained in it,
1870 or takes a file of certificates
1871 and converts it into a Netscape certificate sequence.
1873 The options are as follows:
1876 The input file to read from,
1877 or standard input if not specified.
1879 The output file to write to,
1880 or standard output if not specified.
1882 Normally, a Netscape certificate sequence will be input and the output
1883 is the certificates contained in it.
1886 option the situation is reversed:
1887 a Netscape certificate sequence is created from a file of certificates.
1893 .Op Fl CAfile Ar file
1894 .Op Fl CApath Ar directory
1897 .Op Fl host Ar hostname : Ns Ar port
1898 .Op Fl index Ar indexfile
1899 .Op Fl issuer Ar file
1900 .Op Fl ndays Ar days
1901 .Op Fl nmin Ar minutes
1902 .Op Fl no_cert_checks
1903 .Op Fl no_cert_verify
1908 .Op Fl no_signature_verify
1911 .Op Fl nrequest Ar number
1914 .Op Fl port Ar portnum
1916 .Op Fl reqin Ar file
1917 .Op Fl reqout Ar file
1919 .Op Fl resp_no_certs
1921 .Op Fl respin Ar file
1922 .Op Fl respout Ar file
1924 .Op Fl rother Ar file
1925 .Op Fl rsigner Ar file
1926 .Op Fl serial Ar number
1927 .Op Fl sign_other Ar file
1928 .Op Fl signer Ar file
1929 .Op Fl signkey Ar file
1930 .Op Fl status_age Ar age
1933 .Op Fl url Ar responder_url
1934 .Op Fl VAfile Ar file
1935 .Op Fl validity_period Ar nsec
1936 .Op Fl verify_other Ar file
1939 The Online Certificate Status Protocol (OCSP)
1940 enables applications to determine the (revocation) state
1941 of an identified certificate (RFC 2560).
1945 command performs many common OCSP tasks.
1946 It can be used to print out requests and responses,
1947 create requests and send queries to an OCSP responder,
1948 and behave like a mini OCSP server itself.
1950 The options are as follows:
1952 .It Fl CAfile Ar file , Fl CApath Ar directory
1953 A file or path containing trusted CA certificates,
1954 used to verify the signature on the OCSP response.
1959 The issuer certificate is taken from the previous
1961 option, or an error occurs if no issuer certificate is specified.
1963 Use the digest algorithm
1965 for certificate identification in the OCSP request.
1966 By default SHA-1 is used.
1968 .Fl host Ar hostname : Ns Ar port ,
1977 specifies the HTTP path name to use, or
1980 .It Fl issuer Ar file
1981 The current issuer certificate, in PEM format.
1982 Can be used multiple times and must come before any
1985 .It Fl no_cert_checks
1986 Don't perform any additional checks on the OCSP response signer's certificate.
1987 That is, do not make any checks to see if the signer's certificate is
1988 authorised to provide the necessary status information:
1989 as a result this option should only be used for testing purposes.
1990 .It Fl no_cert_verify
1991 Don't verify the OCSP response signer's certificate at all.
1992 Since this option allows the OCSP response to be signed by any certificate,
1993 it should only be used for testing purposes.
1995 Don't include any certificates in the signed request.
1997 Do not use certificates in the response as additional untrusted CA
2000 Ignore certificates contained in the OCSP response
2001 when searching for the signer's certificate.
2002 The signer's certificate must be specified with either the
2007 .It Fl no_signature_verify
2008 Don't check the signature on the OCSP response.
2009 Since this option tolerates invalid signatures on OCSP responses,
2010 it will normally only be used for testing purposes.
2011 .It Fl nonce , no_nonce
2012 Add an OCSP nonce extension to a request,
2013 or disable an OCSP nonce addition.
2014 Normally, if an OCSP request is input using the
2016 option no nonce is added:
2019 option will force the addition of a nonce.
2020 If an OCSP request is being created (using the
2025 a nonce is automatically added; specifying
2029 Don't attempt to verify the OCSP response signature or the nonce values.
2030 This is normally only be used for debugging
2031 since it disables all verification of the responder's certificate.
2033 Specify the output file to write to,
2034 or standard output if not specified.
2035 .It Fl req_text , resp_text , text
2036 Print out the text form of the OCSP request, response, or both, respectively.
2037 .It Fl reqin Ar file , Fl respin Ar file
2038 Read an OCSP request or response file from
2040 These options are ignored
2041 if an OCSP request or response creation is implied by other options
2042 (for example with the
2047 .It Fl reqout Ar file , Fl respout Ar file
2048 Write out the DER-encoded certificate request or response to
2050 .It Fl serial Ar num
2053 option except the certificate with serial number
2055 is added to the request.
2056 The serial number is interpreted as a decimal integer unless preceded by
2058 Negative integers can also be specified
2059 by preceding the value with a minus sign.
2060 .It Fl sign_other Ar file
2061 Additional certificates to include in the signed request.
2062 .It Fl signer Ar file , Fl signkey Ar file
2063 Sign the OCSP request using the certificate specified in the
2065 option and the private key specified by the
2070 option is not present, then the private key is read from the same file
2072 If neither option is specified, the OCSP request is not signed.
2074 The certificates specified by the
2076 option should be explicitly trusted and no additional checks will be
2078 This is useful when the complete responder certificate chain is not available
2079 or trusting a root CA is not appropriate.
2080 .It Fl url Ar responder_url
2081 Specify the responder URL.
2084 URLs can be specified.
2085 .It Fl VAfile Ar file
2086 A file containing explicitly trusted responder certificates.
2092 .It Fl validity_period Ar nsec , Fl status_age Ar age
2093 The range of times, in seconds, which will be tolerated in an OCSP response.
2094 Each certificate status response includes a notBefore time
2095 and an optional notAfter time.
2096 The current time should fall between these two values,
2097 but the interval between the two times may be only a few seconds.
2098 In practice the OCSP responder and clients' clocks may not be precisely
2099 synchronised and so such a check may fail.
2102 option can be used to specify an acceptable error range in seconds,
2103 the default value being 5 minutes.
2105 If the notAfter time is omitted from a response,
2106 it means that new status information is immediately available.
2107 In this case the age of the notBefore field is checked
2108 to see it is not older than
2111 By default, this additional check is not performed.
2112 .It Fl verify_other Ar file
2113 A file containing additional certificates to search
2114 when attempting to locate the OCSP response signing certificate.
2115 Some responders omit the actual signer's certificate from the response,
2116 so this can be used to supply the necessary certificate.
2119 The options for the OCSP server are as follows:
2120 .Bl -tag -width "XXXX"
2122 CA certificate corresponding to the revocation information in
2124 .It Fl index Ar indexfile
2126 is a text index file in ca format
2127 containing certificate revocation information.
2129 If this option is specified,
2131 is in responder mode, otherwise it is in client mode.
2132 The requests the responder processes can be either specified on
2133 the command line (using the
2137 options), supplied in a file (using the
2139 option), or via external OCSP clients (if
2145 If this option is present, then the
2149 options must also be present.
2150 .It Fl nmin Ar minutes , Fl ndays Ar days
2155 when fresh revocation information is available:
2156 used in the nextUpdate field.
2157 If neither option is present,
2158 the nextUpdate field is omitted,
2159 meaning fresh revocation information is immediately available.
2160 .It Fl nrequest Ar number
2161 Exit after receiving
2163 requests (the default is unlimited).
2164 .It Fl port Ar portnum
2165 Port to listen for OCSP requests on.
2166 May also be specified using the
2170 Identify the signer certificate using the key ID;
2171 the default is to use the subject name.
2172 .It Fl resp_no_certs
2173 Don't include any certificates in the OCSP response.
2175 The private key to sign OCSP responses with;
2176 if not present, the file specified in the
2179 .It Fl rother Ar file
2180 Additional certificates to include in the OCSP response.
2181 .It Fl rsigner Ar file
2182 The certificate to sign OCSP responses with.
2185 Initially the OCSP responder certificate is located and the signature on
2186 the OCSP request checked using the responder certificate's public key.
2187 Then a normal certificate verify is performed on the OCSP responder certificate
2188 building up a certificate chain in the process.
2189 The locations of the trusted certificates used to build the chain can be
2194 options or they will be looked for in the standard
2196 certificates directory.
2198 If the initial verify fails, the OCSP verify process halts with an error.
2199 Otherwise the issuing CA certificate in the request is compared to the OCSP
2200 responder certificate: if there is a match then the OCSP verify succeeds.
2202 Otherwise the OCSP responder certificate's CA is checked against the issuing
2203 CA certificate in the request.
2204 If there is a match and the OCSPSigning extended key usage is present
2205 in the OCSP responder certificate, then the OCSP verify succeeds.
2207 Otherwise the root CA of the OCSP responder's CA is checked to see if it
2208 is trusted for OCSP signing.
2209 If it is, the OCSP verify succeeds.
2211 If none of these checks is successful, the OCSP verify fails.
2212 What this effectively means is that if the OCSP responder certificate is
2213 authorised directly by the CA it is issuing revocation information about
2214 (and it is correctly configured),
2215 then verification will succeed.
2217 If the OCSP responder is a global responder,
2218 which can give details about multiple CAs
2219 and has its own separate certificate chain,
2220 then its root CA can be trusted for OCSP signing.
2221 Alternatively, the responder certificate itself can be explicitly trusted
2227 .Nm "openssl passwd"
2228 .Op Fl 1 | apr1 | crypt
2233 .Op Fl salt Ar string
2241 command computes the hash of a password.
2243 The options are as follows:
2255 Apache variant of the
2262 algorithm (the default).
2267 Don't verify when reading a password from the terminal.
2269 Don't output warnings when passwords given on the command line are truncated.
2271 Switch table columns.
2272 This only makes sense in conjunction with the
2275 .It Fl salt Ar string
2276 Use the salt specified by
2278 When reading a password from the terminal, this implies
2281 Read passwords from standard input.
2283 In the output list, prepend the cleartext password and a TAB character
2284 to each password hash.
2290 .Op Fl inform Cm der | pem
2293 .Op Fl outform Cm der | pem
2300 command processes PKCS#7 files in DER or PEM format.
2301 The PKCS#7 routines only understand PKCS#7 v 1.5 as specified in RFC 2315.
2303 The options are as follows:
2306 The input file to read from,
2307 or standard input if not specified.
2308 .It Fl inform Cm der | pem
2311 Don't output the encoded version of the PKCS#7 structure
2316 The output to write to,
2317 or standard output if not specified.
2318 .It Fl outform Cm der | pem
2321 Print any certificates or CRLs contained in the file,
2322 preceded by their subject and issuer names in a one-line format.
2324 Print certificate details in full rather than just subject and issuer names.
2330 .Op Fl inform Cm der | pem
2334 .Op Fl outform Cm der | pem
2335 .Op Fl passin Ar arg
2336 .Op Fl passout Ar arg
2344 command processes private keys
2345 (both encrypted and unencrypted)
2347 with a variety of PKCS#5 (v1.5 and v2.0) and PKCS#12 algorithms.
2348 The default encryption is only 56 bits;
2349 keys encrypted using PKCS#5 v2.0 algorithms and high iteration counts
2352 The options are as follows:
2355 The input file to read from,
2356 or standard input if not specified.
2357 If the key is encrypted, a pass phrase will be prompted for.
2358 .It Fl inform Cm der | pem
2361 Generate an unencrypted PrivateKeyInfo structure.
2362 This option does not encrypt private keys at all
2363 and should only be used when absolutely necessary.
2365 Use an iteration count of 1.
2368 section below for a detailed explanation of this option.
2370 The output file to write to,
2371 or standard output if none is specified.
2372 If any encryption options are set, a pass phrase will be prompted for.
2373 .It Fl outform Cm der | pem
2375 .It Fl passin Ar arg
2376 The key password source.
2377 .It Fl passout Ar arg
2378 The output file password source.
2380 Read a traditional format private key and write a PKCS#8 format key.
2382 Specify a PKCS#5 v1.5 or PKCS#12 algorithm to use.
2384 .Bl -tag -width "XXXX" -compact
2387 .It PBE-SHA1-RC2-64 | PBE-MD5-RC2-64 | PBE-SHA1-DES
2388 64-bit RC2 or 56-bit DES.
2389 .It PBE-SHA1-RC4-128 | PBE-SHA1-RC4-40 | PBE-SHA1-3DES
2390 .It PBE-SHA1-2DES | PBE-SHA1-RC2-128 | PBE-SHA1-RC2-40
2391 PKCS#12 password-based encryption algorithm,
2392 which allow strong encryption algorithms like triple DES or 128-bit RC2.
2395 Use PKCS#5 v2.0 algorithms.
2396 Supports algorithms such as 168-bit triple DES or 128-bit RC2,
2397 however not many implementations support PKCS#5 v2.0 yet
2398 (if using private keys with
2400 this doesn't matter).
2403 is the encryption algorithm to use;
2404 valid values include des, des3, and rc2.
2405 It is recommended that des3 is used.
2409 .Nm "openssl pkcs12"
2410 .Op Fl aes128 | aes192 | aes256 | des | des3
2412 .Op Fl CAfile Ar file
2413 .Op Fl caname Ar name
2414 .Op Fl CApath Ar directory
2415 .Op Fl certfile Ar file
2416 .Op Fl certpbe Ar alg
2424 .Op Fl inkey Ar file
2426 .Op Fl keypbe Ar alg
2428 .Op Fl macalg Ar alg
2440 .Op Fl passin Ar arg
2441 .Op Fl passout Ar arg
2447 command allows PKCS#12 files
2448 .Pq sometimes referred to as PFX files
2449 to be created and parsed.
2450 By default, a PKCS#12 file is parsed;
2451 a PKCS#12 file can be created by using the
2455 The options for parsing a PKCS12 file are as follows:
2456 .Bl -tag -width "XXXX"
2457 .It Fl aes128 | aes192 | aes256 | des | des3
2458 Encrypt private keys
2459 using AES, DES, or triple DES, respectively.
2460 The default is triple DES.
2462 Only output CA certificates
2463 .Pq not client certificates .
2465 Only output client certificates
2466 .Pq not CA certificates .
2468 The input file to read from,
2469 or standard input if not specified.
2471 Output additional information about the PKCS#12 file structure,
2472 algorithms used, and iteration counts.
2474 Do not output certificates.
2476 Do not encrypt private keys.
2478 Do not output private keys.
2480 Do not attempt to verify the integrity MAC before reading the file.
2482 Do not output the keys and certificates to the output file
2483 version of the PKCS#12 file.
2485 The output file to write to,
2486 or standard output if not specified.
2487 .It Fl passin Ar arg
2488 The key password source.
2489 .It Fl passout Ar arg
2490 The output file password source.
2492 Prompt for separate integrity and encryption passwords: most software
2493 always assumes these are the same so this option will render such
2494 PKCS#12 files unreadable.
2497 The options for PKCS12 file creation are as follows:
2498 .Bl -tag -width "XXXX"
2499 .It Fl CAfile Ar file
2500 CA storage as a file.
2501 .It Fl CApath Ar directory
2502 CA storage as a directory.
2503 The directory must be a standard certificate directory:
2504 that is, a hash of each subject name (using
2506 should be linked to each certificate.
2507 .It Fl caname Ar name
2510 for other certificates.
2511 May be used multiple times to specify names for all certificates
2512 in the order they appear.
2513 .It Fl certfile Ar file
2514 A file to read additional certificates from.
2515 .It Fl certpbe Ar alg , Fl keypbe Ar alg
2516 Specify the algorithm used to encrypt the private key and
2517 certificates to be selected.
2518 Any PKCS#5 v1.5 or PKCS#12 PBE algorithm name can be used.
2521 .Cm list-cipher-algorithms
2522 command) is specified then it
2523 is used with PKCS#5 v2.0.
2524 For interoperability reasons it is advisable to only use PKCS#12 algorithms.
2526 Include the entire certificate chain of the user certificate.
2527 The standard CA store is used for this search.
2528 If the search fails, it is considered a fatal error.
2532 as a Microsoft CSP name.
2534 Encrypt the certificate using triple DES; this may render the PKCS#12
2535 file unreadable by some
2538 By default, the private key is encrypted using triple DES and the
2539 certificate using 40-bit RC2.
2541 Create a PKCS#12 file (rather than parsing one).
2543 The input file to read from,
2544 or standard input if not specified.
2545 The order doesn't matter but one private key and its corresponding
2546 certificate should be present.
2547 If additional certificates are present, they will also be included
2548 in the PKCS#12 file.
2549 .It Fl inkey Ar file
2550 File to read a private key from.
2551 If not present, a private key must be present in the input file.
2552 .It Fl keyex | keysig
2553 Specify whether the private key is to be used for key exchange or just signing.
2556 software will only allow 512-bit RSA keys to be
2557 used for encryption purposes, but arbitrary length keys for signing.
2560 option marks the key for signing only.
2561 Signing only keys can be used for S/MIME signing, authenticode
2562 (ActiveX control signing)
2563 and SSL client authentication.
2564 .It Fl macalg Ar alg
2565 Specify the MAC digest algorithm.
2566 The default is SHA1.
2568 Included for compatibility only:
2569 it used to be needed to use MAC iterations counts
2570 but they are now used by default.
2574 for the certificate and private key.
2575 This name is typically displayed in list boxes by software importing the file.
2577 Don't attempt to provide the MAC integrity.
2578 .It Fl nomaciter , noiter
2579 Affect the iteration counts on the MAC and key algorithms.
2581 To discourage attacks by using large dictionaries of common passwords,
2582 the algorithm that derives keys from passwords can have an iteration count
2583 applied to it: this causes a certain part of the algorithm to be repeated
2585 The MAC is used to check the file integrity but since it will normally
2586 have the same password as the keys and certificates it could also be attacked.
2587 By default, both MAC and encryption iteration counts are set to 2048;
2588 using these options the MAC and encryption iteration counts can be set to 1.
2589 Since this reduces the file security you should not use these options
2590 unless you really have to.
2591 Most software supports both MAC and key iteration counts.
2593 The output file to write to,
2594 or standard output if not specified.
2595 .It Fl passin Ar arg
2596 The key password source.
2597 .It Fl passout Ar arg
2598 The output file password source.
2605 .Op Fl inform Cm der | pem
2608 .Op Fl outform Cm der | pem
2609 .Op Fl passin Ar arg
2610 .Op Fl passout Ar arg
2619 command processes public or private keys.
2620 They can be converted between various forms
2621 and their components printed out.
2623 The options are as follows:
2626 Encrypt the private key with the specified cipher.
2627 Any algorithm name accepted by
2628 .Xr EVP_get_cipherbyname 3
2629 is acceptable, such as
2632 The input file to read from,
2633 or standard input if not specified.
2634 If the key is encrypted a pass phrase will be prompted for.
2635 .It Fl inform Cm der | pem
2638 Do not output the encoded version of the key.
2640 The output file to write to,
2641 or standard output if not specified.
2642 If any encryption options are set then a pass phrase
2643 will be prompted for.
2644 .It Fl outform Cm der | pem
2646 .It Fl passin Ar arg
2647 The key password source.
2648 .It Fl passout Ar arg
2649 The output file password source.
2651 Read in a public key, not a private key.
2653 Output a public key, not a private key.
2654 Automatically set if the input is a public key.
2656 Print the public/private key in plain text.
2658 Print out only public key components
2659 even if a private key is being processed.
2662 .Cm openssl pkeyparam
2670 command processes public or private keys.
2671 The key type is determined by the PEM headers.
2673 The options are as follows:
2676 The input file to read from,
2677 or standard input if not specified.
2679 Do not output the encoded version of the parameters.
2681 The output file to write to,
2682 or standard output if not specified.
2684 Print the parameters in plain text.
2688 .Nm "openssl pkeyutl"
2696 .Op Fl inkey Ar file
2697 .Op Fl keyform Cm der | pem
2699 .Op Fl passin Ar arg
2700 .Op Fl peerform Cm der | pem
2701 .Op Fl peerkey Ar file
2702 .Op Fl pkeyopt Ar opt : Ns Ar value
2705 .Op Fl sigfile Ar file
2708 .Op Fl verifyrecover
2713 command can be used to perform public key operations using
2714 any supported algorithm.
2716 The options are as follows:
2719 ASN.1 parse the output data.
2720 This is useful when combined with the
2722 option when an ASN.1 structure is signed.
2724 The input is a certificate containing a public key.
2726 Decrypt the input data using a private key.
2728 Derive a shared secret using the peer key.
2730 Encrypt the input data using a public key.
2732 Hex dump the output data.
2734 The input file to read from,
2735 or standard input if not specified.
2736 .It Fl inkey Ar file
2738 By default it should be a private key.
2739 .It Fl keyform Cm der | pem
2742 The output file to write to,
2743 or standard output if not specified.
2744 .It Fl passin Ar arg
2745 The key password source.
2746 .It Fl peerform Cm der | pem
2747 The peer key format.
2748 .It Fl peerkey Ar file
2749 The peer key file, used by key derivation (agreement) operations.
2750 .It Fl pkeyopt Ar opt : Ns Ar value
2751 Set the public key algorithm option
2755 Unless otherwise mentioned, all algorithms support the format
2756 .Ar digest : Ns Ar alg ,
2757 which specifies the digest to use
2758 for sign, verify, and verifyrecover operations.
2761 should represent a digest name as used in the
2762 .Xr EVP_get_digestbyname 3
2765 The RSA algorithm supports the
2766 encrypt, decrypt, sign, verify, and verifyrecover operations in general.
2767 Some padding modes only support some of these
2770 .It rsa_padding_mode : Ns Ar mode
2771 This sets the RSA padding mode.
2772 Acceptable values for
2787 In PKCS#1 padding if the message digest is not set then the supplied data is
2788 signed or verified directly instead of using a DigestInfo structure.
2789 If a digest is set then a DigestInfo
2790 structure is used and its length
2791 must correspond to the digest type.
2792 For oeap mode only encryption and decryption is supported.
2793 For x931 if the digest type is set it is used to format the block data;
2794 otherwise the first byte is used to specify the X9.31 digest ID.
2795 Sign, verify, and verifyrecover can be performed in this mode.
2796 For pss mode only sign and verify are supported and the digest type must be
2798 .It rsa_pss_saltlen : Ns Ar len
2800 mode only this option specifies the salt length.
2801 Two special values are supported:
2802 -1 sets the salt length to the digest length.
2803 When signing -2 sets the salt length to the maximum permissible value.
2804 When verifying -2 causes the salt length to be automatically determined
2805 based on the PSS block structure.
2808 The DSA algorithm supports the sign and verify operations.
2809 Currently there are no additional options other than
2811 Only the SHA1 digest can be used and this digest is assumed by default.
2813 The DH algorithm supports the derive operation
2814 and no additional options.
2816 The EC algorithm supports the sign, verify, and derive operations.
2817 The sign and verify operations use ECDSA and derive uses ECDH.
2818 Currently there are no additional options other than
2820 Only the SHA1 digest can be used and this digest is assumed by default.
2822 The input file is a public key.
2824 Reverse the order of the input buffer.
2825 .It Fl sigfile Ar file
2826 Signature file (verify operation only).
2828 Sign the input data and output the signed result.
2829 This requires a private key.
2831 Verify the input data against the signature file and indicate if the
2832 verification succeeded or failed.
2833 .It Fl verifyrecover
2834 Verify the input data and output the recovered data.
2847 command is used to generate prime numbers,
2848 or to check numbers for primality.
2849 Results are probabilistic:
2850 they have an exceedingly high likelihood of being correct,
2851 but are not guaranteed.
2853 The options are as follows:
2856 Specify the number of bits in the generated prime number.
2857 Must be used in conjunction with
2860 Perform a Miller-Rabin probabilistic primality test with
2865 Generate a pseudo-random prime number.
2866 Must be used in conjunction with
2869 Output in hex format.
2874 (i.e. a prime p so that (p-1)/2 is also prime).
2893 pseudo-random bytes.
2895 The options are as follows:
2898 Perform base64 encoding on the output.
2900 Specify hexadecimal output.
2902 The output file to write to,
2903 or standard output if not specified.
2910 .Op Fl config Ar file
2912 .Op Fl extensions Ar section
2914 .Op Fl inform Cm der | pem
2915 .Op Fl key Ar keyfile
2916 .Op Fl keyform Cm der | pem
2917 .Op Fl keyout Ar file
2918 .Op Fl md4 | md5 | sha1
2920 .Op Fl nameopt Ar option
2923 .Op Fl newkey Ar arg
2924 .Op Fl no-asn1-kludge
2928 .Op Fl outform Cm der | pem
2929 .Op Fl passin Ar arg
2930 .Op Fl passout Ar arg
2932 .Op Fl reqexts Ar section
2933 .Op Fl reqopt Ar option
2934 .Op Fl set_serial Ar n
2946 command primarily creates and processes certificate requests
2948 It can additionally create self-signed certificates,
2949 for use as root CAs, for example.
2951 The options are as follows:
2954 Produce requests in an invalid format for certain picky CAs.
2955 Very few CAs still require the use of this option.
2957 Non-interactive mode.
2958 .It Fl config Ar file
2959 Specify an alternative configuration file.
2961 Specify the number of days to certify the certificate for.
2962 The default is 30 days.
2966 .It Fl extensions Ar section , Fl reqexts Ar section
2967 Specify alternative sections to include certificate
2970 or certificate request extensions,
2971 allowing several different sections to be used in the same configuration file.
2973 The input file to read a request from,
2974 or standard input if not specified.
2975 A request is only read if the creation options
2980 .It Fl inform Cm der | pem
2982 .It Fl key Ar keyfile
2983 The file to read the private key from.
2984 It also accepts PKCS#8 format private keys for PEM format files.
2985 .It Fl keyform Cm der | pem
2986 The format of the private key file specified in the
2991 .It Fl keyout Ar file
2992 The file to write the newly created private key to.
2993 If this option is not specified,
2994 the filename present in the configuration file is used.
2995 .It Fl md5 | sha1 | sha256
2996 The message digest to sign the request with.
2997 This overrides the digest algorithm specified in the configuration file.
2999 Some public key algorithms may override this choice.
3000 For instance, DSA signatures always use SHA1.
3002 Print the value of the modulus of the public key contained in the request.
3003 .It Fl nameopt Ar option , Fl reqopt Ar option
3004 Determine how the subject or issuer names are displayed.
3006 can be a single option or multiple options separated by commas.
3007 Alternatively, these options may be used more than once to set multiple options.
3010 section below for details.
3012 Generate a new certificate request.
3013 The user is prompted for the relevant field values.
3014 The actual fields prompted for and their maximum and minimum sizes
3015 are specified in the configuration file and any requested extensions.
3019 option is not used, it will generate a new RSA private
3020 key using information specified in the configuration file.
3022 Add the word NEW to the PEM file header and footer lines
3023 on the outputed request.
3024 Some software and CAs need this.
3025 .It Fl newkey Ar arg
3026 Create a new certificate request and a new private key.
3027 The argument takes one of several forms.
3029 .No rsa : Ns Ar nbits
3030 generates an RSA key
3036 the default key size is used.
3038 .No dsa : Ns Ar file
3039 generates a DSA key using the parameters in
3042 .No param : Ns Ar file
3043 generates a key using the parameters or certificate in
3046 All other algorithms support the form
3047 .Ar algorithm : Ns Ar file ,
3048 where file may be an algorithm parameter file,
3050 .Cm genpkey -genparam
3051 command or an X.509 certificate for a key with appropriate algorithm.
3054 in which case any parameters can be specified via the
3057 .It Fl no-asn1-kludge
3058 Reverse the effect of
3061 Do not encrypt the private key.
3063 Do not output the encoded version of the request.
3065 The output file to write to,
3066 or standard output if not spceified.
3067 .It Fl outform Cm der | pem
3069 .It Fl passin Ar arg
3070 The key password source.
3071 .It Fl passout Ar arg
3072 The output file password source.
3074 Output the public key.
3075 .It Fl reqopt Ar option
3076 Customise the output format used with
3080 argument can be a single option or multiple options separated by commas.
3081 See also the discussion of
3086 .It Fl set_serial Ar n
3087 Serial number to use when outputting a self-signed certificate.
3088 This may be specified as a decimal value or a hex value if preceded by
3090 It is possible to use negative serial numbers but this is not recommended.
3092 Replaces the subject field of an input request
3093 with the specified data and output the modified request.
3095 must be formatted as /type0=value0/type1=value1/type2=...;
3096 characters may be escaped by
3099 no spaces are skipped.
3101 Print the request subject (or certificate subject if
3105 Print the certificate request in plain text.
3107 Interpret field values as UTF8 strings, not ASCII.
3109 Print extra details about the operations being performed.
3111 Verify the signature on the request.
3113 Output a self-signed certificate instead of a certificate request.
3114 This is typically used to generate a test certificate or a self-signed root CA.
3115 The extensions added to the certificate (if any)
3116 are specified in the configuration file.
3117 Unless specified using the
3119 option, 0 is used for the serial number.
3122 The configuration options are specified in the
3124 section of the configuration file.
3125 The options available are as follows:
3126 .Bl -tag -width "XXXX"
3128 The section containing any request attributes: its format
3130 .Cm distinguished_name .
3131 Typically these may contain the challengePassword or unstructuredName types.
3132 They are currently ignored by the
3134 request signing utilities, but some CAs might want them.
3136 The default key size, in bits.
3137 The default is 2048.
3140 option is used and can be overridden by using the
3143 .It Cm default_keyfile
3144 The default file to write a private key to,
3145 or standard output if not specified.
3146 It can be overridden by the
3150 The digest algorithm to use.
3151 Possible values include
3157 It can be overridden on the command line.
3158 .It Cm distinguished_name
3159 The section containing the distinguished name fields to
3160 prompt for when generating a certificate or certificate request.
3161 The format is described below.
3165 and a private key is generated, it is not encrypted.
3166 It is equivalent to the
3171 is an equivalent option.
3172 .It Cm input_password | output_password
3173 The passwords for the input private key file (if present)
3174 and the output private key file (if one will be created).
3175 The command line options
3179 override the configuration file values.
3181 A file containing additional OBJECT IDENTIFIERS.
3182 Each line of the file should consist of the numerical form of the
3183 object identifier, followed by whitespace, then the short name followed
3184 by whitespace and finally the long name.
3186 Specify a section in the configuration file containing extra
3188 Each line should consist of the short name of the
3189 object identifier followed by
3191 and the numerical form.
3192 The short and long names are the same when this option is used.
3196 it disables prompting of certificate fields
3197 and just takes values from the config file directly.
3198 It also changes the expected format of the
3199 .Cm distinguished_name
3203 .It Cm req_extensions
3204 The configuration file section containing a list of
3205 extensions to add to the certificate request.
3206 It can be overridden by the
3210 Limit the string types for encoding certain fields.
3211 The following values may be used, limiting strings to the indicated types:
3212 .Bl -tag -width "MASK:number"
3215 This is the default, as recommended by PKIX in RFC 2459.
3217 PrintableString, IA5String, T61String, BMPString, UTF8String.
3219 PrintableString, IA5String, BMPString, UTF8String.
3220 Inspired by the PKIX recommendation in RFC 2459 for certificates
3221 generated before 2004, but differs by also permitting IA5String.
3223 PrintableString, IA5String, T61String, UniversalString.
3224 A workaround for some ancient software that had problems
3225 with the variable-sized BMPString and UTF8String types.
3226 .It Cm MASK : Ns Ar number
3227 An explicit bitmask of permitted types, where
3229 is a C-style hex, decimal, or octal number that's a bit-wise OR of
3232 .In openssl/asn1.h .
3237 field values are interpreted as UTF8 strings.
3238 .It Cm x509_extensions
3239 The configuration file section containing a list of
3240 extensions to add to a certificate generated when the
3243 It can be overridden by the
3245 command line switch.
3248 There are two separate formats for the distinguished name and attribute
3254 then these sections just consist of field names and values.
3257 option is absent or not set to
3259 then the file contains field prompting information of the form:
3260 .Bd -unfilled -offset indent
3262 fieldName_default="default field value"
3268 is the field name being used, for example
3273 string is used to ask the user to enter the relevant details.
3274 If the user enters nothing, the default value is used;
3275 if no default value is present, the field is omitted.
3276 A field can still be omitted if a default value is present,
3277 if the user just enters the
3281 The number of characters entered must be between the
3282 fieldName_min and fieldName_max limits:
3283 there may be additional restrictions based on the field being used
3286 can only ever be two characters long and must fit in a
3287 .Cm PrintableString ) .
3289 Some fields (such as
3290 .Cm organizationName )
3291 can be used more than once in a DN.
3292 This presents a problem because configuration files will
3293 not recognize the same name occurring twice.
3294 To avoid this problem, if the
3296 contains some characters followed by a full stop, they will be ignored.
3297 So, for example, a second
3298 .Cm organizationName
3299 can be input by calling it
3300 .Qq 1.organizationName .
3302 The actual permitted field names are any object identifier short or
3304 These are compiled into
3306 and include the usual values such as
3307 .Cm commonName , countryName , localityName , organizationName ,
3308 .Cm organizationalUnitName , stateOrProvinceName .
3311 is included as well as
3312 .Cm name , surname , givenName , initials
3316 Additional object identifiers can be defined with the
3320 options in the configuration file.
3321 Any additional fields will be treated as though they were a
3322 .Cm DirectoryString .
3326 .Op Fl aes128 | aes192 | aes256 | des | des3
3329 .Op Fl inform Cm der | net | pem
3333 .Op Fl outform Cm der | net | pem
3334 .Op Fl passin Ar arg
3335 .Op Fl passout Ar arg
3344 command processes RSA keys.
3345 They can be converted between various forms and their components printed out.
3347 uses the traditional
3349 compatible format for private key encryption:
3350 newer applications should use the more secure PKCS#8 format using the
3354 The options are as follows:
3356 .It Fl aes128 | aes192 | aes256 | des | des3
3357 Encrypt the private key with the AES, DES,
3358 or the triple DES ciphers, respectively, before outputting it.
3359 A pass phrase is prompted for.
3360 If none of these options are specified, the key is written in plain text.
3361 This means that using the
3363 utility to read in an encrypted key with no encryption option can be used
3364 to remove the pass phrase from a key, or by setting the encryption options
3365 it can be used to add or change the pass phrase.
3366 These options can only be used with PEM format output files.
3368 Check the consistency of an RSA private key.
3370 The input file to read from,
3371 or standard input if not specified.
3372 If the key is encrypted, a pass phrase will be prompted for.
3373 .It Fl inform Cm der | net | pem
3376 Do not output the encoded version of the key.
3378 Print the value of the modulus of the key.
3380 The output file to write to,
3381 or standard output if not specified.
3382 .It Fl outform Cm der | net | pem
3384 .It Fl passin Ar arg
3385 The key password source.
3386 .It Fl passout Ar arg
3387 The output file password source.
3389 Read in a public key,
3392 Output a public key,
3394 Automatically set if the input is a public key.
3396 Use the modified NET algorithm used with some versions of Microsoft IIS
3399 Print the public/private key components in plain text.
3403 .Nm "openssl rsautl"
3410 .Op Fl inkey Ar file
3411 .Op Fl keyform Cm der | pem
3412 .Op Fl oaep | pkcs | raw
3421 command can be used to sign, verify, encrypt and decrypt
3422 data using the RSA algorithm.
3424 The options are as follows:
3427 Asn1parse the output data; this is useful when combined with the
3431 The input is a certificate containing an RSA public key.
3433 Decrypt the input data using an RSA private key.
3435 Encrypt the input data using an RSA public key.
3437 Hex dump the output data.
3439 The input to read from,
3440 or standard input if not specified.
3441 .It Fl inkey Ar file
3442 The input key file; by default an RSA private key.
3443 .It Fl keyform Cm der | pem
3444 The private key format.
3447 .It Fl oaep | pkcs | raw
3449 PKCS#1 OAEP, PKCS#1 v1.5 (the default), or no padding, respectively.
3450 For signatures, only
3456 The output file to write to,
3457 or standard output if not specified.
3459 The input file is an RSA public key.
3461 Sign the input data and output the signed result.
3462 This requires an RSA private key.
3464 Verify the input data and output the recovered data.
3468 .Nm "openssl s_client"
3471 .Op Fl CAfile Ar file
3472 .Op Fl CApath Ar directory
3475 .Op Fl cipher Ar cipherlist
3476 .Op Fl connect Ar host Ns Op : Ns Ar port
3478 .Op Fl crl_check_all
3484 .Op Fl ignore_critical
3485 .Op Fl issuer_checks
3486 .Op Fl key Ar keyfile
3497 .Op Fl proxy Ar host : Ns Ar port
3499 .Op Fl psk_identity Ar identity
3502 .Op Fl servername Ar name
3504 .Op Fl starttls Ar protocol
3510 .Op Fl verify Ar depth
3512 .Op Fl xmpphost Ar host
3517 command implements a generic SSL/TLS client which connects
3518 to a remote host using SSL/TLS.
3520 If a connection is established with an SSL server, any data received
3521 from the server is displayed and any key presses will be sent to the
3523 When used interactively (which means neither
3527 have been given), the session will be renegotiated if the line begins with an
3529 if the line begins with a
3531 or if end of file is reached, the connection will be closed down.
3533 The options are as follows:
3536 Attempt connections using IPv4 only.
3538 Attempt connections using IPv6 only.
3540 Enable various workarounds for buggy implementations.
3541 .It Fl CAfile Ar file
3544 containing trusted certificates to use during server authentication
3545 and to use when attempting to build the client certificate chain.
3546 .It Fl CApath Ar directory
3549 to use for server certificate verification.
3550 This directory must be in
3554 for more information.
3555 These are also used when building the client certificate chain.
3557 The certificate to use, if one is requested by the server.
3558 The default is not to use a certificate.
3564 .Fl ignore_critical ,
3569 Set various certificate chain validation options.
3572 command for details.
3573 .It Fl cipher Ar cipherlist
3574 Modify the cipher list sent by the client.
3575 Although the server determines which cipher suite is used, it should take
3576 the first supported cipher in the list sent by the client.
3579 command for more information.
3580 .It Fl connect Ar host Ns Op : Ns Ar port
3586 If not specified, an attempt is made to connect to the local host
3588 Alternatively, the host and port pair may be separated using a forward-slash
3590 which is useful for numeric IPv6 addresses.
3592 Translate a line feed from the terminal into CR+LF,
3593 as required by some servers.
3595 Print extensive debugging information, including a hex dump of all traffic.
3596 .It Fl groups Ar ecgroups
3597 Specify a colon-separated list of permitted EC curve groups.
3599 Inhibit shutting down the connection when end of file is reached in the input.
3600 .It Fl key Ar keyfile
3601 The private key to use.
3602 If not specified, the certificate file will be used.
3604 Show all protocol messages with hex dump.
3606 Turn on non-blocking I/O.
3608 Test non-blocking I/O.
3609 .It Fl no_tls1 | no_tls1_1 | no_tls1_2
3610 Disable the use of TLS1.0, 1.1, and 1.2, respectively.
3612 Disable RFC 4507 session ticket support.
3614 Pause 1 second between each read and write call.
3616 Print session information when the program exits.
3617 This will always attempt
3618 to print out information even if the connection fails.
3619 Normally, information will only be printed out once if the connection succeeds.
3620 This option is useful because the cipher in use may be renegotiated
3621 or the connection may fail because a client certificate is required or is
3622 requested only after an attempt is made to access a certain URL.
3623 Note that the output produced by this option is not always accurate
3624 because a connection might never have been established.
3625 .It Fl proxy Ar host : Ns Ar port
3626 Use the HTTP proxy at
3630 The connection to the proxy is done in cleartext and the
3632 argument is given to the proxy.
3633 If not specified, localhost is used as final destination.
3634 After that, switch the connection through the proxy to the destination
3639 when using a PSK cipher suite.
3640 The key is given as a hexadecimal number without the leading 0x,
3641 for example -psk 1a2b3c4d.
3642 .It Fl psk_identity Ar identity
3645 when using a PSK cipher suite.
3647 Inhibit printing of session and certificate information.
3648 This implicitly turns on
3652 Reconnect to the same server 5 times using the same session ID; this can
3653 be used as a test that session caching is working.
3654 .It Fl servername Ar name
3655 Include the TLS Server Name Indication (SNI) extension in the ClientHello
3656 message, using the specified server
3659 Display the whole server certificate chain: normally only the server
3660 certificate itself is displayed.
3661 .It Fl starttls Ar protocol
3662 Send the protocol-specific messages to switch to TLS for communication.
3664 is a keyword for the intended protocol.
3665 Currently, the supported keywords are
3673 Print the SSL session states.
3674 .It Fl tls1 | tls1_1 | tls1_2
3675 Permit only TLS1.0, 1.1, or 1.2, respectively.
3677 Print a hex dump of any TLS extensions received from the server.
3678 .It Fl verify Ar depth
3679 Turn on server certificate verification,
3680 with a maximum length of
3682 Currently the verify operation continues after errors so all the problems
3683 with a certificate chain can be seen.
3684 As a side effect the connection will never fail due to a server
3685 certificate verify failure.
3686 .It Fl xmpphost Ar hostname
3688 .Fl starttls Ar xmpp ,
3689 specify the host for the "to" attribute of the stream element.
3690 If this option is not specified then the host specified with
3696 .Nm "openssl s_server"
3697 .Op Fl accept Ar port
3699 .Op Fl CAfile Ar file
3700 .Op Fl CApath Ar directory
3702 .Op Fl cipher Ar cipherlist
3703 .Op Fl context Ar id
3705 .Op Fl crl_check_all
3707 .Op Fl dcert Ar file
3709 .Op Fl dhparam Ar file
3713 .Op Fl id_prefix Ar arg
3714 .Op Fl key Ar keyfile
3725 .Op Fl psk_hint Ar hint
3732 .Op Fl Verify Ar depth
3733 .Op Fl verify Ar depth
3740 command implements a generic SSL/TLS server which listens
3741 for connections on a given port using SSL/TLS.
3743 If a connection request is established with a client and neither the
3747 option has been used, then any data received
3748 from the client is displayed and any key presses are sent to the client.
3749 Certain single letter commands perform special operations:
3751 .Bl -tag -width "XXXX" -compact
3753 Send plain text, which should cause the client to disconnect.
3755 End the current SSL connection and exit.
3757 End the current SSL connection, but still accept new connections.
3759 Renegotiate the SSL session and request a client certificate.
3761 Renegotiate the SSL session.
3763 Print out some session cache status information.
3766 The options are as follows:
3768 .It Fl accept Ar port
3772 The default is port 4433.
3774 Enable various workarounds for buggy implementations.
3775 .It Fl CAfile Ar file
3778 containing trusted certificates to use during client authentication
3779 and to use when attempting to build the server certificate chain.
3780 The list is also used in the list of acceptable client CAs passed to the
3781 client when a certificate is requested.
3782 .It Fl CApath Ar directory
3785 to use for client certificate verification.
3786 This directory must be in
3790 for more information.
3791 These are also used when building the server certificate chain.
3793 The certificate to use: most server's cipher suites require the use of a
3794 certificate and some require a certificate with a certain public key type.
3795 For example, the DSS cipher suites require a certificate containing a DSS
3797 If not specified, the file
3800 .It Fl cipher Ar cipherlist
3801 Modify the cipher list used by the server.
3802 This allows the cipher list used by the server to be modified.
3803 When the client sends a list of supported ciphers, the first client cipher
3804 also included in the server list is used.
3805 Because the client specifies the preference order, the order of the server
3806 cipherlist is irrelevant.
3809 command for more information.
3810 .It Fl context Ar id
3811 Set the SSL context ID.
3812 It can be given any string value.
3813 .It Fl crl_check , crl_check_all
3814 Check the peer certificate has not been revoked by its CA.
3815 The CRLs are appended to the certificate file.
3817 checks all CRLs of all CAs in the chain.
3819 Translate a line feed from the terminal into CR+LF.
3820 .It Fl dcert Ar file , Fl dkey Ar file
3821 Specify an additional certificate and private key; these behave in the
3826 options except there is no default if they are not specified
3827 (no additional certificate or key is used).
3828 By using RSA and DSS certificates and keys,
3829 a server can support clients which only support RSA or DSS cipher suites
3830 by using an appropriate certificate.
3832 Print extensive debugging information, including a hex dump of all traffic.
3833 .It Fl dhparam Ar file
3834 The DH parameter file to use.
3835 The ephemeral DH cipher suites generate keys
3836 using a set of DH parameters.
3837 If not specified, an attempt is made to
3838 load the parameters from the server certificate file.
3839 If this fails, a static set of parameters hard coded into the
3841 program will be used.
3843 Enables a further workaround for some early Netscape SSL code.
3845 Emulate a simple web server.
3846 Pages are resolved relative to the current directory.
3847 For example if the URL
3848 .Pa https://myhost/page.html
3849 is requested, the file
3852 The files loaded are assumed to contain a complete and correct HTTP
3853 response (lines that are part of the HTTP response line and headers
3854 must end with CRLF).
3855 .It Fl id_prefix Ar arg
3856 Generate SSL/TLS session IDs prefixed by
3858 This is mostly useful for testing any SSL/TLS code
3859 that wish to deal with multiple servers,
3860 when each of which might be generating a unique range of session IDs.
3861 .It Fl key Ar keyfile
3862 The private key to use.
3863 If not specified, the certificate file will be used.
3865 Show all protocol messages with hex dump.
3867 Turn on non-blocking I/O.
3869 Test non-blocking I/O.
3871 Disable ephemeral DH cipher suites.
3872 .It Fl no_tls1 | no_tls1_1 | no_tls1_2
3873 Disable the use of TLS1.0, 1.1, and 1.2, respectively.
3875 Disable temporary RSA key generation.
3877 Do not use a certificate.
3878 This restricts the cipher suites available to the anonymous ones
3879 (currently just anonymous DH).
3883 when using a PSK cipher suite.
3884 The key is given as a hexadecimal number without the leading 0x,
3885 for example -psk 1a2b3c4d.
3886 .It Fl psk_hint Ar hint
3887 Use the PSK identity hint
3889 when using a PSK cipher suite.
3891 Inhibit printing of session and certificate information.
3893 Use server's cipher preferences.
3895 Print the SSL session states.
3896 .It Fl tls1 | tls1_1 | tls1_2
3897 Permit only TLS1.0, 1.1, or 1.2, respectively.
3899 Emulate a simple web server.
3900 Pages are resolved relative to the current directory.
3901 For example if the URL
3902 .Pa https://myhost/page.html
3903 is requested, the file
3907 Send a status message to the client when it connects,
3908 including information about the ciphers used and various session parameters.
3909 The output is in HTML format so this option will normally be used with a
3911 .It Fl Verify Ar depth , Fl verify Ar depth
3912 Request a certificate chain from the client,
3913 with a maximum length of
3917 the client must supply a certificate or an error occurs;
3920 a certificate is requested but the client does not have to send one.
3924 .Nm "openssl s_time"
3926 .Op Fl CAfile Ar file
3927 .Op Fl CApath Ar directory
3929 .Op Fl cipher Ar cipherlist
3930 .Op Fl connect Ar host Ns Op : Ns Ar port
3931 .Op Fl key Ar keyfile
3936 .Op Fl time Ar seconds
3937 .Op Fl verify Ar depth
3943 command implements a generic SSL/TLS client which connects to a
3944 remote host using SSL/TLS.
3945 It can request a page from the server and includes
3946 the time to transfer the payload data in its timing measurements.
3947 It measures the number of connections within a given timeframe,
3948 the amount of data transferred
3950 and calculates the average time spent for one connection.
3952 The options are as follows:
3955 Enable various workarounds for buggy implementations.
3956 .It Fl CAfile Ar file
3959 containing trusted certificates to use during server authentication
3960 and to use when attempting to build the client certificate chain.
3961 .It Fl CApath Ar directory
3962 The directory to use for server certificate verification.
3963 This directory must be in
3967 for more information.
3968 These are also used when building the client certificate chain.
3970 The certificate to use, if one is requested by the server.
3971 The default is not to use a certificate.
3972 .It Fl cipher Ar cipherlist
3973 Modify the cipher list sent by the client.
3974 Although the server determines which cipher suite is used,
3975 it should take the first supported cipher in the list sent by the client.
3978 command for more information.
3979 .It Fl connect Ar host Ns Op : Ns Ar port
3980 The host and port to connect to.
3981 .It Fl key Ar keyfile
3982 The private key to use.
3983 If not specified, the certificate file will be used.
3985 Turn on non-blocking I/O.
3987 Perform the timing test using a new session ID for each connection.
3993 they are both on by default and executed in sequence.
3995 Shut down the connection without sending a
3997 shutdown alert to the server.
3999 Perform the timing test using the same session ID for each connection.
4005 they are both on by default and executed in sequence.
4006 .It Fl time Ar seconds
4009 benchmarks to the number of
4011 The default is 30 seconds.
4012 .It Fl verify Ar depth
4013 Turn on server certificate verification,
4014 with a maximum length of
4016 Currently the verify operation continues after errors, so all the problems
4017 with a certificate chain can be seen.
4019 the connection will never fail due to a server certificate verify failure.
4021 The page to GET from the server.
4024 gets the index.htm[l] page.
4025 If this parameter is not specified,
4027 will only perform the handshake to establish SSL connections
4028 but not transfer any payload data.
4032 .Nm "openssl sess_id"
4034 .Op Fl context Ar ID
4036 .Op Fl inform Cm der | pem
4039 .Op Fl outform Cm der | pem
4045 program processes the encoded version of the SSL session structure and
4046 optionally prints out SSL session details
4047 (for example the SSL session master key)
4048 in human-readable format.
4050 The options are as follows:
4053 If a certificate is present in the session,
4054 it will be output using this option;
4057 option is also present, then it will be printed out in text form.
4058 .It Fl context Ar ID
4061 The ID can be any string of characters.
4063 The input file to read from,
4064 or standard input if not specified.
4065 .It Fl inform Cm der | pem
4068 uses an ASN.1 DER-encoded format containing session details.
4069 The precise format can vary from one version to the next.
4071 is the default format: it consists of the DER
4072 format base64-encoded with additional header and footer lines.
4074 Do not output the encoded version of the session.
4076 The output file to write to,
4077 or standard output if not specified.
4078 .It Fl outform Cm der | pem
4081 Print the various public or private key components in plain text,
4082 in addition to the encoded version.
4087 is composed as follows:
4089 .Bl -tag -width "Verify return code " -offset 3n -compact
4091 The protocol in use.
4093 The actual raw SSL or TLS cipher code.
4095 The SSL session ID, in hex format.
4097 The session ID context, in hex format.
4099 The SSL session master key.
4101 The key argument; this is only used in SSL v2.
4103 The session start time.
4107 The timeout, in seconds.
4108 .It Verify return code
4109 The return code when a certificate is verified.
4112 Since the SSL session output contains the master key, it is possible to read
4113 the contents of an encrypted session using this information.
4114 Therefore appropriate security precautions
4115 should be taken if the information is being output by a
4118 This is, however, strongly discouraged and should only be used for
4124 .Fl aes128 | aes192 | aes256 | des |
4125 .Fl des3 | rc2-40 | rc2-64 | rc2-128
4128 .Op Fl CAfile Ar file
4129 .Op Fl CApath Ar directory
4130 .Op Fl certfile Ar file
4132 .Op Fl content Ar file
4134 .Op Fl crl_check_all
4139 .Op Fl ignore_critical
4142 .Op Fl inform Cm der | pem | smime
4143 .Op Fl inkey Ar file
4144 .Op Fl issuer_checks
4145 .Op Fl keyform Cm pem
4156 .Op Fl outform Cm der | pem | smime
4157 .Op Fl passin Ar arg
4160 .Op Fl recip Ar file
4163 .Op Fl signer Ar file
4175 command handles S/MIME mail.
4176 It can encrypt, decrypt, sign, and verify S/MIME messages.
4178 The MIME message must be sent without any blank lines between the
4179 headers and the output.
4180 Some mail programs will automatically add a blank line.
4181 Piping the mail directly to an MTA is one way to
4182 achieve the correct format.
4184 The supplied message to be signed or encrypted must include the necessary
4185 MIME headers or many S/MIME clients won't display it properly (if at all).
4188 option to automatically add plain text headers.
4191 .Qq signed and encrypted
4192 message is one where a signed message is then encrypted.
4193 This can be produced by encrypting an already signed message.
4195 There are a number of operations that can be performed, as follows:
4196 .Bl -tag -width "XXXX"
4198 Decrypt mail using the supplied certificate and private key.
4199 The input file is an encrypted mail message in MIME format.
4200 The decrypted mail is written to the output file.
4202 Encrypt mail for the given recipient certificates.
4203 The input is the message to be encrypted.
4204 The output file is the encrypted mail, in MIME format.
4206 Take an input message and write out a PEM-encoded PKCS#7 structure.
4208 Resign a message: take an existing message and one or more new signers.
4210 Sign mail using the supplied certificate and private key.
4211 The input file is the message to be signed.
4212 The signed message, in MIME format, is written to the output file.
4215 The input is a signed mail message and the output is the signed data.
4216 Both clear text and opaque signing is supported.
4219 The remaining options are as follows:
4220 .Bl -tag -width "XXXX"
4222 .Fl aes128 | aes192 | aes256 | des |
4223 .Fl des3 | rc2-40 | rc2-64 | rc2-128
4225 The encryption algorithm to use.
4226 128-, 192-, or 256-bit AES, DES (56 bits), triple DES (168 bits),
4227 or 40-, 64-, or 128-bit RC2, respectively;
4228 if not specified, 40-bit RC2 is
4233 Normally, the input message is converted to
4235 format which uses CR/LF as end of line,
4236 as required by the S/MIME specification.
4237 When this option is present no translation occurs.
4238 This is useful when handling binary data which may not be in MIME format.
4239 .It Fl CAfile Ar file
4242 containing trusted CA certificates; only used with
4244 .It Fl CApath Ar directory
4247 containing trusted CA certificates; only used with
4249 This directory must be a standard certificate directory:
4250 that is, a hash of each subject name (using
4252 should be linked to each certificate.
4254 One or more certificates of message recipients: used when encrypting
4256 .It Fl certfile Ar file
4257 Allows additional certificates to be specified.
4258 When signing, these will be included with the message.
4259 When verifying, these will be searched for the signers' certificates.
4260 The certificates should be in PEM format.
4266 .Fl ignore_critical ,
4271 Set various certificate chain validation options.
4274 command for details.
4275 .It Fl content Ar file
4276 A file containing the detached content.
4277 This is only useful with the
4280 and only usable if the PKCS#7 structure is using the detached
4281 signature form where the content is not included.
4282 This option will override any content if the input format is S/MIME
4283 and it uses the multipart/signed MIME content type.
4289 The relevant mail headers.
4290 These are included outside the signed
4291 portion of a message so they may be included manually.
4292 When signing, many S/MIME
4293 mail clients check that the signer's certificate email
4294 address matches the From: address.
4296 The input file to read from.
4298 Enable streaming I/O for encoding operations.
4299 This permits single pass processing of data without
4300 the need to hold the entire contents in memory,
4301 potentially supporting very large files.
4302 Streaming is automatically set for S/MIME signing with detached
4303 data if the output format is SMIME;
4304 it is currently off by default for all other operations.
4305 .It Fl inform Cm der | pem | smime
4307 .It Fl inkey Ar file
4308 The private key to use when signing or decrypting,
4309 which must match the corresponding certificate.
4310 If this option is not specified, the private key must be included
4311 in the certificate file specified with
4318 this option can be used multiple times to specify successive keys.
4319 .It Fl keyform Cm pem
4320 Input private key format.
4322 The digest algorithm to use when signing or resigning.
4323 If not present then the default digest algorithm for the signing key is used
4326 Do not include attributes.
4328 Do not include the signer's certificate.
4329 This will reduce the size of the signed message but the verifier must
4330 have a copy of the signer's certificate available locally (passed using the
4332 option, for example).
4334 Do not do chain verification of signers' certificates: that is,
4335 don't use the certificates in the signed message as untrusted CAs.
4337 When signing a message use opaque signing: this form is more resistant
4338 to translation by mail relays but it cannot be read by mail agents that
4339 do not support S/MIME.
4340 Without this option cleartext signing with the MIME type
4341 multipart/signed is used.
4343 Disable streaming I/O where it would produce an encoding of indefinite length
4344 (currently has no effect).
4346 Only use certificates specified in the
4348 The supplied certificates can still be used as untrusted CAs.
4350 Do not try to verify the signatures on the message.
4352 Do not verify the signer's certificate of a signed message.
4354 The output file to write to.
4355 .It Fl outform Cm der | pem | smime
4357 The default is smime, which writes an S/MIME format message.
4361 change this to write PEM and DER format PKCS#7 structures instead.
4362 This currently only affects the output format of the PKCS#7
4363 structure; if no PKCS#7 structure is being output (for example with
4367 this option has no effect.
4368 .It Fl passin Ar arg
4369 The key password source.
4370 .It Fl recip Ar file
4371 The recipients certificate when decrypting a message.
4373 must match one of the recipients of the message or an error occurs.
4374 .It Fl signer Ar file
4375 A signing certificate when signing or resigning a message;
4376 this option can be used multiple times if more than one signer is required.
4377 If a message is being verified, the signer's certificates will be
4378 written to this file if the verification was successful.
4383 Add plain text (text/plain) MIME
4384 headers to the supplied message if encrypting or signing.
4385 If decrypting or verifying, it strips off text headers:
4386 if the decrypted or verified message is not of MIME type text/plain
4387 then an error occurs.
4394 .Bl -tag -width "XXXX" -offset 3n -compact
4396 The operation was completely successful.
4398 An error occurred parsing the command options.
4400 One of the input files could not be read.
4402 An error occurred creating the file or when reading the message.
4404 An error occurred decrypting or verifying the message.
4406 An error occurred writing certificates.
4414 .Op Fl evp Ar algorithm
4416 .Op Fl multi Ar number
4421 command is used to test the performance of cryptographic algorithms.
4422 .Bl -tag -width "XXXX"
4424 Perform the test using
4426 The default is to test all algorithms.
4428 Time decryption instead of encryption;
4432 Measure time in real time instead of CPU user time.
4433 .It Fl evp Ar algorithm
4434 Perform the test using one of the algorithms accepted by
4435 .Xr EVP_get_cipherbyname 3 .
4437 Produce machine readable output.
4438 .It Fl multi Ar number
4441 benchmarks in parallel.
4446 .Op Fl challenge Ar string
4448 .Op Fl key Ar keyfile
4451 .Op Fl passin Ar arg
4453 .Op Fl spkac Ar spkacname
4454 .Op Fl spksect Ar section
4460 command processes signed public key and challenge (SPKAC) files.
4461 It can print out their contents, verify the signature,
4462 and produce its own SPKACs from a supplied private key.
4464 The options are as follows:
4466 .It Fl challenge Ar string
4467 The challenge string, if an SPKAC is being created.
4469 The input file to read from,
4470 or standard input if not specified.
4474 .It Fl key Ar keyfile
4475 Create an SPKAC file using the private key in
4478 .Fl in , noout , spksect ,
4481 options are ignored, if present.
4483 Do not output the text version of the SPKAC.
4485 The output file to write to,
4486 or standard output if not specified.
4487 .It Fl passin Ar arg
4488 The key password source.
4490 Output the public key of an SPKAC.
4491 .It Fl spkac Ar spkacname
4492 An alternative name for the variable containing the SPKAC.
4493 The default is "SPKAC".
4494 This option affects both generated and input SPKAC files.
4495 .It Fl spksect Ar section
4496 An alternative name for the
4498 containing the SPKAC.
4500 Verify the digital signature on the supplied SPKAC.
4506 .Op Fl md4 | md5 | ripemd160 | sha1
4508 .Op Fl config Ar configfile
4509 .Op Fl data Ar file_to_hash
4510 .Op Fl digest Ar digest_bytes
4511 .Op Fl in Ar request.tsq
4513 .Op Fl out Ar request.tsq
4514 .Op Fl policy Ar object_id
4521 .Op Fl chain Ar certs_file.pem
4522 .Op Fl config Ar configfile
4523 .Op Fl in Ar response.tsr
4524 .Op Fl inkey Ar private.pem
4525 .Op Fl out Ar response.tsr
4526 .Op Fl passin Ar arg
4527 .Op Fl policy Ar object_id
4528 .Op Fl queryfile Ar request.tsq
4529 .Op Fl section Ar tsa_section
4530 .Op Fl signer Ar tsa_cert.pem
4539 .Op Fl CAfile Ar trusted_certs.pem
4540 .Op Fl CApath Ar trusted_cert_path
4541 .Op Fl data Ar file_to_hash
4542 .Op Fl digest Ar digest_bytes
4543 .Op Fl in Ar response.tsr
4544 .Op Fl queryfile Ar request.tsq
4546 .Op Fl untrusted Ar cert_file.pem
4551 command is a basic Time Stamping Authority (TSA) client and server
4552 application as specified in RFC 3161 (Time-Stamp Protocol, TSP).
4553 A TSA can be part of a PKI deployment and its role is to provide long
4554 term proof of the existence of specific data.
4555 Here is a brief description of the protocol:
4558 The TSA client computes a one-way hash value for a data file and sends
4559 the hash to the TSA.
4561 The TSA attaches the current date and time to the received hash value,
4562 signs them and sends the time stamp token back to the client.
4563 By creating this token the TSA certifies the existence of the original
4564 data file at the time of response generation.
4566 The TSA client receives the time stamp token and verifies the
4568 It also checks if the token contains the same hash
4569 value that it had sent to the TSA.
4572 There is one DER-encoded protocol data unit defined for transporting a time
4573 stamp request to the TSA and one for sending the time stamp response
4577 command has three main functions:
4578 creating a time stamp request based on a data file;
4579 creating a time stamp response based on a request;
4580 and verifying if a response corresponds
4581 to a particular request or a data file.
4583 There is no support for sending the requests/responses automatically
4584 over HTTP or TCP yet as suggested in RFC 3161.
4585 Users must send the requests either by FTP or email.
4589 switch can be used for creating and printing a time stamp
4590 request with the following options:
4593 Expect the TSA to include its signing certificate in the response.
4594 .It Fl config Ar configfile
4595 Specify an alternative configuration file.
4596 Only the OID section is used.
4597 .It Fl data Ar file_to_hash
4598 The data file for which the time stamp request needs to be created.
4599 The default is standard input.
4600 .It Fl digest Ar digest_bytes
4601 Specify the message imprint explicitly without the data file.
4602 The imprint must be specified in a hexadecimal format,
4603 two characters per byte,
4604 the bytes optionally separated by colons.
4605 The number of bytes must match the message digest algorithm in use.
4606 .It Fl in Ar request.tsq
4607 A previously created time stamp request in DER
4608 format that will be printed into the output file.
4609 Useful for examining the content of a request in human-readable format.
4610 .It Fl md4 | md5 | ripemd160 | sha | sha1
4611 The message digest to apply to the data file.
4612 It supports all the message digest algorithms that are supported by the
4615 The default is SHA-1.
4617 Specify no nonce in the request.
4618 The default, to include a 64-bit long pseudo-random nonce,
4619 is recommended to protect against replay attacks.
4620 .It Fl out Ar request.tsq
4621 The output file to write to,
4622 or standard output if not specified.
4623 .It Fl policy Ar object_id
4624 The policy that the client expects the TSA to use for creating the
4626 Either dotted OID notation or OID names defined
4627 in the config file can be used.
4628 If no policy is requested the TSA uses its own default policy.
4630 Output in human-readable text format instead of DER.
4633 A time stamp response (TimeStampResp) consists of a response status
4634 and the time stamp token itself (ContentInfo),
4635 if the token generation was successful.
4638 command is for creating a time stamp
4639 response or time stamp token based on a request and printing the
4640 response/token in human-readable format.
4643 is not specified the output is always a time stamp response (TimeStampResp),
4644 otherwise it is a time stamp token (ContentInfo).
4646 .It Fl chain Ar certs_file.pem
4647 The collection of PEM certificates
4648 that will be included in the response
4649 in addition to the signer certificate if the
4651 option was used for the request.
4652 This file is supposed to contain the certificate chain
4653 for the signer certificate from its issuer upwards.
4656 command does not build a certificate chain automatically.
4657 .It Fl config Ar configfile
4658 Specify an alternative configuration file.
4659 .It Fl in Ar response.tsr
4660 Specify a previously created time stamp response (or time stamp token, if
4663 in DER format that will be written to the output file.
4664 This option does not require a request;
4665 it is useful, for example,
4666 to examine the content of a response or token
4667 or to extract the time stamp token from a response.
4668 If the input is a token and the output is a time stamp response a default
4670 status info is added to the token.
4671 .It Fl inkey Ar private.pem
4672 The signer private key of the TSA in PEM format.
4676 .It Fl out Ar response.tsr
4677 The response is written to this file.
4678 The format and content of the file depends on other options (see
4682 The default is stdout.
4683 .It Fl passin Ar arg
4684 The key password source.
4685 .It Fl policy Ar object_id
4686 The default policy to use for the response.
4687 Either dotted OID notation or OID names defined
4688 in the config file can be used.
4689 If no policy is requested the TSA uses its own default policy.
4690 .It Fl queryfile Ar request.tsq
4691 The file containing a DER-encoded time stamp request.
4692 .It Fl section Ar tsa_section
4693 The config file section containing the settings for response generation.
4694 .It Fl signer Ar tsa_cert.pem
4695 The PEM signer certificate of the TSA.
4696 The TSA signing certificate must have exactly one extended key usage
4697 assigned to it: timeStamping.
4698 The extended key usage must also be critical,
4699 otherwise the certificate is going to be refused.
4702 variable of the config file.
4704 Output in human-readable text format instead of DER.
4706 The input is a DER-encoded time stamp token (ContentInfo)
4707 instead of a time stamp response (TimeStampResp).
4709 The output is a time stamp token (ContentInfo)
4710 instead of a time stamp response (TimeStampResp).
4715 command is for verifying if a time stamp response or time stamp token
4716 is valid and matches a particular time stamp request or data file.
4719 command does not use the configuration file.
4721 .It Fl CAfile Ar trusted_certs.pem
4722 The file containing a set of trusted self-signed PEM CA certificates.
4725 for additional details.
4726 Either this option or
4729 .It Fl CApath Ar trusted_cert_path
4730 The directory containing the trused CA certificates of the client.
4733 for additional details.
4734 Either this option or
4737 .It Fl data Ar file_to_hash
4738 The response or token must be verified against
4740 The file is hashed with the message digest algorithm specified in the token.
4745 options must not be specified with this one.
4746 .It Fl digest Ar digest_bytes
4747 The response or token must be verified against the message digest specified
4749 The number of bytes must match the message digest algorithm
4750 specified in the token.
4755 options must not be specified with this one.
4756 .It Fl in Ar response.tsr
4757 The time stamp response that needs to be verified, in DER format.
4758 This option in mandatory.
4759 .It Fl queryfile Ar request.tsq
4760 The original time stamp request, in DER format.
4765 options must not be specified with this one.
4767 The input is a DER-encoded time stamp token (ContentInfo)
4768 instead of a time stamp response (TimeStampResp).
4769 .It Fl untrusted Ar cert_file.pem
4770 Additional untrusted PEM certificates which may be needed
4771 when building the certificate chain for the TSA's signing certificate.
4772 This file must contain the TSA signing certificate and
4773 all intermediate CA certificates unless the response includes them.
4776 Options specified on the command line always override
4777 the settings in the config file:
4779 .It Cm tsa Ar section , Cm default_tsa
4780 This is the main section and it specifies the name of another section
4781 that contains all the options for the
4784 This section can be overridden with the
4786 command line switch.
4796 The file containing the hexadecimal serial number of the
4797 last time stamp response created.
4798 This number is incremented by 1 for each response.
4799 If the file does not exist at the time of response generation
4800 a new file is created with serial number 1.
4801 This parameter is mandatory.
4803 TSA signing certificate, in PEM format.
4806 command line option.
4808 A set of PEM-encoded certificates that need to be
4809 included in the response.
4812 command line option.
4814 The private key of the TSA, in PEM format.
4817 command line option.
4818 .It Cm default_policy
4819 The default policy to use when the request does not mandate any policy.
4822 command line option.
4823 .It Cm other_policies
4824 Comma separated list of policies that are also acceptable by the TSA
4825 and used only if the request explicitly specifies one of them.
4827 The list of message digest algorithms that the TSA accepts.
4828 At least one algorithm must be specified.
4829 This parameter is mandatory.
4831 The accuracy of the time source of the TSA in seconds, milliseconds
4833 For example, secs:1, millisecs:500, microsecs:100.
4834 If any of the components is missing,
4835 zero is assumed for that field.
4836 .It Cm clock_precision_digits
4837 The maximum number of digits, which represent the fraction of seconds,
4838 that need to be included in the time field.
4839 The trailing zeroes must be removed from the time,
4840 so there might actually be fewer digits
4841 or no fraction of seconds at all.
4842 The maximum value is 6;
4845 If this option is yes,
4846 the responses generated by this TSA can always be ordered,
4847 even if the time difference between two responses is less
4848 than the sum of their accuracies.
4851 Set this option to yes if the subject name of the TSA must be included in
4852 the TSA name field of the response.
4854 .It Cm ess_cert_id_chain
4855 The SignedData objects created by the TSA always contain the
4856 certificate identifier of the signing certificate in a signed
4857 attribute (see RFC 2634, Enhanced Security Services).
4858 If this option is set to yes and either the
4862 option is specified then the certificate identifiers of the chain will also
4863 be included in the SigningCertificate signed attribute.
4864 If this variable is set to no,
4865 only the signing certificate identifier is included.
4870 .Nm "openssl verify"
4871 .Op Fl CAfile Ar file
4872 .Op Fl CApath Ar directory
4875 .Op Fl crl_check_all
4876 .Op Fl explicit_policy
4879 .Op Fl ignore_critical
4882 .Op Fl issuer_checks
4884 .Op Fl purpose Ar purpose
4885 .Op Fl untrusted Ar file
4893 command verifies certificate chains.
4895 The options are as follows:
4898 Verify the signature on the self-signed root CA.
4899 This is disabled by default
4900 because it doesn't add any security.
4901 .It Fl CAfile Ar file
4904 of trusted certificates.
4907 should contain multiple certificates in PEM format, concatenated together.
4908 .It Fl CApath Ar directory
4911 of trusted certificates.
4912 The certificates, or symbolic links to them,
4913 should have names of the form
4917 is the hashed certificate subject name
4924 Check end entity certificate validity by attempting to look up a valid CRL.
4925 If a valid CRL cannot be found an error occurs.
4926 .It Fl crl_check_all
4927 Check the validity of all certificates in the chain by attempting
4928 to look up valid CRLs.
4929 .It Fl explicit_policy
4930 Set policy variable require-explicit-policy (RFC 3280).
4932 Enable extended CRL features such as indirect CRLs and alternate CRL
4935 Print a usage message.
4936 .It Fl ignore_critical
4937 Ignore critical extensions instead of rejecting the certificate.
4939 Set policy variable inhibit-any-policy (RFC 3280).
4941 Set policy variable inhibit-policy-mapping (RFC 3280).
4942 .It Fl issuer_checks
4943 Print diagnostics relating to searches for the issuer certificate
4944 of the current certificate
4945 showing why each candidate issuer certificate was rejected.
4946 The presence of rejection messages
4947 does not itself imply that anything is wrong:
4948 during the normal verify process several rejections may take place.
4950 Enable certificate policy processing.
4951 .It Fl purpose Ar purpose
4952 The intended use for the certificate.
4953 Without this option no chain verification will be done.
4954 Currently accepted uses are
4955 .Cm sslclient , sslserver ,
4956 .Cm nssslserver , smimesign ,
4957 .Cm smimeencrypt , crlsign ,
4961 .It Fl untrusted Ar file
4964 of untrusted certificates.
4967 should contain multiple certificates.
4969 Print extra information about the operations being performed.
4971 Disable workarounds for broken certificates which have to be disabled
4972 for strict X.509 compliance.
4977 If no certificate files are included, an attempt is made to read
4978 a certificate from standard input.
4979 If the first certificate filename begins with a dash,
4980 use a lone dash to mark the last option.
4985 program uses the same functions as the internal SSL and S/MIME verification,
4986 with one crucial difference:
4987 wherever possible an attempt is made to continue after an error,
4988 whereas normally the verify operation would halt on the first error.
4989 This allows all the problems with a certificate chain to be determined.
4991 The verify operation consists of a number of separate steps.
4992 Firstly a certificate chain is built up starting from the supplied certificate
4993 and ending in the root CA.
4994 It is an error if the whole chain cannot be built up.
4995 The chain is built up by looking up the issuer's certificate of the current
4997 If a certificate is found which is its own issuer, it is assumed
5000 All certificates whose subject name matches the issuer name
5001 of the current certificate are subject to further tests.
5002 The relevant authority key identifier components of the current certificate
5003 (if present) must match the subject key identifier (if present)
5004 and issuer and serial number of the candidate issuer;
5007 extension of the candidate issuer (if present) must permit certificate signing.
5009 The lookup first looks in the list of untrusted certificates and if no match
5010 is found the remaining lookups are from the trusted certificates.
5011 The root CA is always looked up in the trusted certificate list:
5012 if the certificate to verify is a root certificate,
5013 then an exact match must be found in the trusted list.
5015 The second operation is to check every untrusted certificate's extensions for
5016 consistency with the supplied purpose.
5019 option is not included, then no checks are done.
5022 certificate must have extensions compatible with the supplied purpose
5023 and all other certificates must also be valid CA certificates.
5024 The precise extensions required are described in more detail in
5029 The third operation is to check the trust settings on the root CA.
5030 The root CA should be trusted for the supplied purpose.
5031 A certificate with no trust settings is considered to be valid for
5034 The final operation is to check the validity of the certificate chain.
5035 The validity period is checked against the current system time and the
5039 dates in the certificate.
5040 The certificate signatures are also checked at this point.
5042 If all operations complete successfully, the certificate is considered
5044 If any operation fails then the certificate is not valid.
5045 When a verify operation fails, the output messages can be somewhat cryptic.
5046 The general form of the error message is:
5048 server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024-bit)
5049 error 24 at 1 depth lookup:invalid CA certificate
5052 The first line contains the name of the certificate being verified, followed by
5053 the subject name of the certificate.
5054 The second line contains the error number and the depth.
5055 The depth is the number of the certificate being verified when a
5056 problem was detected starting with zero for the certificate being verified
5057 itself, then 1 for the CA that signed the certificate and so on.
5058 Finally a text version of the error number is presented.
5060 An exhaustive list of the error codes and messages is shown below; this also
5061 includes the name of the error code as defined in the header file
5062 .In openssl/x509_vfy.h .
5063 Some of the error codes are defined but never returned: these are described as
5065 .Bl -tag -width "XXXX"
5067 The operation was successful.
5068 .It 2 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT
5069 The issuer certificate of an untrusted certificate could not be found.
5070 .It 3 X509_V_ERR_UNABLE_TO_GET_CRL
5071 The CRL of a certificate could not be found.
5072 .It 4 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE
5073 The certificate signature could not be decrypted.
5074 This means that the actual signature value could not be determined
5075 rather than it not matching the expected value.
5076 This is only meaningful for RSA keys.
5077 .It 5 X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE
5078 The CRL signature could not be decrypted.
5079 This means that the actual signature value could not be determined
5080 rather than it not matching the expected value.
5082 .It 6 X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY
5083 The public key in the certificate
5084 .Cm SubjectPublicKeyInfo
5086 .It 7 X509_V_ERR_CERT_SIGNATURE_FAILURE
5087 The signature of the certificate is invalid.
5088 .It 8 X509_V_ERR_CRL_SIGNATURE_FAILURE
5089 The signature of the certificate is invalid.
5090 .It 9 X509_V_ERR_CERT_NOT_YET_VALID
5091 The certificate is not yet valid: the
5093 date is after the current time.
5094 .It 10 X509_V_ERR_CERT_HAS_EXPIRED
5095 The certificate has expired; that is, the
5097 date is before the current time.
5098 .It 11 X509_V_ERR_CRL_NOT_YET_VALID
5099 The CRL is not yet valid.
5100 .It 12 X509_V_ERR_CRL_HAS_EXPIRED
5101 The CRL has expired.
5102 .It 13 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD
5105 field contains an invalid time.
5106 .It 14 X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD
5109 field contains an invalid time.
5110 .It 15 X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD
5113 field contains an invalid time.
5114 .It 16 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD
5117 field contains an invalid time.
5118 .It 17 X509_V_ERR_OUT_OF_MEM
5119 An error occurred trying to allocate memory.
5120 This should never happen.
5121 .It 18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
5122 The passed certificate is self-signed and the same certificate cannot be
5123 found in the list of trusted certificates.
5124 .It 19 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN
5125 The certificate chain could be built up using the untrusted certificates but
5126 the root could not be found locally.
5127 .It 20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY
5128 The issuer certificate of a locally looked up certificate could not be found.
5129 This normally means the list of trusted certificates is not complete.
5130 .It 21 X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE
5131 No signatures could be verified because the chain contains only one
5132 certificate and it is not self-signed.
5133 .It 22 X509_V_ERR_CERT_CHAIN_TOO_LONG
5134 The certificate chain length is greater than the supplied maximum depth.
5136 .It 23 X509_V_ERR_CERT_REVOKED
5137 The certificate has been revoked.
5138 .It 24 X509_V_ERR_INVALID_CA
5139 A CA certificate is invalid.
5140 Either it is not a CA or its extensions are not consistent
5141 with the supplied purpose.
5142 .It 25 X509_V_ERR_PATH_LENGTH_EXCEEDED
5144 .Cm basicConstraints
5145 pathlength parameter has been exceeded.
5146 .It 26 X509_V_ERR_INVALID_PURPOSE
5147 The supplied certificate cannot be used for the specified purpose.
5148 .It 27 X509_V_ERR_CERT_UNTRUSTED
5149 The root CA is not marked as trusted for the specified purpose.
5150 .It 28 X509_V_ERR_CERT_REJECTED
5151 The root CA is marked to reject the specified purpose.
5152 .It 29 X509_V_ERR_SUBJECT_ISSUER_MISMATCH
5153 The current candidate issuer certificate was rejected because its subject name
5154 did not match the issuer name of the current certificate.
5155 Only displayed when the
5158 .It 30 X509_V_ERR_AKID_SKID_MISMATCH
5159 The current candidate issuer certificate was rejected because its subject key
5160 identifier was present and did not match the authority key identifier current
5162 Only displayed when the
5165 .It 31 X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH
5166 The current candidate issuer certificate was rejected because its issuer name
5167 and serial number were present and did not match the authority key identifier
5168 of the current certificate.
5169 Only displayed when the
5172 .It 32 X509_V_ERR_KEYUSAGE_NO_CERTSIGN
5173 The current candidate issuer certificate was rejected because its
5175 extension does not permit certificate signing.
5176 .It 50 X509_V_ERR_APPLICATION_VERIFICATION
5177 An application specific error.
5186 command is used to print out version information about
5189 The options are as follows:
5192 All information: this is the same as setting all the other flags.
5194 The date the current version of
5203 Option information: various options set when the library was built.
5215 .Op Fl addreject Ar arg
5216 .Op Fl addtrust Ar arg
5219 .Op Fl CAcreateserial
5220 .Op Fl CAform Cm der | pem
5221 .Op Fl CAkey Ar file
5222 .Op Fl CAkeyform Cm der | pem
5223 .Op Fl CAserial Ar file
5224 .Op Fl certopt Ar option
5225 .Op Fl checkend Ar arg
5233 .Op Fl extensions Ar section
5234 .Op Fl extfile Ar file
5238 .Op Fl inform Cm der | net | pem
5241 .Op Fl issuer_hash_old
5242 .Op Fl keyform Cm der | pem
5245 .Op Fl nameopt Ar option
5250 .Op Fl outform Cm der | net | pem
5251 .Op Fl passin Ar arg
5256 .Op Fl set_serial Ar n
5257 .Op Fl setalias Ar arg
5258 .Op Fl signkey Ar file
5262 .Op Fl subject_hash_old
5270 command is a multi-purpose certificate utility.
5271 It can be used to display certificate information, convert certificates to
5272 various forms, sign certificate requests like a
5274 or edit certificate trust settings.
5276 The following are x509 input, output, and general purpose options:
5277 .Bl -tag -width "XXXX"
5279 The input file to read from,
5280 or standard input if not specified.
5281 .It Fl inform Cm der | net | pem
5283 Normally, the command will expect an X.509 certificate,
5284 but this can change if other options such as
5289 This affects any signing or display option that uses a message digest,
5291 .Fl fingerprint , signkey ,
5295 If not specified, MD5 is used.
5296 SHA1 is always used with DSA keys.
5298 The output file to write to,
5299 or standard output if none is specified.
5300 .It Fl outform Cm der | net | pem
5302 .It Fl passin Ar arg
5303 The key password source.
5306 The following are x509 display options:
5307 .Bl -tag -width "XXXX"
5309 Output the certificate in the form of a C source file.
5310 .It Fl certopt Ar option
5311 Customise the output format used with
5313 either using a list of comma-separated options or by specifying
5316 The default behaviour is to print all fields.
5317 The options are as follows:
5319 .Bl -tag -width "no_extensions" -offset indent -compact
5322 .Cm no_issuer , no_pubkey , no_header ,
5323 .Cm no_version , no_sigdump ,
5327 Equivalent to no output options at all.
5329 Print unsupported certificate extensions.
5331 Hex dump unsupported extensions.
5333 Print an error message for unsupported certificate extensions.
5335 ASN.1 parse unsupported extensions.
5337 Do not print certificate trust information.
5338 .It Cm no_extensions
5339 Do not print X509V3 extensions.
5341 Do not print header (Certificate and Data) information.
5343 Do not print the issuer name.
5345 Do not print the public key.
5347 Do not print the serial number.
5349 Do not give a hexadecimal dump of the certificate signature.
5351 Do not print the signature algorithm used.
5353 Do not print the subject name.
5361 Do not print the version number.
5364 Print the start and expiry date of a certificate.
5366 Output the email addresses, if any.
5368 Print the expiry date of the certificate; that is, the
5372 Print the digest of the DER-encoded version of the whole certificate.
5377 Print the issuer name.
5379 Print the hash of the certificate issuer name.
5380 .It Fl issuer_hash_old
5381 Print the hash of the certificate issuer name
5382 using the older algorithm as used by
5384 versions before 1.0.0.
5386 Print the value of the modulus of the public key contained in the certificate.
5387 .It Fl nameopt Ar option
5388 Customise how the subject or issuer names are displayed,
5389 either using a list of comma-separated options or by specifying
5392 The default behaviour is to use the
5396 which can be preceded by a dash to turn them off,
5398 .Bl -tag -width "XXXX"
5400 Align field values for a more readable output.
5405 equivalent to specifying no options at all.
5407 Reverse the fields of the DN, as required by RFC 2253.
5408 As a side effect, this also reverses the order of multiple AVAs.
5413 it allows the DER encoding of the structure to be unambiguously determined.
5415 Any fields that need to be hexdumped are
5416 dumped using the DER encoding of the field.
5417 Otherwise just the content octets will be displayed.
5418 Both options use the RFC 2253 #XXXX... format.
5420 Dump non-character string types
5421 (for example OCTET STRING);
5422 usually, non-character string types are displayed
5423 as though each content octet represents a single character.
5425 Dump any field whose OID is not recognised by
5430 characters required by RFC 2253 in a field that is
5434 is escaped at the beginning of a string
5435 and a space character at the beginning or end of a string.
5437 Escape control characters.
5438 That is, those with ASCII values less than 0x20 (space)
5439 and the delete (0x7f) character.
5440 They are escaped using the RFC 2253 \eXX notation (where XX are two hex
5441 digits representing the character value).
5443 Escape characters with the MSB set; that is, with ASCII values larger than
5448 .Cm esc_ctrl , esc_msb , sep_multiline ,
5449 .Cm space_eq , lname ,
5453 Do not attempt to interpret multibyte characters.
5454 That is, content octets are merely dumped as though one octet
5455 represents each character.
5456 This is useful for diagnostic purposes
5457 but results in rather odd looking output.
5458 .It Cm nofname , sname , lname , oid
5459 Alter how the field name is displayed:
5461 does not display the field at all;
5463 uses the short name form (CN for
5469 represents the OID in numerical form and is useful for diagnostic purpose.
5471 A one line format which is more readable than
5474 .Cm esc_2253 , esc_ctrl , esc_msb , utf8 ,
5475 .Cm dump_nostr , dump_der , use_quote , sep_comma_plus_spc ,
5480 Displays names compatible with RFC 2253.
5482 .Cm esc_2253 , esc_ctrl ,
5483 .Cm esc_msb , utf8 , dump_nostr , dump_unknown ,
5484 .Cm dump_der , sep_comma_plus , dn_rev ,
5487 .It Cm sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline
5488 Determine the field separators:
5489 the first character is between RDNs and the second between multiple AVAs
5490 (multiple AVAs are very rare and their use is discouraged).
5491 The options ending in
5493 additionally place a space after the separator to make it more readable.
5495 uses a linefeed character for the RDN separator and a spaced
5497 for the AVA separator,
5498 as well as indenting the fields by four characters.
5500 Show the type of the ASN.1 character string.
5501 The type precedes the field contents.
5503 .Qq BMPSTRING: Hello World .
5505 Place spaces round the
5507 character which follows the field name.
5509 Escape some characters by surrounding the whole string with
5512 Without the option, all escaping is done with the
5516 Convert all strings to UTF8 format first, as required by RFC 2253.
5517 On a UTF8 compatible terminal,
5518 the use of this option (and not setting
5520 may result in the correct display of multibyte characters.
5521 Usually, multibyte characters larger than 0xff
5522 are represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX
5524 and any UTF8Strings are converted to their character form first.
5527 Do not output the encoded version of the request.
5529 Print the OCSP responder addresses, if any.
5531 Print OCSP hash values for the subject name and public key.
5533 Print the public key.
5535 Print the certificate serial number.
5537 Print the start date of the certificate; that is, the
5541 Print the subject name.
5543 Print the hash of the certificate subject name.
5546 to form an index to allow certificates in a directory to be looked up
5548 .It Fl subject_hash_old
5549 Print the hash of the certificate subject name
5550 using the older algorithm as used by
5552 versions before 1.0.0.
5554 Print the full certificate in text form.
5557 A trusted certificate is a certificate which has several
5558 additional pieces of information attached to it such as the permitted
5559 and prohibited uses of the certificate and an alias.
5560 When a certificate is being verified at least one certificate must be trusted.
5561 By default, a trusted certificate must be stored locally and be a root CA.
5562 The following are x509 trust settings options:
5563 .Bl -tag -width "XXXX"
5564 .It Fl addreject Ar arg
5565 Add a prohibited use.
5566 Accepts the same values as the
5569 .It Fl addtrust Ar arg
5570 Add a trusted certificate use.
5571 Any object name can be used here, but currently only
5578 (S/MIME email) are used.
5580 Output the certificate alias.
5582 Clear all the prohibited or rejected uses of the certificate.
5584 Clear all the permitted or trusted uses of the certificate.
5586 Perform tests on the certificate extensions.
5587 The same code is used when verifying untrusted certificates in chains,
5588 so this section is useful if a chain is rejected by the verify code.
5591 .Cm basicConstraints
5592 extension CA flag is used to determine whether the
5593 certificate can be used as a CA.
5594 If the CA flag is true, it is a CA;
5595 if the CA flag is false, it is not a CA.
5596 All CAs should have the CA flag set to true.
5599 .Cm basicConstraints
5600 extension is absent, then the certificate is
5601 considered to be a possible CA;
5602 other extensions are checked according to the intended use of the certificate.
5603 A warning is given in this case because the certificate should really not
5604 be regarded as a CA.
5605 However it is allowed to be a CA to work around some broken software.
5607 If the certificate is a V1 certificate
5608 (and thus has no extensions) and it is self-signed,
5609 it is also assumed to be a CA but a warning is again given.
5610 This is to work around the problem of Verisign roots
5611 which are V1 self-signed certificates.
5615 extension is present, then additional restraints are
5616 made on the uses of the certificate.
5617 A CA certificate must have the
5621 extension is present.
5623 The extended key usage extension places additional restrictions on the
5625 If this extension is present, whether critical or not,
5626 the key can only be used for the purposes specified.
5628 A complete description of each test is given below.
5630 .Cm basicConstraints
5633 and V1 certificates above apply to all CA certificates.
5634 .Bl -tag -width "XXXX"
5636 The extended key usage extension must be absent or include the
5637 web client authentication OID.
5639 must be absent or it must have the
5640 .Cm digitalSignature
5642 The Netscape certificate type must be absent
5643 or it must have the SSL client bit set.
5645 The extended key usage extension must be absent or include the
5646 web client authentication OID.
5647 The Netscape certificate type must be absent
5648 or it must have the SSL CA bit set:
5649 this is used as a workaround if the
5650 .Cm basicConstraints
5651 extension is absent.
5653 The extended key usage extension must be absent or include the
5654 web server authentication and/or one of the SGC OIDs.
5656 must be absent or it must have the
5657 .Cm digitalSignature
5660 set, or both bits set.
5661 The Netscape certificate type must be absent or have the SSL server bit set.
5663 The extended key usage extension must be absent or include the
5664 web server authentication and/or one of the SGC OIDs.
5665 The Netscape certificate type must be absent or the SSL CA bit must be set:
5666 this is used as a workaround if the
5667 .Cm basicConstraints
5668 extension is absent.
5669 .It Netscape SSL Server
5670 For Netscape SSL clients to connect to an SSL server; it must have the
5674 extension is present.
5675 This isn't always valid because some cipher suites use the key for
5677 Otherwise it is the same as a normal SSL server.
5678 .It Common S/MIME Client Tests
5679 The extended key usage extension must be absent or include the
5680 email protection OID.
5681 The Netscape certificate type must be absent or should have the S/MIME bit set.
5682 If the S/MIME bit is not set in Netscape certificate type, then the SSL
5683 client bit is tolerated as an alternative but a warning is shown:
5684 this is because some Verisign certificates don't set the S/MIME bit.
5686 In addition to the common S/MIME client tests, the
5687 .Cm digitalSignature
5688 bit must be set if the
5690 extension is present.
5691 .It S/MIME Encryption
5692 In addition to the common S/MIME tests, the
5694 bit must be set if the
5696 extension is present.
5698 The extended key usage extension must be absent or include the
5699 email protection OID.
5700 The Netscape certificate type must be absent
5701 or must have the S/MIME CA bit set:
5702 this is used as a workaround if the
5703 .Cm basicConstraints
5704 extension is absent.
5708 extension must be absent or it must have the CRL signing bit set.
5710 The normal CA tests apply, except the
5711 .Cm basicConstraints
5712 extension must be present.
5714 .It Fl setalias Ar arg
5715 Set the alias of the certificate,
5716 allowing the certificate to be referred to using a nickname,
5718 .Qq Steve's Certificate .
5720 Output a trusted certificate
5721 (the default if any trust settings are modified).
5722 An ordinary or trusted certificate can be input, but by default an ordinary
5723 certificate is output and any trust settings are discarded.
5728 utility can be used to sign certificates and requests:
5729 it can thus behave like a mini CA.
5730 The following are x509 signing options:
5731 .Bl -tag -width "XXXX"
5733 The CA certificate to be used for signing.
5734 When this option is present,
5736 behaves like a mini CA.
5737 The input file is signed by the CA using this option;
5738 that is, its issuer name is set to the subject name of the CA and it is
5739 digitally signed using the CA's private key.
5741 This option is normally combined with the
5746 option, the input is a certificate which must be self-signed.
5747 .It Fl CAcreateserial
5748 Create the CA serial number file if it does not exist
5749 instead of generating an error.
5750 The file will contain the serial number
5752 and the certificate being signed will have
5754 as its serial number.
5755 .It Fl CAform Cm der | pem
5756 The format of the CA certificate file.
5759 .It Fl CAkey Ar file
5760 Set the CA private key to sign a certificate with.
5761 Otherwise it is assumed that the CA private key is present
5762 in the CA certificate file.
5763 .It Fl CAkeyform Cm der | pem
5764 The format of the CA private key.
5767 .It Fl CAserial Ar file
5768 Use the serial number in
5770 to sign a certificate.
5771 The file should consist of one line containing an even number of hex digits
5772 with the serial number to use.
5773 After each use the serial number is incremented and written out
5776 The default filename consists of the CA certificate file base name with
5779 For example, if the CA certificate file is called
5781 it expects to find a serial number file called
5783 .It Fl checkend Ar arg
5784 Check whether the certificate expires in the next
5787 If so, exit with return value 1;
5788 otherwise exit with return value 0.
5790 Delete any extensions from a certificate.
5791 This option is used when a certificate is being created from another
5792 certificate (for example with the
5797 Normally, all extensions are retained.
5799 The number of days to make a certificate valid for.
5800 The default is 30 days.
5801 .It Fl extensions Ar section
5802 The section to add certificate extensions from.
5803 If this option is not specified, the extensions should either be
5804 contained in the unnamed (default) section
5805 or the default section should contain a variable called
5807 which contains the section to use.
5808 .It Fl extfile Ar file
5809 File containing certificate extensions to use.
5810 If not specified, no extensions are added to the certificate.
5811 .It Fl keyform Cm der | pem
5812 The format of the private key file used in the
5816 Expect a certificate request on input instead of a certificate.
5817 .It Fl set_serial Ar n
5818 The serial number to use.
5819 This option can be used with either the
5824 If used in conjunction with the
5826 option, the serial number file (as specified by the
5830 options) is not used.
5832 The serial number can be decimal or hex (if preceded by
5834 Negative serial numbers can also be specified but their use is not recommended.
5835 .It Fl signkey Ar file
5838 using the supplied private key.
5840 If the input file is a certificate, it sets the issuer name to the
5841 subject name (i.e. makes it self-signed),
5842 changes the public key to the supplied value,
5843 and changes the start and end dates.
5844 The start date is set to the current time and the end date is set to
5845 a value determined by the
5848 Any certificate extensions are retained unless the
5852 If the input is a certificate request, a self-signed certificate
5853 is created using the supplied private key using the subject name in
5856 Convert a certificate into a certificate request.
5859 option is used to pass the required private key.
5862 Several commands share a common syntax,
5865 Password arguments, typically specified using
5869 for input and output passwords,
5870 allow passwords to be obtained from a variety of sources.
5871 Both of these options take a single argument, described below.
5872 If no password argument is given and a password is required,
5873 then the user is prompted to enter one:
5874 this will typically be read from the current terminal with echoing turned off.
5875 .Bl -tag -width "pass:password" -offset indent
5876 .It Cm pass : Ns Ar password
5877 The actual password is
5879 Since the password is visible to utilities,
5880 this form should only be used where security is not important.
5881 .It Cm env : Ns Ar var
5882 Obtain the password from the environment variable
5884 Since the environment of other processes is visible,
5885 this option should be used with caution.
5886 .It Cm file : Ns Ar path
5892 argument is supplied to
5896 then the first line will be used for the input password and the next line
5897 for the output password.
5899 need not refer to a regular file:
5900 it could, for example, refer to a device or named pipe.
5901 .It Cm fd : Ns Ar number
5902 Read the password from the file descriptor
5904 This can be used to send the data via a pipe, for example.
5906 Read the password from standard input.
5909 Input/output formats,
5910 typically specified using
5914 indicate the format being read from or written to.
5915 The argument is case insensitive.
5917 .Bl -tag -width Ds -offset indent -compact
5919 Distinguished Encoding Rules (DER)
5922 Insecure legacy format.
5924 Privacy Enhanced Mail (PEM)
5927 An SMIME format message.
5932 The following environment variables affect the execution of
5934 .Bl -tag -width "/etc/ssl/openssl.cnf"
5936 The location of the master configuration file.
5939 .Bl -tag -width "/etc/ssl/openssl.cnf" -compact
5941 Default config directory for
5943 .It Pa /etc/ssl/lib/
5945 .It Pa /etc/ssl/private/
5946 Default private key directory.
5947 .It Pa /etc/ssl/openssl.cnf
5948 Default configuration file for
5950 .It Pa /etc/ssl/x509v3.cnf
5951 Default configuration file for
5968 .%T The TLS Protocol Version 1.0
5977 .%T Lightweight Directory Access Protocol (v3): UTF-8 String Representation of Distinguished Names
5984 .%T PKCS #7: Cryptographic Message Syntax Version 1.5
5994 .%T Internet X.509 Public Key Infrastructure Certificate and CRL Profile
6005 .%T X.509 Internet Public Key Infrastructure Online Certificate Status Protocol \(en OCSP
6012 .%T Cryptographic Message Syntax
6019 .%T Advanced Encryption Standard (AES) Ciphersuites for Transport Layer Security (TLS)