summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmc <>2003-08-30 17:30:54 +0000
committerjmc <>2003-08-30 17:30:54 +0000
commit199384f95e02a8b4186670744adfe15a7d7bec31 (patch)
tree6a59943f64e80683a7f2de8c6c68514b6d845253
parent0d375da66d1059b3e8796fc2c3fe859995d35e88 (diff)
downloadopenbsd-199384f95e02a8b4186670744adfe15a7d7bec31.tar.gz
openbsd-199384f95e02a8b4186670744adfe15a7d7bec31.tar.bz2
openbsd-199384f95e02a8b4186670744adfe15a7d7bec31.zip
- sync SYNOPSIS(es) and ciphers/digests available with reality
- remove non-OBSD details - indent examples - general macro/punctuation cleanup
-rw-r--r--src/usr.sbin/openssl/openssl.12992
1 files changed, 1684 insertions, 1308 deletions
diff --git a/src/usr.sbin/openssl/openssl.1 b/src/usr.sbin/openssl/openssl.1
index ad7e25ffbf..1229888c16 100644
--- a/src/usr.sbin/openssl/openssl.1
+++ b/src/usr.sbin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.11 2003/08/08 10:13:33 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.12 2003/08/30 17:30:54 jmc Exp $
2.\" ==================================================================== 2.\" ====================================================================
3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4.\" 4.\"
@@ -128,7 +128,7 @@
128.Bk -words 128.Bk -words
129.Oo Cm list-standard-commands Li |\ \& 129.Oo Cm list-standard-commands Li |\ \&
130.Cm list-message-digest-commands | 130.Cm list-message-digest-commands |
131.Cm \ \ \ \ list-cipher-commands 131.Cm \ \&\ \&\ \&\ \&\ \&list-cipher-commands
132.Oc 132.Oc
133.Ek 133.Ek
134.Pp 134.Pp
@@ -138,8 +138,10 @@
138.Sh DESCRIPTION 138.Sh DESCRIPTION
139.Nm OpenSSL 139.Nm OpenSSL
140is a cryptography toolkit implementing the Secure Sockets Layer 140is a cryptography toolkit implementing the Secure Sockets Layer
141(SSL v2/v3) and Transport Layer Security (TLS v1) network protocols and 141.Pq SSL v2/v3
142related cryptography standards required by them. 142and Transport Layer Security
143.Pq TLS v1
144network protocols and related cryptography standards required by them.
143.Pp 145.Pp
144The 146The
145.Nm 147.Nm
@@ -150,7 +152,7 @@ cryptography functions of
150library from the shell. 152library from the shell.
151It can be used for 153It can be used for
152.Pp 154.Pp
153.Bl -bullet -compact 155.Bl -bullet -offset indent -compact
154.It 156.It
155Creation of RSA, DH and DSA key parameters 157Creation of RSA, DH and DSA key parameters
156.It 158.It
@@ -185,9 +187,10 @@ The pseudo-commands
185.Cm list-standard-commands , list-message-digest-commands , 187.Cm list-standard-commands , list-message-digest-commands ,
186and 188and
187.Cm list-cipher-commands 189.Cm list-cipher-commands
188output a list (one entry per line) of the names 190output a list
189of all standard commands, message digest commands, or cipher commands, 191.Pq one entry per line
190respectively, that are available in the present 192of the names of all standard commands, message digest commands,
193or cipher commands, respectively, that are available in the present
191.Nm 194.Nm
192utility. 195utility.
193.Pp 196.Pp
@@ -198,7 +201,9 @@ specified name is available.
198If no command named 201If no command named
199.Ar XXX 202.Ar XXX
200exists, 203exists,
201it returns 0 (success) and prints 204it returns 0
205.Pq success
206and prints
202.Cm no- Ns Ar XXX ; 207.Cm no- Ns Ar XXX ;
203otherwise it returns 1 and prints 208otherwise it returns 1 and prints
204.Ar XXX . 209.Ar XXX .
@@ -226,11 +231,15 @@ itself.
226.It Cm asn1parse 231.It Cm asn1parse
227Parse an ASN.1 sequence. 232Parse an ASN.1 sequence.
228.It Cm ca 233.It Cm ca
229Certificate Authority (CA) Management. 234Certificate Authority
235.Pq CA
236Management.
230.It Cm ciphers 237.It Cm ciphers
231Cipher Suite Description Determination. 238Cipher Suite Description Determination.
232.It Cm crl 239.It Cm crl
233Certificate Revocation List (CRL) Management. 240Certificate Revocation List
241.Pq CRL
242Management.
234.It Cm crl2pkcs7 243.It Cm crl2pkcs7
235CRL to PKCS#7 Conversion. 244CRL to PKCS#7 Conversion.
236.It Cm dgst 245.It Cm dgst
@@ -258,7 +267,7 @@ Generation of DSA Parameters.
258.It Cm genrsa 267.It Cm genrsa
259Generation of RSA Parameters. 268Generation of RSA Parameters.
260.It Cm nseq 269.It Cm nseq
261Create or examine a netscape certificate sequence. 270Create or examine a Netscape certificate sequence.
262.It Cm ocsp 271.It Cm ocsp
263Online Certificate Status Protocol utility. 272Online Certificate Status Protocol utility.
264.It Cm passwd 273.It Cm passwd
@@ -272,7 +281,9 @@ PKCS#12 Data Management.
272.It Cm rand 281.It Cm rand
273Generate pseudo-random bytes. 282Generate pseudo-random bytes.
274.It Cm req 283.It Cm req
275X.509 Certificate Signing Request (CSR) Management. 284X.509 Certificate Signing Request
285.Pq CSR
286Management.
276.It Cm rsa 287.It Cm rsa
277RSA Data Management. 288RSA Data Management.
278.It Cm rsautl 289.It Cm rsautl
@@ -318,10 +329,10 @@ X.509 Certificate Data Management.
318.Bl -tag -width "asn1parse" 329.Bl -tag -width "asn1parse"
319.It Cm md2 330.It Cm md2
320MD2 Digest. 331MD2 Digest.
332.It Cm md4
333MD4 Digest.
321.It Cm md5 334.It Cm md5
322MD5 Digest. 335MD5 Digest.
323.It Cm mdc2
324MDC2 Digest.
325.It Cm rmd160 336.It Cm rmd160
326RMD-160 Digest. 337RMD-160 Digest.
327.It Cm sha 338.It Cm sha
@@ -330,28 +341,47 @@ SHA Digest.
330SHA-1 Digest. 341SHA-1 Digest.
331.El 342.El
332.Sh ENCODING AND CIPHER COMMANDS 343.Sh ENCODING AND CIPHER COMMANDS
333.Bl -tag -width "asn1parse" 344.Bl -tag -width Ds -compact
345.It Cm aes-128-cbc | aes-128-ecb | aes-192-cbc | aes-192-ecb |
346.It Cm aes-256-cbc | aes-256-ecb
347AES Cipher.
348.Pp
334.It Cm base64 349.It Cm base64
335Base64 Encoding. 350Base64 Encoding.
336.It Cm bf bf-cbc bf-cfb bf-ecb bf-ofb 351.Pp
352.It Xo
353.Cm bf | bf-cbc | bf-cfb |
354.Cm bf-ecb | bf-ofb
355.Xc
337Blowfish Cipher. 356Blowfish Cipher.
338.It Cm cast cast-cbc 357.Pp
358.It Cm cast | cast-cbc
339CAST Cipher. 359CAST Cipher.
340.It Cm cast5-cbc cast5-cfb cast5-ecb cast5-ofb 360.Pp
361.It Cm cast5-cbc | cast5-cfb | cast5-ecb | cast5-ofb
341CAST5 Cipher. 362CAST5 Cipher.
342.It Cm des des-cbc des-cfb des-ecb des-ede des-ede-cbc 363.Pp
343.It Cm des-ede-cfb des-ede-ofb des-ofb 364.It Xo
365.Cm des | des-cbc | des-cfb | des-ecb |
366.Cm des-ede | des-ede-cbc
367.Xc
368.It Cm des-ede-cfb | des-ede-ofb | des-ofb
344DES Cipher. 369DES Cipher.
345.It Cm des3 desx des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb 370.Pp
371.It Xo
372.Cm des3 | desx | des-ede3 |
373.Cm des-ede3-cbc | des-ede3-cfb | des-ede3-ofb
374.Xc
346Triple-DES Cipher. 375Triple-DES Cipher.
347.It Cm idea idea-cbc idea-cfb idea-ecb idea-ofb 376.Pp
348IDEA Cipher. 377.It Xo
349.It Cm rc2 rc2-cbc rc2-cfb rc2-ecb rc2-ofb 378.Cm rc2 | rc2-40-cbc | rc2-64-cbc | rc2-cbc |
379.Cm rc2-cfb | rc2-ecb | rc2-ofb
380.Xc
350RC2 Cipher. 381RC2 Cipher.
351.It Cm rc4 382.Pp
383.It Cm rc4 | rc4-40
352RC4 Cipher. 384RC4 Cipher.
353.It Cm rc5 rc5-cbc rc5-cfb rc5-ecb rc5-ofb
354RC5 Cipher.
355.El 385.El
356.Sh PASS PHRASE ARGUMENTS 386.Sh PASS PHRASE ARGUMENTS
357Several commands accept password arguments, typically using 387Several commands accept password arguments, typically using
@@ -365,21 +395,25 @@ If no password argument is given and a password is required then the user is
365prompted to enter one: this will typically be read from the current 395prompted to enter one: this will typically be read from the current
366terminal with echoing turned off. 396terminal with echoing turned off.
367.Bl -tag -width "fd:number" 397.Bl -tag -width "fd:number"
368.It Ar pass:password 398.It Ar pass Ns : Ns Ar password
369The actual password is 399The actual password is
370.Ar password . 400.Ar password .
371Since the password is visible to utilities 401Since the password is visible to utilities
372(like 402(like
373.Xr ps 1 403.Xr ps 1
374under Unix) this form should only be used where security is not important. 404under
375.It Ar env:var 405.Ux )
406this form should only be used where security is not important.
407.It Ar env Ns : Ns Ar var
376Obtain the password from the environment variable 408Obtain the password from the environment variable
377.Ar var . 409.Ar var .
378Since the environment of other processes is visible on certain platforms 410Since the environment of other processes is visible on certain platforms
379(e.g. 411(e.g.\&
380.Xr ps 1 412.Xr ps 1
381under certain Unix OSes) this option should be used with caution. 413under certain
382.It Ar file:pathname 414.Ux
415OSes) this option should be used with caution.
416.It Ar file Ns : Ns Ar pathname
383The first line of 417The first line of
384.Ar pathname 418.Ar pathname
385is the password. 419is the password.
@@ -388,13 +422,13 @@ If the same
388argument is supplied to 422argument is supplied to
389.Fl passin 423.Fl passin
390and 424and
391.Fl passout 425.Fl passout ,
392then the first line will be used for the input password and the next line 426then the first line will be used for the input password and the next line
393for the output password. 427for the output password.
394.Ar pathname 428.Ar pathname
395need not refer to a regular file: 429need not refer to a regular file:
396it could, for example, refer to a device or named pipe. 430it could, for example, refer to a device or named pipe.
397.It Ar fd:number 431.It Ar fd Ns : Ns Ar number
398Read the password from the file descriptor 432Read the password from the file descriptor
399.Ar number . 433.Ar number .
400This can be used to send the data via a pipe for example. 434This can be used to send the data via a pipe for example.
@@ -406,15 +440,19 @@ Read the password from standard input.
406.\" 440.\"
407.Sh ASN1PARSE 441.Sh ASN1PARSE
408.Nm "openssl asn1parse" 442.Nm "openssl asn1parse"
409.Op Fl inform Ar PEM|DER 443.Bk -words
444.Op Fl inform Ar DER | PEM | TXT
410.Op Fl in Ar filename 445.Op Fl in Ar filename
411.Op Fl out Ar filename 446.Op Fl out Ar filename
412.Op Fl noout 447.Op Fl noout
413.Op Fl offset Ar number 448.Op Fl offset Ar number
414.Op Fl length Ar number 449.Op Fl length Ar number
415.Op Fl i 450.Op Fl i
451.Op Fl dump
452.Op Fl dlimit Ar number
416.Op Fl oid Ar filename 453.Op Fl oid Ar filename
417.Op Fl strparse Ar offset 454.Op Fl strparse Ar offset
455.Ek
418.Pp 456.Pp
419The 457The
420.Nm asn1parse 458.Nm asn1parse
@@ -423,12 +461,15 @@ It can also be used to extract data from ASN.1 formatted data.
423.Pp 461.Pp
424The options are as follows: 462The options are as follows:
425.Bl -tag -width "XXXX" 463.Bl -tag -width "XXXX"
426.It Fl inform Ar DER|PEM 464.It Fl inform Ar DER | PEM | TXT
427The input format. 465The input format.
428.Ar DER 466.Ar DER
429is binary format and 467is binary format and
430.Ar PEM 468.Ar PEM
431(the default) is base64 encoded. 469.Pq the default
470is base64 encoded.
471.Ar TXT
472is plain text.
432.It Fl in Ar filename 473.It Fl in Ar filename
433The input file; default is standard input. 474The input file; default is standard input.
434.It Fl out Ar filename 475.It Fl out Ar filename
@@ -446,16 +487,27 @@ Starting offset to begin parsing; default is start of file.
446.It Fl length Ar number 487.It Fl length Ar number
447Number of bytes to parse; default is until end of file. 488Number of bytes to parse; default is until end of file.
448.It Fl i 489.It Fl i
449Indents the output according to the "depth" of the structures. 490Indents the output according to the
491.Qq depth
492of the structures.
493.It Fl dump
494Dump unknown data in hex form.
495.It Fl dlimit Ar number
496Dump the first
497.Ar number
498bytes of unknown data in hex form.
450.It Fl oid Ar filename 499.It Fl oid Ar filename
451A file containing additional OBJECT IDENTIFIERs (OIDs). 500A file containing additional OBJECT IDENTIFIERs
501.Pq OIDs .
452The format of this file is described in the 502The format of this file is described in the
453.Sx ASN1PARSE NOTES 503.Sx ASN1PARSE NOTES
454section below. 504section below.
455.It Fl strparse Ar offset 505.It Fl strparse Ar offset
456Parse the contents octets of the ASN.1 object starting at 506Parse the contents octets of the ASN.1 object starting at
457.Ar offset . 507.Ar offset .
458This option can be used multiple times to "drill down" into a nested structure. 508This option can be used multiple times to
509.Qq drill down
510into a nested structure.
459.El 511.El
460.Sh ASN1PARSE OUTPUT 512.Sh ASN1PARSE OUTPUT
461The output will typically contain lines like this: 513The output will typically contain lines like this:
@@ -468,10 +520,10 @@ The output will typically contain lines like this:
468 373:d=2 hl=3 l= 162 cons: cont [ 3 ] 520 373:d=2 hl=3 l= 162 cons: cont [ 3 ]
469 376:d=3 hl=3 l= 159 cons: SEQUENCE 521 376:d=3 hl=3 l= 159 cons: SEQUENCE
470 379:d=4 hl=2 l= 29 cons: SEQUENCE 522 379:d=4 hl=2 l= 29 cons: SEQUENCE
471 381:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Subject Key Identifier 523 381:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Subject Key Identifier
472 386:d=5 hl=2 l= 22 prim: OCTET STRING 524 386:d=5 hl=2 l= 22 prim: OCTET STRING
473 410:d=4 hl=2 l= 112 cons: SEQUENCE 525 410:d=4 hl=2 l= 112 cons: SEQUENCE
474 412:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Authority Key Identifier 526 412:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Authority Key Identifier
475 417:d=5 hl=2 l= 105 prim: OCTET STRING 527 417:d=5 hl=2 l= 105 prim: OCTET STRING
476 524:d=4 hl=2 l= 12 cons: SEQUENCE 528 524:d=4 hl=2 l= 12 cons: SEQUENCE
477 529
@@ -484,7 +536,9 @@ Each line starts with the offset in decimal.
484specifies the current depth. 536specifies the current depth.
485The depth is increased within the scope of any SET or SEQUENCE. 537The depth is increased within the scope of any SET or SEQUENCE.
486.Cm hl=XX 538.Cm hl=XX
487gives the header length (tag and length octets) of the current type. 539gives the header length
540.Pq tag and length octets
541of the current type.
488.Cm l=XX 542.Cm l=XX
489gives the length of the contents octets. 543gives the length of the contents octets.
490.Pp 544.Pp
@@ -508,24 +562,28 @@ to yield:
508If an OID is not part of 562If an OID is not part of
509.Nm OpenSSL Ns Li 's 563.Nm OpenSSL Ns Li 's
510internal table it will be represented in 564internal table it will be represented in
511numerical form (for example 1.2.3.4). 565numerical form
566.Pq for example 1.2.3.4 .
512The file passed to the 567The file passed to the
513.Fl oid 568.Fl oid
514option allows additional OIDs to be included. 569option allows additional OIDs to be included.
515Each line consists of three columns, 570Each line consists of three columns;
516the first column is the OID in numerical format and should be followed by 571the first column is the OID in numerical format and should be followed by
517whitespace. 572whitespace.
518The second column is the "short name" which is a single word followed 573The second column is the
519by whitespace. 574.Qq short name
520The final column is the rest of the line and is the "long name". 575which is a single word followed by whitespace.
576The final column is the rest of the line and is the
577.Qq long name .
521.Nm asn1parse 578.Nm asn1parse
522displays the long name. 579displays the long name.
523Example: 580Example:
524.Pp 581.Pp
525"1.2.3.4 shortName A long name" 582.Dl \&"1.2.3.4 shortName A long name\&"
526.Sh ASN1PARSE BUGS 583.Sh ASN1PARSE BUGS
527There should be options to change the format of input lines. 584There should be options to change the format of input lines.
528The output of some ASN.1 types is not well handled (if at all). 585The output of some ASN.1 types is not well handled
586.Pq if at all .
529.\" 587.\"
530.\" ca 588.\" ca
531.\" 589.\"
@@ -551,6 +609,7 @@ The output of some ASN.1 types is not well handled (if at all).
551.Op Fl md Ar arg 609.Op Fl md Ar arg
552.Op Fl policy Ar arg 610.Op Fl policy Ar arg
553.Op Fl keyfile Ar arg 611.Op Fl keyfile Ar arg
612.Op Fl keyform Ar PEM | ENGINE
554.Op Fl key Ar arg 613.Op Fl key Ar arg
555.Op Fl passin Ar arg 614.Op Fl passin Ar arg
556.Op Fl cert Ar file 615.Op Fl cert Ar file
@@ -567,6 +626,8 @@ The output of some ASN.1 types is not well handled (if at all).
567.Op Fl msie_hack 626.Op Fl msie_hack
568.Op Fl extensions Ar section 627.Op Fl extensions Ar section
569.Op Fl extfile Ar section 628.Op Fl extfile Ar section
629.Op Fl status Ar serial
630.Op Fl updatedb
570.Op Fl engine Ar id 631.Op Fl engine Ar id
571.Ek 632.Ek
572.Pp 633.Pp
@@ -614,21 +675,27 @@ The
614.Ar directory 675.Ar directory
615to output certificates to. 676to output certificates to.
616The certificate will be written to a filename consisting of the 677The certificate will be written to a filename consisting of the
617serial number in hex with ".pem" appended. 678serial number in hex with
679.Qq .pem
680appended.
618.It Fl cert 681.It Fl cert
619The CA certificate file. 682The CA certificate file.
620.It Fl keyfile Ar filename 683.It Fl keyfile Ar filename
621The private key to sign requests with. 684The private key to sign requests with.
685.It Fl keyform Ar PEM | ENGINE
686Private key file format.
622.It Fl key Ar password 687.It Fl key Ar password
623The password used to encrypt the private key. 688The password used to encrypt the private key.
624Since on some systems the command line arguments are visible 689Since on some systems the command line arguments are visible
625(e.g. Unix with the 690(e.g.\&
691.Ux
692with the
626.Xr ps 1 693.Xr ps 1
627utility) this option should be used with caution. 694utility) this option should be used with caution.
628.It Fl passin Ar arg 695.It Fl passin Ar arg
629The key password source. 696The key password source.
630For more information about the format of 697For more information about the format of
631.Ar arg 698.Ar arg ,
632see the 699see the
633.Sx PASS PHRASE ARGUMENTS 700.Sx PASS PHRASE ARGUMENTS
634section above. 701section above.
@@ -639,22 +706,24 @@ Don't output the text form of a certificate to the output file.
639.It Fl startdate Ar date 706.It Fl startdate Ar date
640This allows the start date to be explicitly set. 707This allows the start date to be explicitly set.
641The format of the date is YYMMDDHHMMSSZ 708The format of the date is YYMMDDHHMMSSZ
642(the same as an ASN1 UTCTime structure). 709.Pq the same as an ASN1 UTCTime structure .
643.It Fl enddate Ar date 710.It Fl enddate Ar date
644This allows the expiry date to be explicitly set. 711This allows the expiry date to be explicitly set.
645The format of the date is YYMMDDHHMMSSZ 712The format of the date is YYMMDDHHMMSSZ
646(the same as an ASN1 UTCTime structure). 713.Pq the same as an ASN1 UTCTime structure .
647.It Fl days Ar arg 714.It Fl days Ar arg
648The number of days to certify the certificate for. 715The number of days to certify the certificate for.
649.It Fl md Ar alg 716.It Fl md Ar alg
650The message digest to use. 717The message digest to use.
651Possible values include 718Possible values include
652.Ar md5 , sha1 719.Ar md5
653and 720and
654.Ar mdc2 . 721.Ar sha1 .
655This option also applies to CRLs. 722This option also applies to CRLs.
656.It Fl policy Ar arg 723.It Fl policy Ar arg
657This option defines the CA "policy" to use. 724This option defines the CA
725.Qq policy
726to use.
658This is a section in the configuration file which decides which fields 727This is a section in the configuration file which decides which fields
659should be mandatory or match the CA certificate. 728should be mandatory or match the CA certificate.
660Check out the 729Check out the
@@ -664,13 +733,15 @@ section for more information.
664This is a legacy option to make 733This is a legacy option to make
665.Nm ca 734.Nm ca
666work with very old versions of the IE certificate enrollment control 735work with very old versions of the IE certificate enrollment control
667"certenr3". 736.Qq certenr3 .
668It used UniversalStrings for almost everything. 737It used UniversalStrings for almost everything.
669Since the old control has various security bugs, 738Since the old control has various security bugs,
670its use is strongly discouraged. 739its use is strongly discouraged.
671The newer control "Xenroll" does not need this option. 740The newer control
741.Qq Xenroll
742does not need this option.
672.It Fl preserveDN 743.It Fl preserveDN
673Normally the DN order of a certificate is the same as the order of the 744Normally, the DN order of a certificate is the same as the order of the
674fields in the relevant policy section. 745fields in the relevant policy section.
675When this option is set, the order is the same as the request. 746When this option is set, the order is the same as the request.
676This is largely for compatibility with the older IE enrollment control 747This is largely for compatibility with the older IE enrollment control
@@ -683,7 +754,7 @@ request DN, however it is good policy just having the e-mail set into
683the 754the
684.Em altName 755.Em altName
685extension of the certificate. 756extension of the certificate.
686When this option is set the EMAIL field is removed from the certificate's 757When this option is set, the EMAIL field is removed from the certificate's
687subject and set only in the, eventually present, extensions. 758subject and set only in the, eventually present, extensions.
688The 759The
689.Ar email_in_dn 760.Ar email_in_dn
@@ -700,7 +771,8 @@ unless the
700.Fl extfile 771.Fl extfile
701option is used). 772option is used).
702If no extension section is present, then a V1 certificate is created. 773If no extension section is present, then a V1 certificate is created.
703If the extension section is present (even if it is empty), 774If the extension section is present
775.Pq even if it is empty ,
704then a V3 certificate is created. 776then a V3 certificate is created.
705.It Fl extfile Ar file 777.It Fl extfile Ar file
706An additional configuration 778An additional configuration
@@ -709,11 +781,16 @@ to read certificate extensions from
709(using the default section unless the 781(using the default section unless the
710.Fl extensions 782.Fl extensions
711option is also used). 783option is also used).
784.It Fl status Ar serial
785Show status of certificate with serial number
786.Ar serial .
787.It Fl updatedb
788Update database for expired certificates.
712.It Fl engine Ar id 789.It Fl engine Ar id
713Specifying an engine (by it's unique 790Specifying an engine (by it's unique
714.Ar id 791.Ar id
715string) will cause 792string) will cause
716.Nm req 793.Nm ca
717to attempt to obtain a functional reference to the specified engine, 794to attempt to obtain a functional reference to the specified engine,
718thus initialising it if needed. 795thus initialising it if needed.
719The engine will then be set as the default for all available algorithms. 796The engine will then be set as the default for all available algorithms.
@@ -743,7 +820,7 @@ The matching of
743.Ar reason 820.Ar reason
744is case insensitive. 821is case insensitive.
745Setting any revocation reason will make the CRL v2. 822Setting any revocation reason will make the CRL v2.
746In practive removeFromCRL is not particularly useful because it is only used 823In practice, removeFromCRL is not particularly useful because it is only used
747in delta CRLs which are not currently implemented. 824in delta CRLs which are not currently implemented.
748.It Fl crl_hold Ar instruction 825.It Fl crl_hold Ar instruction
749This sets the CRL revocation reason code to certificateHold and the hold 826This sets the CRL revocation reason code to certificateHold and the hold
@@ -768,18 +845,23 @@ The
768.Ar arg 845.Ar arg
769must be formatted as 846must be formatted as
770.Ar /type0=value0/type1=value1/type2=... ; 847.Ar /type0=value0/type1=value1/type2=... ;
771characters may be escaped by \e (backslash), no spaces are skipped. 848characters may be escaped by
849.Sq \e
850.Pq backslash ,
851no spaces are skipped.
772.It Fl crlexts Ar section 852.It Fl crlexts Ar section
773The 853The
774.Ar section 854.Ar section
775of the configuration file containing CRL extensions to include. 855of the configuration file containing CRL extensions to include.
776If no CRL extension section is present then a V1 CRL is created; 856If no CRL extension section is present then a V1 CRL is created;
777if the CRL extension section is present (even if it is empty) 857if the CRL extension section is present
858.Pq even if it is empty
778then a V2 CRL is created. 859then a V2 CRL is created.
779The CRL extensions specified are CRL extensions and 860The CRL extensions specified are CRL extensions and
780.Em not 861.Em not
781CRL entry extensions. 862CRL entry extensions.
782It should be noted that some software (for example Netscape) 863It should be noted that some software
864.Pq for example Netscape
783can't handle V2 CRLs. 865can't handle V2 CRLs.
784.El 866.El
785.Sh CA CONFIGURATION FILE OPTIONS 867.Sh CA CONFIGURATION FILE OPTIONS
@@ -801,9 +883,11 @@ the following options are read directly from the
801.Em ca 883.Em ca
802section: 884section:
803.Pp 885.Pp
804 RANDFILE 886.Bl -tag -width Ds -offset indent -compact
805 preserve 887.It RANDFILE
806 msie_hack 888.It preserve
889.It msie_hack
890.El
807.Pp 891.Pp
808With the exception of RANDFILE, this is probably a bug and may 892With the exception of RANDFILE, this is probably a bug and may
809change in future releases. 893change in future releases.
@@ -813,7 +897,9 @@ options.
813Where the option is present in the configuration file and the command line, 897Where the option is present in the configuration file and the command line,
814the command line value is used. 898the command line value is used.
815Where an option is described as mandatory, then it must be present in 899Where an option is described as mandatory, then it must be present in
816the configuration file or the command line equivalent (if any) used. 900the configuration file or the command line equivalent
901.Pq if any
902used.
817.Bl -tag -width "XXXX" 903.Bl -tag -width "XXXX"
818.It Ar oid_file 904.It Ar oid_file
819This specifies a file containing additional OBJECT IDENTIFIERS. 905This specifies a file containing additional OBJECT IDENTIFIERS.
@@ -825,7 +911,7 @@ This specifies a section in the configuration file containing extra
825object identifiers. 911object identifiers.
826Each line should consist of the short name of the object identifier 912Each line should consist of the short name of the object identifier
827followed by 913followed by
828.Cm = 914.Sq =
829and the numerical form. 915and the numerical form.
830The short and long names are the same when this option is used. 916The short and long names are the same when this option is used.
831.It Ar new_certs_dir 917.It Ar new_certs_dir
@@ -866,7 +952,8 @@ The same as the
866option. 952option.
867Either this option or 953Either this option or
868.Ar default_days 954.Ar default_days
869(or the command line equivalents) must be present. 955.Pq or the command line equivalents
956must be present.
870.It Ar default_crl_hours default_crl_days 957.It Ar default_crl_hours default_crl_days
871The same as the 958The same as the
872.Fl crlhours 959.Fl crlhours
@@ -902,8 +989,9 @@ The same as
902The same as 989The same as
903.Fl noemailDN . 990.Fl noemailDN .
904If the EMAIL field is to be removed from the DN of the certificate, 991If the EMAIL field is to be removed from the DN of the certificate,
905simply set this to 'no'. 992simply set this to
906If not present the default is to allow for the EMAIL field in the 993.Qq no .
994If not present, the default is to allow for the EMAIL field in the
907certificate's DN. 995certificate's DN.
908.It Ar msie_hack 996.It Ar msie_hack
909The same as 997The same as
@@ -932,11 +1020,11 @@ are permanently set and cannot be disabled
932(this is because the certificate signature cannot be displayed because 1020(this is because the certificate signature cannot be displayed because
933the certificate has not been signed at this point). 1021the certificate has not been signed at this point).
934.Pp 1022.Pp
935For convenience the values 1023For convenience, the value
936.Em default_ca 1024.Em default_ca
937are accepted by both to produce a reasonable output. 1025is accepted by both to produce a reasonable output.
938.Pp 1026.Pp
939If neither option is present the format used in earlier versions of 1027If neither option is present, the format used in earlier versions of
940.Nm OpenSSL 1028.Nm OpenSSL
941is used. 1029is used.
942Use of the old format is 1030Use of the old format is
@@ -952,11 +1040,11 @@ If set to
952or this option is not present, then extensions are 1040or this option is not present, then extensions are
953ignored and not copied to the certificate. 1041ignored and not copied to the certificate.
954If set to 1042If set to
955.Ar copy 1043.Ar copy ,
956then any extensions present in the request that are not already present 1044then any extensions present in the request that are not already present
957are copied to the certificate. 1045are copied to the certificate.
958If set to 1046If set to
959.Ar copyall 1047.Ar copyall ,
960then all extensions in the request are copied to the certificate: 1048then all extensions in the request are copied to the certificate:
961if the extension is already present in the certificate it is deleted first. 1049if the extension is already present in the certificate it is deleted first.
962See the 1050See the
@@ -970,10 +1058,15 @@ values for certain extensions such as
970.Sh CA POLICY FORMAT 1058.Sh CA POLICY FORMAT
971The policy section consists of a set of variables corresponding to 1059The policy section consists of a set of variables corresponding to
972certificate DN fields. 1060certificate DN fields.
973If the value is "match" then the field value 1061If the value is
974must match the same field in the CA certificate. 1062.Qq match ,
975If the value is "supplied" then it must be present. 1063then the field value must match the same field in the CA certificate.
976If the value is "optional" then it may be present. 1064If the value is
1065.Qq supplied ,
1066then it must be present.
1067If the value is
1068.Qq optional ,
1069then it may be present.
977Any fields not mentioned in the policy section 1070Any fields not mentioned in the policy section
978are silently deleted, unless the 1071are silently deleted, unless the
979.Fl preserveDN 1072.Fl preserveDN
@@ -992,8 +1085,9 @@ utility.
992.Pp 1085.Pp
993The file should contain the variable SPKAC set to the value of 1086The file should contain the variable SPKAC set to the value of
994the SPKAC and also the required DN components as name value pairs. 1087the SPKAC and also the required DN components as name value pairs.
995If it's necessary to include the same component twice then it can be 1088If it's necessary to include the same component twice,
996preceded by a number and a '.'. 1089then it can be preceded by a number and a
1090.Sq \&. .
997.Sh CA EXAMPLES 1091.Sh CA EXAMPLES
998.Sy Note : 1092.Sy Note :
999these examples assume that the 1093these examples assume that the
@@ -1016,36 +1110,39 @@ and its private key to
1016.Pa demoCA/private/cakey.pem . 1110.Pa demoCA/private/cakey.pem .
1017A file 1111A file
1018.Pa demoCA/serial 1112.Pa demoCA/serial
1019would be created containing, for example, "01" and the empty index file 1113would be created containing, for example,
1114.Qq 01
1115and the empty index file
1020.Pa demoCA/index.txt . 1116.Pa demoCA/index.txt .
1021.Pp 1117.Pp
1022Sign a certificate request: 1118Sign a certificate request:
1023.Pp 1119.Pp
1024\& $ openssl ca -in req.pem -out newcert.pem 1120.Dl $ openssl ca -in req.pem -out newcert.pem
1025.Pp 1121.Pp
1026Sign a certificate request, using CA extensions: 1122Sign a certificate request, using CA extensions:
1027.Pp 1123.Pp
1028\& $ openssl ca -in req.pem -extensions v3_ca -out newcert.pem 1124.Dl $ openssl ca -in req.pem -extensions v3_ca -out newcert.pem
1029.Pp 1125.Pp
1030Generate a CRL: 1126Generate a CRL:
1031.Pp 1127.Pp
1032\& $ openssl ca -gencrl -out crl.pem 1128.Dl $ openssl ca -gencrl -out crl.pem
1033.Pp 1129.Pp
1034Sign several requests: 1130Sign several requests:
1035.Pp 1131.Pp
1036\& $ openssl ca -infiles req1.pem req2.pem req3.pem 1132.Dl $ openssl ca -infiles req1.pem req2.pem req3.pem
1037.Pp 1133.Pp
1038Certify a Netscape SPKAC: 1134Certify a Netscape SPKAC:
1039.Pp 1135.Pp
1040\& $ openssl ca -spkac spkac.txt 1136.Dl $ openssl ca -spkac spkac.txt
1041.Pp 1137.Pp
1042A sample SPKAC file (the SPKAC line has been truncated for clarity): 1138A sample SPKAC file
1043.Bd -literal 1139.Pq the SPKAC line has been truncated for clarity :
1044\& SPKAC=MIG0MGAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAn7PDhCeV/xIxUg8V70YRxK2A5 1140.Bd -literal -offset indent
1045\& CN=Steve Test 1141SPKAC=MIG0MGAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAn7PDhCeV/xIxUg8V70YRxK
1046\& emailAddress=steve@openssl.org 1142CN=Steve Test
1047\& 0.OU=OpenSSL Group 1143emailAddress=steve@openssl.org
1048\& 1.OU=Another Group 11440.OU=OpenSSL Group
11451.OU=Another Group
1049.Ed 1146.Ed
1050.Pp 1147.Pp
1051A sample configuration file with the relevant sections for 1148A sample configuration file with the relevant sections for
@@ -1053,29 +1150,29 @@ A sample configuration file with the relevant sections for
1053.Bd -literal 1150.Bd -literal
1054\& [ ca ] 1151\& [ ca ]
1055\& default_ca = CA_default # The default ca section 1152\& default_ca = CA_default # The default ca section
1056.Pp 1153
1057\& [ CA_default ] 1154\& [ CA_default ]
1058.Pp 1155
1059\& dir = ./demoCA # top dir 1156\& dir = ./demoCA # top dir
1060\& database = $dir/index.txt # index file 1157\& database = $dir/index.txt # index file
1061\& new_certs_dir = $dir/newcerts # new certs dir 1158\& new_certs_dir = $dir/newcerts # new certs dir
1062.Pp 1159
1063\& certificate = $dir/cacert.pem # The CA cert 1160\& certificate = $dir/cacert.pem # The CA cert
1064\& serial = $dir/serial # serial no file 1161\& serial = $dir/serial # serial no file
1065\& private_key = $dir/private/cakey.pem# CA private key 1162\& private_key = $dir/private/cakey.pem# CA private key
1066\& RANDFILE = $dir/private/.rand # random number file 1163\& RANDFILE = $dir/private/.rand # random number file
1067.Pp 1164
1068\& default_days = 365 # how long to certify for 1165\& default_days = 365 # how long to certify for
1069\& default_crl_days= 30 # how long before next CRL 1166\& default_crl_days= 30 # how long before next CRL
1070\& default_md = md5 # md to use 1167\& default_md = md5 # md to use
1071.Pp 1168
1072\& policy = policy_any # default policy 1169\& policy = policy_any # default policy
1073\& email_in_dn = no # Don't add the email into cert DN 1170\& email_in_dn = no # Don't add the email into cert DN
1074.Pp 1171
1075\& nameopt = default_ca # Subject name display option 1172\& nameopt = default_ca # Subject name display option
1076\& certopt = default_ca # Certificate display option 1173\& certopt = default_ca # Certificate display option
1077\& copy_extensions = none # Don't copy extensions from request 1174\& copy_extensions = none #Don't copy extensions from request
1078.Pp 1175
1079\& [ policy_any ] 1176\& [ policy_any ]
1080\& countryName = supplied 1177\& countryName = supplied
1081\& stateOrProvinceName = optional 1178\& stateOrProvinceName = optional
@@ -1087,9 +1184,9 @@ A sample configuration file with the relevant sections for
1087.Sh CA FILES 1184.Sh CA FILES
1088.Sy Note : 1185.Sy Note :
1089the location of all files can change either by compile time options, 1186the location of all files can change either by compile time options,
1090configuration file entries, environment variables or command line options. 1187configuration file entries, environment variables, or command line options.
1091The values below reflect the default values. 1188The values below reflect the default values.
1092.Bd -literal 1189.Bd -literal -offset indent
1093/usr/local/ssl/lib/openssl.cnf - master configuration file 1190/usr/local/ssl/lib/openssl.cnf - master configuration file
1094\&./demoCA - main CA directory 1191\&./demoCA - main CA directory
1095\&./demoCA/cacert.pem - CA certificate 1192\&./demoCA/cacert.pem - CA certificate
@@ -1102,7 +1199,7 @@ The values below reflect the default values.
1102\&./demoCA/.rnd - CA random seed information 1199\&./demoCA/.rnd - CA random seed information
1103.Ed 1200.Ed
1104.Sh CA ENVIRONMENT VARIABLES 1201.Sh CA ENVIRONMENT VARIABLES
1105.Em OPENSSL_CONF 1202.Ev OPENSSL_CONF
1106reflects the location of the master configuration file; 1203reflects the location of the master configuration file;
1107it can be overridden by the 1204it can be overridden by the
1108.Fl config 1205.Fl config
@@ -1133,7 +1230,8 @@ The
1133.Nm ca 1230.Nm ca
1134command really needs rewriting or the required functionality 1231command really needs rewriting or the required functionality
1135exposed at either a command or interface level so a more friendly utility 1232exposed at either a command or interface level so a more friendly utility
1136(perl script or GUI) can handle things properly. 1233.Pq perl script or GUI
1234can handle things properly.
1137The scripts 1235The scripts
1138.Nm CA.sh 1236.Nm CA.sh
1139and 1237and
@@ -1174,7 +1272,7 @@ command on the same database can have unpredictable results.
1174The 1272The
1175.Ar copy_extensions 1273.Ar copy_extensions
1176option should be used with caution. 1274option should be used with caution.
1177If care is not taken then it can be a security risk. 1275If care is not taken, then it can be a security risk.
1178For example, if a certificate request contains a 1276For example, if a certificate request contains a
1179.Em basicConstraints 1277.Em basicConstraints
1180extension with CA:TRUE and the 1278extension with CA:TRUE and the
@@ -1204,7 +1302,7 @@ to prevent a request supplying its own values.
1204Additional restrictions can be placed on the CA certificate itself. 1302Additional restrictions can be placed on the CA certificate itself.
1205For example if the CA certificate has: 1303For example if the CA certificate has:
1206.Pp 1304.Pp
1207\& basicConstraints = CA:TRUE, pathlen:0 1305.D1 basicConstraints = CA:TRUE, pathlen:0
1208.Pp 1306.Pp
1209then even if a certificate is issued with CA:TRUE it will not be valid. 1307then even if a certificate is issued with CA:TRUE it will not be valid.
1210.\" 1308.\"
@@ -1213,10 +1311,8 @@ then even if a certificate is issued with CA:TRUE it will not be valid.
1213.Sh CIPHERS 1311.Sh CIPHERS
1214.Nm openssl ciphers 1312.Nm openssl ciphers
1215.Op Fl v 1313.Op Fl v
1216.Op Fl ssl2 1314.Op Fl ssl2 | ssl3 | tls1
1217.Op Fl ssl3 1315.Op Ar cipherlist
1218.Op Fl tls1
1219.Op Cm cipherlist
1220.Pp 1316.Pp
1221The 1317The
1222.Nm cipherlist 1318.Nm cipherlist
@@ -1230,9 +1326,9 @@ The options are as follows:
1230.It Fl v 1326.It Fl v
1231Verbose option. 1327Verbose option.
1232List ciphers with a complete description of protocol version 1328List ciphers with a complete description of protocol version
1233(SSLv2 or SSLv3; the latter includes TLS), key exchange, 1329.Pq SSLv2 or SSLv3; the latter includes TLS ,
1234authentication, encryption and mac algorithms used along with any key size 1330key exchange, authentication, encryption and mac algorithms used along with
1235restrictions and whether the algorithm is classed as an 1331any key size restrictions and whether the algorithm is classed as an
1236.Em export 1332.Em export
1237cipher. 1333cipher.
1238Note that without the 1334Note that without the
@@ -1240,15 +1336,15 @@ Note that without the
1240option, ciphers may seem to appear twice in a cipher list; 1336option, ciphers may seem to appear twice in a cipher list;
1241this is when similar ciphers are available for 1337this is when similar ciphers are available for
1242SSL v2 and for SSL v3/TLS v1. 1338SSL v2 and for SSL v3/TLS v1.
1243.It Fl ssl3
1244Only include SSL v3 ciphers.
1245.It Fl ssl2 1339.It Fl ssl2
1246Only include SSL v2 ciphers. 1340Only include SSL v2 ciphers.
1341.It Fl ssl3
1342Only include SSL v3 ciphers.
1247.It Fl tls1 1343.It Fl tls1
1248Only include TLS v1 ciphers. 1344Only include TLS v1 ciphers.
1249.It Fl h , ? 1345.It Fl h , \&?
1250Print a brief usage message. 1346Print a brief usage message.
1251.It Fl cipherlist 1347.It Ar cipherlist
1252A cipher list to convert to a cipher preference list. 1348A cipher list to convert to a cipher preference list.
1253If it is not included, then the default cipher list will be used. 1349If it is not included, then the default cipher list will be used.
1254The format is described below. 1350The format is described below.
@@ -1277,7 +1373,7 @@ represents all SSL v3 algorithms.
1277Lists of cipher suites can be combined in a single 1373Lists of cipher suites can be combined in a single
1278.Em cipher string 1374.Em cipher string
1279using the 1375using the
1280.Cm + 1376.Sq +
1281character. 1377character.
1282This is used as a logical 1378This is used as a logical
1283.Em and 1379.Em and
@@ -1287,32 +1383,33 @@ For example,
1287represents all cipher suites containing the SHA1 and the DES algorithms. 1383represents all cipher suites containing the SHA1 and the DES algorithms.
1288.Pp 1384.Pp
1289Each cipher string can be optionally preceded by the characters 1385Each cipher string can be optionally preceded by the characters
1290.Cm ! , - 1386.Sq \&! ,
1387.Sq - ,
1291or 1388or
1292.Cm + . 1389.Sq + .
1293.Pp 1390.Pp
1294If 1391If
1295.Cm ! 1392.Sq !\&
1296is used, then the ciphers are permanently deleted from the list. 1393is used, then the ciphers are permanently deleted from the list.
1297The ciphers deleted can never reappear in the list even if they are 1394The ciphers deleted can never reappear in the list even if they are
1298explicitly stated. 1395explicitly stated.
1299.Pp 1396.Pp
1300If 1397If
1301.Cm - 1398.Sq -
1302is used, then the ciphers are deleted from the list, but some or 1399is used, then the ciphers are deleted from the list, but some or
1303all of the ciphers can be added again by later options. 1400all of the ciphers can be added again by later options.
1304.Pp 1401.Pp
1305If 1402If
1306.Cm + 1403.Sq +
1307is used, then the ciphers are moved to the end of the list. 1404is used, then the ciphers are moved to the end of the list.
1308This option doesn't add any new ciphers, it just moves matching existing ones. 1405This option doesn't add any new ciphers, it just moves matching existing ones.
1309.Pp 1406.Pp
1310If none of these characters is present, then the string is just interpreted 1407If none of these characters is present, then the string is just interpreted
1311as a list of ciphers to be appended to the current preference list. 1408as a list of ciphers to be appended to the current preference list.
1312If the list includes any ciphers already present they will be ignored; 1409If the list includes any ciphers already present, they will be ignored;
1313that is, they will not be moved to the end of the list. 1410that is, they will not be moved to the end of the list.
1314.Pp 1411.Pp
1315Additionally the cipher string 1412Additionally, the cipher string
1316.Em @STRENGTH 1413.Em @STRENGTH
1317can be used at any point to sort the current cipher list in order of 1414can be used at any point to sort the current cipher list in order of
1318encryption algorithm key length. 1415encryption algorithm key length.
@@ -1349,29 +1446,35 @@ The cipher suites not enabled by
1349currently being 1446currently being
1350.Ar eNULL . 1447.Ar eNULL .
1351.It Ar HIGH 1448.It Ar HIGH
1352"High" encryption cipher suites. 1449.Qq High
1450encryption cipher suites.
1353This currently means those with key lengths larger than 128 bits. 1451This currently means those with key lengths larger than 128 bits.
1354.It Ar MEDIUM 1452.It Ar MEDIUM
1355"Medium" encryption cipher suites, currently those using 128 bit encryption. 1453.Qq Medium
1454encryption cipher suites, currently those using 128-bit encryption.
1356.It Ar LOW 1455.It Ar LOW
1357"Low" encryption cipher suites, currently those using 64 or 56 bit encryption 1456.Qq Low
1457encryption cipher suites, currently those using 64- or 56-bit encryption
1358algorithms, but excluding export cipher suites. 1458algorithms, but excluding export cipher suites.
1359.It Ar EXP , EXPORT 1459.It Ar EXP , EXPORT
1360Export encryption algorithms. 1460Export encryption algorithms.
1361Including 40 and 56 bits algorithms. 1461Including 40- and 56-bit algorithms.
1362.It Ar EXPORT40 1462.It Ar EXPORT40
136340 bit export encryption algorithms 146340-bit export encryption algorithms
1364.It Ar EXPORT56 1464.It Ar EXPORT56
136556 bit export encryption algorithms. 146556-bit export encryption algorithms.
1366.It Ar eNULL , NULL 1466.It Ar eNULL , NULL
1367The "NULL" ciphers; that is those offering no encryption. 1467The
1368Because these offer no encryption at all and are a security risk 1468.Qq NULL
1469ciphers; that is those offering no encryption.
1470Because these offer no encryption at all and are a security risk,
1369they are disabled unless explicitly included. 1471they are disabled unless explicitly included.
1370.It Ar aNULL 1472.It Ar aNULL
1371The cipher suites offering no authentication. 1473The cipher suites offering no authentication.
1372This is currently the anonymous DH algorithms. 1474This is currently the anonymous DH algorithms.
1373These cipher suites are vulnerable to a "man in the middle" 1475These cipher suites are vulnerable to a
1374attack and so their use is normally discouraged. 1476.Qq man in the middle
1477attack, so their use is normally discouraged.
1375.It Ar kRSA , RSA 1478.It Ar kRSA , RSA
1376Cipher suites using RSA key exchange. 1479Cipher suites using RSA key exchange.
1377.It Ar kEDH 1480.It Ar kEDH
@@ -1389,7 +1492,7 @@ Cipher suites effectively using DH authentication, i.e. the certificates carry
1389DH keys. 1492DH keys.
1390Not implemented. 1493Not implemented.
1391.It Ar kFZA , aFZA , eFZA , FZA 1494.It Ar kFZA , aFZA , eFZA , FZA
1392Ciphers suites using FORTEZZA key exchange, authentication, encryption 1495Cipher suites using FORTEZZA key exchange, authentication, encryption
1393or all FORTEZZA algorithms. 1496or all FORTEZZA algorithms.
1394Not implemented. 1497Not implemented.
1395.It Ar TLSv1 , SSLv3 , SSLv2 1498.It Ar TLSv1 , SSLv3 , SSLv2
@@ -1403,13 +1506,12 @@ Cipher suites using AES.
1403.It Ar 3DES 1506.It Ar 3DES
1404Cipher suites using triple DES. 1507Cipher suites using triple DES.
1405.It Ar DES 1508.It Ar DES
1406Cipher suites using DES (not triple DES). 1509Cipher suites using DES
1510.Pq not triple DES .
1407.It Ar RC4 1511.It Ar RC4
1408Cipher suites using RC4. 1512Cipher suites using RC4.
1409.It Ar RC2 1513.It Ar RC2
1410Cipher suites using RC2. 1514Cipher suites using RC2.
1411.It Ar IDEA
1412Cipher suites using IDEA.
1413.It Ar MD5 1515.It Ar MD5
1414Cipher suites using MD5. 1516Cipher suites using MD5.
1415.It Ar SHA1 , SHA 1517.It Ar SHA1 , SHA
@@ -1423,122 +1525,111 @@ equivalents.
1423It should be noted that several cipher suite names do not include the 1525It should be noted that several cipher suite names do not include the
1424authentication used, e.g. DES-CBC3-SHA. 1526authentication used, e.g. DES-CBC3-SHA.
1425In these cases, RSA authentication is used. 1527In these cases, RSA authentication is used.
1426.Pp 1528.Ss SSL v3.0 cipher suites
1427.Sy "SSL v3.0 cipher suites" 1529.Bd -unfilled -offset indent
1428.Bd -literal 1530SSL_RSA_WITH_NULL_MD5 NULL-MD5
1429 SSL_RSA_WITH_NULL_MD5 NULL-MD5 1531SSL_RSA_WITH_NULL_SHA NULL-SHA
1430 SSL_RSA_WITH_NULL_SHA NULL-SHA 1532SSL_RSA_EXPORT_WITH_RC4_40_MD5 EXP-RC4-MD5
1431 SSL_RSA_EXPORT_WITH_RC4_40_MD5 EXP-RC4-MD5 1533SSL_RSA_WITH_RC4_128_MD5 RC4-MD5
1432 SSL_RSA_WITH_RC4_128_MD5 RC4-MD5 1534SSL_RSA_WITH_RC4_128_SHA RC4-SHA
1433 SSL_RSA_WITH_RC4_128_SHA RC4-SHA 1535SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 EXP-RC2-CBC-MD5
1434 SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 EXP-RC2-CBC-MD5 1536SSL_RSA_WITH_IDEA_CBC_SHA IDEA-CBC-SHA
1435 SSL_RSA_WITH_IDEA_CBC_SHA IDEA-CBC-SHA 1537SSL_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-DES-CBC-SHA
1436 SSL_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-DES-CBC-SHA 1538SSL_RSA_WITH_DES_CBC_SHA DES-CBC-SHA
1437 SSL_RSA_WITH_DES_CBC_SHA DES-CBC-SHA 1539SSL_RSA_WITH_3DES_EDE_CBC_SHA DES-CBC3-SHA
1438 SSL_RSA_WITH_3DES_EDE_CBC_SHA DES-CBC3-SHA 1540
1439.Ed 1541SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA Not implemented.
1440.Bd -literal 1542SSL_DH_DSS_WITH_DES_CBC_SHA Not implemented.
1441 SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA Not implemented. 1543SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA Not implemented.
1442 SSL_DH_DSS_WITH_DES_CBC_SHA Not implemented. 1544SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA Not implemented.
1443 SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA Not implemented. 1545SSL_DH_RSA_WITH_DES_CBC_SHA Not implemented.
1444 SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA Not implemented. 1546SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA Not implemented.
1445 SSL_DH_RSA_WITH_DES_CBC_SHA Not implemented. 1547SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-DSS-DES-CBC-SHA
1446 SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA Not implemented. 1548SSL_DHE_DSS_WITH_DES_CBC_SHA EDH-DSS-CBC-SHA
1447 SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-DSS-DES-CBC-SHA 1549SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA EDH-DSS-DES-CBC3-SHA
1448 SSL_DHE_DSS_WITH_DES_CBC_SHA EDH-DSS-CBC-SHA 1550SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-RSA-DES-CBC-SHA
1449 SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA EDH-DSS-DES-CBC3-SHA 1551SSL_DHE_RSA_WITH_DES_CBC_SHA EDH-RSA-DES-CBC-SHA
1450 SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-RSA-DES-CBC-SHA 1552SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA EDH-RSA-DES-CBC3-SHA
1451 SSL_DHE_RSA_WITH_DES_CBC_SHA EDH-RSA-DES-CBC-SHA 1553
1452 SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA EDH-RSA-DES-CBC3-SHA 1554SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 EXP-ADH-RC4-MD5
1453.Ed 1555SSL_DH_anon_WITH_RC4_128_MD5 ADH-RC4-MD5
1454.Bd -literal 1556SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA EXP-ADH-DES-CBC-SHA
1455 SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 EXP-ADH-RC4-MD5 1557SSL_DH_anon_WITH_DES_CBC_SHA ADH-DES-CBC-SHA
1456 SSL_DH_anon_WITH_RC4_128_MD5 ADH-RC4-MD5 1558SSL_DH_anon_WITH_3DES_EDE_CBC_SHA ADH-DES-CBC3-SHA
1457 SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA EXP-ADH-DES-CBC-SHA 1559
1458 SSL_DH_anon_WITH_DES_CBC_SHA ADH-DES-CBC-SHA 1560SSL_FORTEZZA_KEA_WITH_NULL_SHA Not implemented.
1459 SSL_DH_anon_WITH_3DES_EDE_CBC_SHA ADH-DES-CBC3-SHA 1561SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA Not implemented.
1460.Ed 1562SSL_FORTEZZA_KEA_WITH_RC4_128_SHA Not implemented.
1461.Bd -literal
1462 SSL_FORTEZZA_KEA_WITH_NULL_SHA Not implemented.
1463 SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA Not implemented.
1464 SSL_FORTEZZA_KEA_WITH_RC4_128_SHA Not implemented.
1465.Ed
1466.Pp
1467.Sy "TLS v1.0 cipher suites"
1468.Bd -literal
1469 TLS_RSA_WITH_NULL_MD5 NULL-MD5
1470 TLS_RSA_WITH_NULL_SHA NULL-SHA
1471 TLS_RSA_EXPORT_WITH_RC4_40_MD5 EXP-RC4-MD5
1472 TLS_RSA_WITH_RC4_128_MD5 RC4-MD5
1473 TLS_RSA_WITH_RC4_128_SHA RC4-SHA
1474 TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 EXP-RC2-CBC-MD5
1475 TLS_RSA_WITH_IDEA_CBC_SHA IDEA-CBC-SHA
1476 TLS_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-DES-CBC-SHA
1477 TLS_RSA_WITH_DES_CBC_SHA DES-CBC-SHA
1478 TLS_RSA_WITH_3DES_EDE_CBC_SHA DES-CBC3-SHA
1479.Ed
1480.Bd -literal
1481 TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA Not implemented.
1482 TLS_DH_DSS_WITH_DES_CBC_SHA Not implemented.
1483 TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA Not implemented.
1484 TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA Not implemented.
1485 TLS_DH_RSA_WITH_DES_CBC_SHA Not implemented.
1486 TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA Not implemented.
1487 TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-DSS-DES-CBC-SHA
1488 TLS_DHE_DSS_WITH_DES_CBC_SHA EDH-DSS-CBC-SHA
1489 TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA EDH-DSS-DES-CBC3-SHA
1490 TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-RSA-DES-CBC-SHA
1491 TLS_DHE_RSA_WITH_DES_CBC_SHA EDH-RSA-DES-CBC-SHA
1492 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA EDH-RSA-DES-CBC3-SHA
1493.Ed 1563.Ed
1494.Bd -literal 1564.Ss TLS v1.0 cipher suites
1495 TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 EXP-ADH-RC4-MD5 1565.Bd -unfilled -offset indent
1496 TLS_DH_anon_WITH_RC4_128_MD5 ADH-RC4-MD5 1566TLS_RSA_WITH_NULL_MD5 NULL-MD5
1497 TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA EXP-ADH-DES-CBC-SHA 1567TLS_RSA_WITH_NULL_SHA NULL-SHA
1498 TLS_DH_anon_WITH_DES_CBC_SHA ADH-DES-CBC-SHA 1568TLS_RSA_EXPORT_WITH_RC4_40_MD5 EXP-RC4-MD5
1499 TLS_DH_anon_WITH_3DES_EDE_CBC_SHA ADH-DES-CBC3-SHA 1569TLS_RSA_WITH_RC4_128_MD5 RC4-MD5
1570TLS_RSA_WITH_RC4_128_SHA RC4-SHA
1571TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 EXP-RC2-CBC-MD5
1572TLS_RSA_WITH_IDEA_CBC_SHA IDEA-CBC-SHA
1573TLS_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-DES-CBC-SHA
1574TLS_RSA_WITH_DES_CBC_SHA DES-CBC-SHA
1575TLS_RSA_WITH_3DES_EDE_CBC_SHA DES-CBC3-SHA
1576
1577TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA Not implemented.
1578TLS_DH_DSS_WITH_DES_CBC_SHA Not implemented.
1579TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA Not implemented.
1580TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA Not implemented.
1581TLS_DH_RSA_WITH_DES_CBC_SHA Not implemented.
1582TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA Not implemented.
1583TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-DSS-DES-CBC-SHA
1584TLS_DHE_DSS_WITH_DES_CBC_SHA EDH-DSS-CBC-SHA
1585TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA EDH-DSS-DES-CBC3-SHA
1586TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-RSA-DES-CBC-SHA
1587TLS_DHE_RSA_WITH_DES_CBC_SHA EDH-RSA-DES-CBC-SHA
1588TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA EDH-RSA-DES-CBC3-SHA
1589
1590TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 EXP-ADH-RC4-MD5
1591TLS_DH_anon_WITH_RC4_128_MD5 ADH-RC4-MD5
1592TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA EXP-ADH-DES-CBC-SHA
1593TLS_DH_anon_WITH_DES_CBC_SHA ADH-DES-CBC-SHA
1594TLS_DH_anon_WITH_3DES_EDE_CBC_SHA ADH-DES-CBC3-SHA
1500.Ed 1595.Ed
1501.Pp 1596.Ss AES ciphersuites from RFC 3268, extending TLS v1.0
1502.Sy "AES ciphersuites from RFC 3268, extending TLS v1.0" 1597.Bd -unfilled -offset indent
1503.Bd -literal 1598TLS_RSA_WITH_AES_128_CBC_SHA AES128-SHA
1504 TLS_RSA_WITH_AES_128_CBC_SHA AES128-SHA 1599TLS_RSA_WITH_AES_256_CBC_SHA AES256-SHA
1505 TLS_RSA_WITH_AES_256_CBC_SHA AES256-SHA
1506 1600
1507 TLS_DH_DSS_WITH_AES_128_CBC_SHA DH-DSS-AES128-SHA 1601TLS_DH_DSS_WITH_AES_128_CBC_SHA DH-DSS-AES128-SHA
1508 TLS_DH_DSS_WITH_AES_256_CBC_SHA DH-DSS-AES256-SHA 1602TLS_DH_DSS_WITH_AES_256_CBC_SHA DH-DSS-AES256-SHA
1509 TLS_DH_RSA_WITH_AES_128_CBC_SHA DH-RSA-AES128-SHA 1603TLS_DH_RSA_WITH_AES_128_CBC_SHA DH-RSA-AES128-SHA
1510 TLS_DH_RSA_WITH_AES_256_CBC_SHA DH-RSA-AES256-SHA 1604TLS_DH_RSA_WITH_AES_256_CBC_SHA DH-RSA-AES256-SHA
1511 1605
1512 TLS_DHE_DSS_WITH_AES_128_CBC_SHA DHE-DSS-AES128-SHA 1606TLS_DHE_DSS_WITH_AES_128_CBC_SHA DHE-DSS-AES128-SHA
1513 TLS_DHE_DSS_WITH_AES_256_CBC_SHA DHE-DSS-AES256-SHA 1607TLS_DHE_DSS_WITH_AES_256_CBC_SHA DHE-DSS-AES256-SHA
1514 TLS_DHE_RSA_WITH_AES_128_CBC_SHA DHE-RSA-AES128-SHA 1608TLS_DHE_RSA_WITH_AES_128_CBC_SHA DHE-RSA-AES128-SHA
1515 TLS_DHE_RSA_WITH_AES_256_CBC_SHA DHE-RSA-AES256-SHA 1609TLS_DHE_RSA_WITH_AES_256_CBC_SHA DHE-RSA-AES256-SHA
1516 1610
1517 TLS_DH_anon_WITH_AES_128_CBC_SHA ADH-AES128-SHA 1611TLS_DH_anon_WITH_AES_128_CBC_SHA ADH-AES128-SHA
1518 TLS_DH_anon_WITH_AES_256_CBC_SHA ADH-AES256-SHA 1612TLS_DH_anon_WITH_AES_256_CBC_SHA ADH-AES256-SHA
1519.Ed 1613.Ed
1520.Pp 1614.Ss Additional Export 1024 and other cipher suites
1521.Sy "Additional Export 1024 and other cipher suites"
1522.Pp
1523.Sy Note : 1615.Sy Note :
1524These ciphers can also be used in SSL v3. 1616These ciphers can also be used in SSL v3.
1525.Bd -literal 1617.Bd -unfilled -offset indent
1526 TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA EXP1024-DES-CBC-SHA 1618TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA EXP1024-DES-CBC-SHA
1527 TLS_RSA_EXPORT1024_WITH_RC4_56_SHA EXP1024-RC4-SHA 1619TLS_RSA_EXPORT1024_WITH_RC4_56_SHA EXP1024-RC4-SHA
1528 TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA EXP1024-DHE-DSS-DES-CBC-SHA 1620TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA EXP1024-DHE-DSS-DES-CBC-SHA
1529 TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA EXP1024-DHE-DSS-RC4-SHA 1621TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA EXP1024-DHE-DSS-RC4-SHA
1530 TLS_DHE_DSS_WITH_RC4_128_SHA DHE-DSS-RC4-SHA 1622TLS_DHE_DSS_WITH_RC4_128_SHA DHE-DSS-RC4-SHA
1531.Ed 1623.Ed
1532.Pp 1624.Ss SSL v2.0 cipher suites
1533.Sy "SSL v2.0 cipher suites" 1625.Bd -unfilled -offset indent
1534.Bd -literal 1626SSL_CK_RC4_128_WITH_MD5 RC4-MD5
1535 SSL_CK_RC4_128_WITH_MD5 RC4-MD5 1627SSL_CK_RC4_128_EXPORT40_WITH_MD5 EXP-RC4-MD5
1536 SSL_CK_RC4_128_EXPORT40_WITH_MD5 EXP-RC4-MD5 1628SSL_CK_RC2_128_CBC_WITH_MD5 RC2-MD5
1537 SSL_CK_RC2_128_CBC_WITH_MD5 RC2-MD5 1629SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 EXP-RC2-MD5
1538 SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 EXP-RC2-MD5 1630SSL_CK_IDEA_128_CBC_WITH_MD5 IDEA-CBC-MD5
1539 SSL_CK_IDEA_128_CBC_WITH_MD5 IDEA-CBC-MD5 1631SSL_CK_DES_64_CBC_WITH_MD5 DES-CBC-MD5
1540 SSL_CK_DES_64_CBC_WITH_MD5 DES-CBC-MD5 1632SSL_CK_DES_192_EDE3_CBC_WITH_MD5 DES-CBC3-MD5
1541 SSL_CK_DES_192_EDE3_CBC_WITH_MD5 DES-CBC3-MD5
1542.Ed 1633.Ed
1543.Sh CIPHERS NOTES 1634.Sh CIPHERS NOTES
1544The non-ephemeral DH modes are currently unimplemented in 1635The non-ephemeral DH modes are currently unimplemented in
@@ -1554,25 +1645,25 @@ Verbose listing of all
1554.Nm OpenSSL 1645.Nm OpenSSL
1555ciphers including NULL ciphers: 1646ciphers including NULL ciphers:
1556.Pp 1647.Pp
1557\& $ openssl ciphers -v 'ALL:eNULL' 1648.Dl $ openssl ciphers -v 'ALL:eNULL'
1558.Pp 1649.Pp
1559Include all ciphers except NULL and anonymous DH then sort by 1650Include all ciphers except NULL and anonymous DH then sort by
1560strength: 1651strength:
1561.Pp 1652.Pp
1562\& $ openssl ciphers -v 'ALL:!ADH:@STRENGTH' 1653.Dl $ openssl ciphers -v 'ALL:!ADH:@STRENGTH'
1563.Pp 1654.Pp
1564Include only 3DES ciphers and then place RSA ciphers last: 1655Include only 3DES ciphers and then place RSA ciphers last:
1565.Pp 1656.Pp
1566\& $ openssl ciphers -v '3DES:+RSA' 1657.Dl $ openssl ciphers -v '3DES:+RSA'
1567.Pp 1658.Pp
1568Include all RC4 ciphers but leave out those without authentication: 1659Include all RC4 ciphers but leave out those without authentication:
1569.Pp 1660.Pp
1570\& $ openssl ciphers -v 'RC4:!COMPLEMENTOFDEFAULT' 1661.Dl $ openssl ciphers -v 'RC4:!COMPLEMENTOFDEFAULT'
1571.Pp 1662.Pp
1572Include all ciphers with RSA authentication but leave out ciphers without 1663Include all ciphers with RSA authentication but leave out ciphers without
1573encryption: 1664encryption:
1574.Pp 1665.Pp
1575\& $ openssl ciphers -v 'RSA:!COMPLEMENTOFALL' 1666.Dl $ openssl ciphers -v 'RSA:!COMPLEMENTOFALL'
1576.Sh CIPHERS HISTORY 1667.Sh CIPHERS HISTORY
1577The 1668The
1578.Ar COMPLENTOFALL 1669.Ar COMPLENTOFALL
@@ -1584,18 +1675,21 @@ selection options were added in version 0.9.7.
1584.\" 1675.\"
1585.Sh CRL 1676.Sh CRL
1586.Nm openssl crl 1677.Nm openssl crl
1587.Op Fl inform Ar PEM|DER 1678.Bk -words
1588.Op Fl outform Ar PEM|DER 1679.Op Fl inform Ar DER | PEM
1680.Op Fl outform Ar DER | PEM
1589.Op Fl text 1681.Op Fl text
1590.Op Fl in Ar filename 1682.Op Fl in Ar filename
1591.Op Fl out Ar filename 1683.Op Fl out Ar filename
1592.Op Fl noout 1684.Op Fl noout
1593.Op Fl hash 1685.Op Fl hash
1686.Op Fl fingerprint
1594.Op Fl issuer 1687.Op Fl issuer
1595.Op Fl lastupdate 1688.Op Fl lastupdate
1596.Op Fl nextupdate 1689.Op Fl nextupdate
1597.Op Cm CAfile Ar file 1690.Op Cm CAfile Ar file
1598.Op Cm CApath Ar dir 1691.Op Cm CApath Ar dir
1692.Ek
1599.Pp 1693.Pp
1600The 1694The
1601.Nm crl 1695.Nm crl
@@ -1607,14 +1701,14 @@ format.
1607.Pp 1701.Pp
1608The options are as follows: 1702The options are as follows:
1609.Bl -tag -width "XXXX" 1703.Bl -tag -width "XXXX"
1610.It Fl inform Ar DER|PEM 1704.It Fl inform Ar DER | PEM
1611This specifies the input format. 1705This specifies the input format.
1612.Ar DER 1706.Ar DER
1613format is DER encoded CRL structure. 1707format is a DER encoded CRL structure.
1614.Ar PEM 1708.Ar PEM
1615(the default) is a base64 encoded version of the DER form with header 1709.Pq the default
1616and footer lines. 1710is a base64 encoded version of the DER form with header and footer lines.
1617.It Fl outform Ar DER|PEM 1711.It Fl outform Ar DER | PEM
1618This specifies the output format; the options have the same meaning as the 1712This specifies the output format; the options have the same meaning as the
1619.Fl inform 1713.Fl inform
1620option. 1714option.
@@ -1631,6 +1725,8 @@ Don't output the encoded version of the CRL.
1631.It Fl hash 1725.It Fl hash
1632Output a hash of the issuer name. 1726Output a hash of the issuer name.
1633This can be used to lookup CRLs in a directory by issuer name. 1727This can be used to lookup CRLs in a directory by issuer name.
1728.It Fl fingerprint
1729Print the CRL fingerprint.
1634.It Fl issuer 1730.It Fl issuer
1635Output the issuer name. 1731Output the issuer name.
1636.It Fl lastupdate 1732.It Fl lastupdate
@@ -1654,9 +1750,9 @@ should be linked to each certificate.
1654.El 1750.El
1655.Sh CRL NOTES 1751.Sh CRL NOTES
1656The PEM CRL format uses the header and footer lines: 1752The PEM CRL format uses the header and footer lines:
1657.Bd -literal 1753.Bd -unfilled -offset indent
1658\& -----BEGIN X509 CRL----- 1754-----BEGIN X509 CRL-----
1659\& -----END X509 CRL----- 1755-----END X509 CRL-----
1660.Ed 1756.Ed
1661.Sh CRL EXAMPLES 1757.Sh CRL EXAMPLES
1662Convert a CRL file from 1758Convert a CRL file from
@@ -1664,23 +1760,23 @@ Convert a CRL file from
1664to 1760to
1665.Ar DER : 1761.Ar DER :
1666.Pp 1762.Pp
1667\& $ openssl crl -in crl.pem -outform DER -out crl.der 1763.Dl $ openssl crl -in crl.pem -outform DER -out crl.der
1668.Pp 1764.Pp
1669Output the text form of a 1765Output the text form of a
1670.Ar DER 1766.Ar DER
1671encoded certificate: 1767encoded certificate:
1672.Pp 1768.Pp
1673\& $ openssl crl -in crl.der -text -noout 1769.Dl $ openssl crl -in crl.der -text -noout
1674.Sh CRL BUGS 1770.Sh CRL BUGS
1675Ideally it should be possible to create a CRL using appropriate options 1771Ideally, it should be possible to create a CRL using appropriate options
1676and files too. 1772and files too.
1677.\" 1773.\"
1678.\" CRL2PKCS7 1774.\" CRL2PKCS7
1679.\" 1775.\"
1680.Sh CRL2PKCS7 1776.Sh CRL2PKCS7
1681.Nm openssl crl2pkcs7 1777.Nm openssl crl2pkcs7
1682.Op Fl inform Ar PEM|DER 1778.Op Fl inform Ar DER | PEM
1683.Op Fl outform Ar PEM|DER 1779.Op Fl outform Ar DER | PEM
1684.Op Fl in Ar filename 1780.Op Fl in Ar filename
1685.Op Fl out Ar filename 1781.Op Fl out Ar filename
1686.Op Fl certfile Ar filename 1782.Op Fl certfile Ar filename
@@ -1690,24 +1786,25 @@ The
1690.Nm crl2pkcs7 1786.Nm crl2pkcs7
1691command takes an optional CRL and one or more 1787command takes an optional CRL and one or more
1692certificates and converts them into a PKCS#7 degenerate 1788certificates and converts them into a PKCS#7 degenerate
1693"certificates only" structure. 1789.Qq certificates only
1790structure.
1694.Pp 1791.Pp
1695The options are as follows: 1792The options are as follows:
1696.Bl -tag -width "XXXX" 1793.Bl -tag -width "XXXX"
1697.It Fl inform Ar DER|PEM 1794.It Fl inform Ar DER | PEM
1698This specifies the CRL input format. 1795This specifies the CRL input format.
1699.Ar DER 1796.Ar DER
1700format is DER encoded CRL structure. 1797format is a DER encoded CRL structure.
1701.Ar PEM 1798.Ar PEM
1702(the default) is a base64 encoded version of the DER form with header 1799.Pq the default
1703and footer lines. 1800is a base64 encoded version of the DER form with header and footer lines.
1704.It Fl outform Ar DER|PEM 1801.It Fl outform Ar DER | PEM
1705This specifies the PKCS#7 structure output format. 1802This specifies the PKCS#7 structure output format.
1706.Ar DER 1803.Ar DER
1707format is DER encoded PKCS#7 structure. 1804format is a DER encoded PKCS#7 structure.
1708.Ar PEM 1805.Ar PEM
1709(the default) is a base64 encoded version of the DER form with header 1806.Pq the default
1710and footer lines. 1807is a base64 encoded version of the DER form with header and footer lines.
1711.It Fl in Ar filename 1808.It Fl in Ar filename
1712This specifies the input 1809This specifies the input
1713.Ar filename 1810.Ar filename
@@ -1723,25 +1820,25 @@ containing one or more certificates in
1723.Ar PEM 1820.Ar PEM
1724format. 1821format.
1725All certificates in the file will be added to the PKCS#7 structure. 1822All certificates in the file will be added to the PKCS#7 structure.
1726This option can be used more than once to read certificates form multiple 1823This option can be used more than once to read certificates from multiple
1727files. 1824files.
1728.It Fl nocrl 1825.It Fl nocrl
1729Normally a CRL is included in the output file. 1826Normally, a CRL is included in the output file.
1730With this option, no CRL is 1827With this option, no CRL is
1731included in the output file and a CRL is not read from the input file. 1828included in the output file and a CRL is not read from the input file.
1732.El 1829.El
1733.Sh CRL2PKCS7 EXAMPLES 1830.Sh CRL2PKCS7 EXAMPLES
1734Create a PKCS#7 structure from a certificate and CRL: 1831Create a PKCS#7 structure from a certificate and CRL:
1735.Pp 1832.Pp
1736\& $ openssl crl2pkcs7 -in crl.pem -certfile cert.pem -out p7.pem 1833.Dl $ openssl crl2pkcs7 -in crl.pem -certfile cert.pem -out p7.pem
1737.Pp 1834.Pp
1738Creates a PKCS#7 structure in 1835Create a PKCS#7 structure in
1739.Ar DER 1836.Ar DER
1740format with no CRL from several 1837format with no CRL from several
1741different certificates: 1838different certificates:
1742.Bd -literal 1839.Bd -literal -offset indent
1743\& $ openssl crl2pkcs7 -nocrl -certfile newcert.pem 1840$ openssl crl2pkcs7 -nocrl -certfile newcert.pem \e
1744\& -certfile demoCA/cacert.pem -outform DER -out p7.der 1841 -certfile demoCA/cacert.pem -outform DER -out p7.der
1745.Ed 1842.Ed
1746.Sh CRL2PKCS7 NOTES 1843.Sh CRL2PKCS7 NOTES
1747The output file is a PKCS#7 signed data structure containing no signers and 1844The output file is a PKCS#7 signed data structure containing no signers and
@@ -1762,7 +1859,11 @@ install user certificates and CAs in MSIE using the Xenroll control.
1762.\" 1859.\"
1763.Sh DGST 1860.Sh DGST
1764.Nm openssl dgst 1861.Nm openssl dgst
1765.Op Cm -md5|-md4|-md2|-sha1|-sha|-mdc2|-ripemd160|-dss1 1862.Bk -words
1863.Oo
1864.Fl md5 | md4 | md2 | sha1 |
1865.Fl sha | ripemd160 | dss1
1866.Oc
1766.Op Fl c 1867.Op Fl c
1767.Op Fl d 1868.Op Fl d
1768.Op Fl hex 1869.Op Fl hex
@@ -1773,9 +1874,16 @@ install user certificates and CAs in MSIE using the Xenroll control.
1773.Op Fl prverify Ar filename 1874.Op Fl prverify Ar filename
1774.Op Fl rand Ar file ... 1875.Op Fl rand Ar file ...
1775.Op Fl signature Ar filename 1876.Op Fl signature Ar filename
1877.Op Fl engine Ar id
1878.Op Fl keyform Ar PEM | ENGINE
1776.Op Ar file ... 1879.Op Ar file ...
1880.Ek
1777.Pp 1881.Pp
1778.Cm md5|md4|md2|sha1|sha|mdc2|ripemd160 1882.Nm openssl
1883.Xo
1884.Cm md5 | md4 | md2 | sha1 |
1885.Cm sha | ripemd160
1886.Xc
1779.Op Fl c 1887.Op Fl c
1780.Op Fl d 1888.Op Fl d
1781.Op Ar file ... 1889.Op Ar file ...
@@ -1790,14 +1898,15 @@ They can also be used for digital signing and verification.
1790The options are as follows: 1898The options are as follows:
1791.Bl -tag -width "XXXX" 1899.Bl -tag -width "XXXX"
1792.It Fl c 1900.It Fl c
1793Print out the digest in two digit groups separated by colons, only relevant if 1901Print out the digest in two-digit groups separated by colons; only relevant if
1794.Em hex 1902.Em hex
1795format output is used. 1903format output is used.
1796.It Fl d 1904.It Fl d
1797Print out BIO debugging information. 1905Print out BIO debugging information.
1798.It Fl hex 1906.It Fl hex
1799Digest is to be output as a hex dump. 1907Digest is to be output as a hex dump.
1800This is the default case for a "normal" 1908This is the default case for a
1909.Qq normal
1801digest as opposed to a digital signature. 1910digest as opposed to a digital signature.
1802.It Fl binary 1911.It Fl binary
1803Output the digest or signature in binary form. 1912Output the digest or signature in binary form.
@@ -1809,28 +1918,31 @@ Digitally sign the digest using the private key in
1809.It Fl verify Ar filename 1918.It Fl verify Ar filename
1810Verify the signature using the public key in 1919Verify the signature using the public key in
1811.Ar filename . 1920.Ar filename .
1812The output is either "Verification OK" or "Verification Failure". 1921The output is either
1922.Qq Verification OK
1923or
1924.Qq Verification Failure .
1813.It Fl prverify Ar filename 1925.It Fl prverify Ar filename
1814Verify the signature using the private key in 1926Verify the signature using the private key in
1815.Ar filename . 1927.Ar filename .
1816.It Fl rand Ar file ... 1928.It Fl rand Ar file ...
1817A 1929A file or files containing random data used to seed the random number
1818.Ar file
1819or
1820.Ar file Ns Li s
1821containing random data used to seed the random number
1822generator, or an EGD socket (see 1930generator, or an EGD socket (see
1823.Xr RAND_egd 3 ) . 1931.Xr RAND_egd 3 ) .
1824Multiple files can be specified separated by an OS-dependent character. 1932Multiple files can be specified separated by a
1825The separator is 1933.Sq \&: .
1826.Cm \&;
1827for MS-Windows,
1828.Cm \&,
1829for OpenVMS, and
1830.Cm \&:
1831for all others.
1832.It Fl signature Ar filename 1934.It Fl signature Ar filename
1833The actual signature to verify. 1935The actual signature to verify.
1936.It Fl engine Ar id
1937Specifying an engine (by it's unique
1938.Ar id
1939string) will cause
1940.Nm dgst
1941to attempt to obtain a functional reference to the specified engine,
1942thus initialising it if needed.
1943The engine will then be set as the default for all available algorithms.
1944.It Fl keyform Ar PEM | ENGINE
1945Key file format.
1834.It Ar file ... 1946.It Ar file ...
1835File or files to digest. 1947File or files to digest.
1836If no files are specified then standard input is used. 1948If no files are specified then standard input is used.
@@ -1839,7 +1951,7 @@ If no files are specified then standard input is used.
1839The digest of choice for all new applications is SHA1. 1951The digest of choice for all new applications is SHA1.
1840Other digests are, however, still widely used. 1952Other digests are, however, still widely used.
1841.Pp 1953.Pp
1842If you wish to sign or verify data using the DSA algorithm then the dss1 1954If you wish to sign or verify data using the DSA algorithm, then the dss1
1843digest must be used. 1955digest must be used.
1844.Pp 1956.Pp
1845A source of random numbers is required for certain signing algorithms, in 1957A source of random numbers is required for certain signing algorithms, in
@@ -1851,7 +1963,8 @@ being signed or verified.
1851.\" DH 1963.\" DH
1852.\" 1964.\"
1853.Sh DH 1965.Sh DH
1854Diffie-Hellman Parameter Management. The 1966Diffie-Hellman Parameter Management.
1967The
1855.Nm dh 1968.Nm dh
1856command has been replaced by 1969command has been replaced by
1857.Nm dhparam . 1970.Nm dhparam .
@@ -1864,16 +1977,15 @@ below.
1864.Sh DHPARAM 1977.Sh DHPARAM
1865.Nm openssl dhparam 1978.Nm openssl dhparam
1866.Bk -words 1979.Bk -words
1867.Op Fl inform Ar DER|PEM 1980.Op Fl inform Ar DER | PEM
1868.Op Fl outform Ar DER|PEM 1981.Op Fl outform Ar DER | PEM
1869.Op Fl in Ar filename 1982.Op Fl in Ar filename
1870.Op Fl out Ar filename 1983.Op Fl out Ar filename
1871.Op Fl dsaparam 1984.Op Fl dsaparam
1872.Op Fl noout 1985.Op Fl noout
1873.Op Fl text 1986.Op Fl text
1874.Op Fl C 1987.Op Fl C
1875.Op Fl 2 1988.Op Fl 2 | 5
1876.Op Fl 5
1877.Op Fl rand Ar file ... 1989.Op Fl rand Ar file ...
1878.Op Fl engine Ar id 1990.Op Fl engine Ar id
1879.Op Ar numbits 1991.Op Ar numbits
@@ -1885,7 +1997,7 @@ command is used to manipulate DH parameter files.
1885.Pp 1997.Pp
1886The options are as follows: 1998The options are as follows:
1887.Bl -tag -width "XXXX" 1999.Bl -tag -width "XXXX"
1888.It Fl inform Ar DER|PEM 2000.It Fl inform Ar DER | PEM
1889This specifies the input format. 2001This specifies the input format.
1890The argument 2002The argument
1891.Ar DER 2003.Ar DER
@@ -1896,8 +2008,8 @@ The
1896form is the default format: 2008form is the default format:
1897it consists of the DER format base64 encoded with 2009it consists of the DER format base64 encoded with
1898additional header and footer lines. 2010additional header and footer lines.
1899.It Fl outform Ar DER|PEM 2011.It Fl outform Ar DER | PEM
1900This specifies the output format, the options have the same meaning as the 2012This specifies the output format; the options have the same meaning as the
1901.Fl inform 2013.Fl inform
1902option. 2014option.
1903.It Fl in Ar filename 2015.It Fl in Ar filename
@@ -1915,7 +2027,10 @@ be the same as the input filename.
1915.It Fl dsaparam 2027.It Fl dsaparam
1916If this option is used, DSA rather than DH parameters are read or created; 2028If this option is used, DSA rather than DH parameters are read or created;
1917they are converted to DH format. 2029they are converted to DH format.
1918Otherwise, "strong" primes (such that (p-1)/2 is also prime) 2030Otherwise,
2031.Qq strong
2032primes
2033.Pq such that (p-1)/2 is also prime
1919will be used for DH parameter generation. 2034will be used for DH parameter generation.
1920.Pp 2035.Pp
1921DH parameter generation with the 2036DH parameter generation with the
@@ -1929,29 +2044,19 @@ avoid small-subgroup attacks that may be possible otherwise.
1929.It Fl 2 , 5 2044.It Fl 2 , 5
1930The generator to use, either 2 or 5. 2045The generator to use, either 2 or 5.
19312 is the default. 20462 is the default.
1932If present then the input file is ignored and parameters are generated instead. 2047If present, then the input file is ignored and parameters are generated instead.
1933.It Fl rand Ar file ... 2048.It Fl rand Ar file ...
1934A 2049A file or files containing random data used to seed the random number generator,
1935.Ar file
1936or
1937.Ar file Ns Li s
1938containing random data used to seed the random number generator,
1939or an EGD socket (see 2050or an EGD socket (see
1940.Xr RAND_egd 3 ) . 2051.Xr RAND_egd 3 ) .
1941Multiple files can be specified, separated by an OS-dependent character. 2052Multiple files can be specified, separated by a
1942The separator is 2053.Sq \&: .
1943.Cm \&;
1944for MS-Windows,
1945.Cm \&,
1946for OpenVMS, and
1947.Cm \&:
1948for all others.
1949.It Ar numbits 2054.It Ar numbits
1950This argument specifies that a parameter set should be generated of size 2055This argument specifies that a parameter set should be generated of size
1951.Ar numbits . 2056.Ar numbits .
1952It must be the last option. 2057It must be the last option.
1953If not present, then a value of 512 is used. 2058If not present, then a value of 512 is used.
1954If this value is present then the input file is ignored and 2059If this value is present, then the input file is ignored and
1955parameters are generated instead. 2060parameters are generated instead.
1956.It Fl noout 2061.It Fl noout
1957This option inhibits the output of the encoded version of the parameters. 2062This option inhibits the output of the encoded version of the parameters.
@@ -1966,7 +2071,7 @@ function.
1966Specifying an engine (by it's unique 2071Specifying an engine (by it's unique
1967.Ar id 2072.Ar id
1968string) will cause 2073string) will cause
1969.Nm req 2074.Nm dhparam
1970to attempt to obtain a functional reference to the specified engine, 2075to attempt to obtain a functional reference to the specified engine,
1971thus initialising it if needed. 2076thus initialising it if needed.
1972The engine will then be set as the default for all available algorithms. 2077The engine will then be set as the default for all available algorithms.
@@ -1992,9 +2097,9 @@ versions of
1992.Sh DHPARAM NOTES 2097.Sh DHPARAM NOTES
1993.Ar PEM 2098.Ar PEM
1994format DH parameters use the header and footer lines: 2099format DH parameters use the header and footer lines:
1995.Bd -literal 2100.Bd -unfilled -offset indent
1996\& -----BEGIN DH PARAMETERS----- 2101-----BEGIN DH PARAMETERS-----
1997\& -----END DH PARAMETERS----- 2102-----END DH PARAMETERS-----
1998.Ed 2103.Ed
1999.Pp 2104.Pp
2000.Nm OpenSSL 2105.Nm OpenSSL
@@ -2021,20 +2126,21 @@ option was added in
2021.Sh DSA 2126.Sh DSA
2022.Nm openssl dsa 2127.Nm openssl dsa
2023.Bk -words 2128.Bk -words
2024.Op Fl inform Ar PEM|DER 2129.Op Fl inform Ar DER | PEM
2025.Op Fl outform Ar PEM|DER 2130.Op Fl outform Ar DER | PEM
2026.Op Fl in Ar filename 2131.Op Fl in Ar filename
2027.Op Fl passin Ar arg 2132.Op Fl passin Ar arg
2028.Op Fl out Ar filename 2133.Op Fl out Ar filename
2029.Op Fl passout Ar arg 2134.Op Fl passout Ar arg
2030.Op Fl des 2135.Op Fl pubin
2031.Op Fl des3 2136.Op Fl pubout
2032.Op Fl idea 2137.Oo
2138.Fl des | des3 | aes128 | aes192 |
2139.Fl aes256
2140.Oc
2033.Op Fl text 2141.Op Fl text
2034.Op Fl noout 2142.Op Fl noout
2035.Op Fl modulus 2143.Op Fl modulus
2036.Op Fl pubin
2037.Op Fl pubout
2038.Op Fl engine Ar id 2144.Op Fl engine Ar id
2039.Ek 2145.Ek
2040.Pp 2146.Pp
@@ -2053,17 +2159,18 @@ command.
2053.Pp 2159.Pp
2054The options are as follows: 2160The options are as follows:
2055.Bl -tag -width "XXXX" 2161.Bl -tag -width "XXXX"
2056.It Fl inform Ar DER|PEM 2162.It Fl inform Ar DER | PEM
2057This specifies the input format. 2163This specifies the input format.
2058The 2164The
2059.Ar DER 2165.Ar DER
2060argument with a private key uses an ASN1 DER encoded form of an ASN.1 2166argument with a private key uses an ASN1 DER encoded form of an ASN.1
2061SEQUENCE consisting of the values of version (currently zero), p, q, g, 2167SEQUENCE consisting of the values of version
2062the public and private key components respectively as ASN.1 INTEGERs. 2168.Pq currently zero ,
2169p, q, g,
2170the public and private key components, respectively, as ASN.1 INTEGERs.
2063When used with a public key it uses a 2171When used with a public key it uses a
2064.Em SubjectPublicKeyInfo 2172.Em SubjectPublicKeyInfo
2065structure: 2173structure: it is an error if the key is not DSA.
2066It is an error if the key is not DSA.
2067.Pp 2174.Pp
2068The 2175The
2069.Ar PEM 2176.Ar PEM
@@ -2071,19 +2178,19 @@ form is the default format:
2071It consists of the DER format base64 2178It consists of the DER format base64
2072encoded with additional header and footer lines. 2179encoded with additional header and footer lines.
2073In the case of a private key, PKCS#8 format is also accepted. 2180In the case of a private key, PKCS#8 format is also accepted.
2074.It Fl outform Ar DER|PEM 2181.It Fl outform Ar DER | PEM
2075This specifies the output format, the options have the same meaning as the 2182This specifies the output format; the options have the same meaning as the
2076.Fl inform 2183.Fl inform
2077option. 2184option.
2078.It Fl in Ar filename 2185.It Fl in Ar filename
2079This specifies the input 2186This specifies the input
2080.Ar filename 2187.Ar filename
2081to read a key from or standard input if this option is not specified. 2188to read a key from or standard input if this option is not specified.
2082If the key is encrypted a pass phrase will be prompted for. 2189If the key is encrypted, a pass phrase will be prompted for.
2083.It Fl passin Ar arg 2190.It Fl passin Ar arg
2084The input file password source. 2191The input file password source.
2085For more information about the format of 2192For more information about the format of
2086.Ar arg 2193.Ar arg ,
2087see the 2194see the
2088.Sx PASS PHRASE ARGUMENTS 2195.Sx PASS PHRASE ARGUMENTS
2089section above. 2196section above.
@@ -2099,13 +2206,16 @@ be the same as the input filename.
2099.It Fl passout Ar arg 2206.It Fl passout Ar arg
2100The output file password source. 2207The output file password source.
2101For more information about the format of 2208For more information about the format of
2102.Ar arg 2209.Ar arg ,
2103see the 2210see the
2104.Sx PASS PHRASE ARGUMENTS 2211.Sx PASS PHRASE ARGUMENTS
2105section above. 2212section above.
2106.It Cm -des|-des3|-idea 2213.It Xo
2214.Fl des | des3 | aes128 |
2215.Fl aes192 | aes256
2216.Xc
2107These options encrypt the private key with the DES, triple DES, or the 2217These options encrypt the private key with the DES, triple DES, or the
2108IDEA ciphers, respectively, before outputting it. 2218AES ciphers, respectively, before outputting it.
2109A pass phrase is prompted for. 2219A pass phrase is prompted for.
2110If none of these options is specified, the key is written in plain text. 2220If none of these options is specified, the key is written in plain text.
2111This means that using the 2221This means that using the
@@ -2118,23 +2228,23 @@ These options can only be used with
2118.Ar PEM 2228.Ar PEM
2119format output files. 2229format output files.
2120.It Fl text 2230.It Fl text
2121Prints out the public, private key components and parameters. 2231Prints out the public/private key components and parameters.
2122.It Fl noout 2232.It Fl noout
2123This option prevents output of the encoded version of the key. 2233This option prevents output of the encoded version of the key.
2124.It Fl modulus 2234.It Fl modulus
2125This option prints out the value of the public key component of the key. 2235This option prints out the value of the public key component of the key.
2126.It Fl pubin 2236.It Fl pubin
2127By default a private key is read from the input file. 2237By default, a private key is read from the input file.
2128With this option a public key is read instead. 2238With this option a public key is read instead.
2129.It Fl pubout 2239.It Fl pubout
2130By default a private key is output. 2240By default, a private key is output.
2131With this option a public key will be output instead. 2241With this option a public key will be output instead.
2132This option is automatically set if the input is a public key. 2242This option is automatically set if the input is a public key.
2133.It Fl engine Ar id 2243.It Fl engine Ar id
2134Specifying an engine (by it's unique 2244Specifying an engine (by it's unique
2135.Ar id 2245.Ar id
2136string) will cause 2246string) will cause
2137.Nm req 2247.Nm dsa
2138to attempt to obtain a functional reference to the specified engine, 2248to attempt to obtain a functional reference to the specified engine,
2139thus initialising it if needed. 2249thus initialising it if needed.
2140The engine will then be set as the default for all available algorithms. 2250The engine will then be set as the default for all available algorithms.
@@ -2143,46 +2253,46 @@ The engine will then be set as the default for all available algorithms.
2143The 2253The
2144.Ar PEM 2254.Ar PEM
2145private key format uses the header and footer lines: 2255private key format uses the header and footer lines:
2146.Bd -literal 2256.Bd -unfilled -offset indent
2147\& -----BEGIN DSA PRIVATE KEY----- 2257-----BEGIN DSA PRIVATE KEY-----
2148\& -----END DSA PRIVATE KEY----- 2258-----END DSA PRIVATE KEY-----
2149.Ed 2259.Ed
2150.Pp 2260.Pp
2151The 2261The
2152.Ar PEM 2262.Ar PEM
2153public key format uses the header and footer lines: 2263public key format uses the header and footer lines:
2154.Bd -literal 2264.Bd -unfilled -offset indent
2155\& -----BEGIN PUBLIC KEY----- 2265-----BEGIN PUBLIC KEY-----
2156\& -----END PUBLIC KEY----- 2266-----END PUBLIC KEY-----
2157.Ed 2267.Ed
2158.Sh DSA EXAMPLES 2268.Sh DSA EXAMPLES
2159To remove the pass phrase on a DSA private key: 2269To remove the pass phrase on a DSA private key:
2160.Pp 2270.Pp
2161\& $ openssl dsa -in key.pem -out keyout.pem 2271.Dl $ openssl dsa -in key.pem -out keyout.pem
2162.Pp 2272.Pp
2163To encrypt a private key using triple DES: 2273To encrypt a private key using triple DES:
2164.Pp 2274.Pp
2165\& $ openssl dsa -in key.pem -des3 -out keyout.pem 2275.Dl $ openssl dsa -in key.pem -des3 -out keyout.pem
2166.Pp 2276.Pp
2167To convert a private key from PEM to DER format: 2277To convert a private key from PEM to DER format:
2168.Pp 2278.Pp
2169\& $ openssl dsa -in key.pem -outform DER -out keyout.der 2279.Dl $ openssl dsa -in key.pem -outform DER -out keyout.der
2170.Pp 2280.Pp
2171To print out the components of a private key to standard output: 2281To print out the components of a private key to standard output:
2172.Pp 2282.Pp
2173\& $ openssl dsa -in key.pem -text -noout 2283.Dl $ openssl dsa -in key.pem -text -noout
2174.Pp 2284.Pp
2175To just output the public part of a private key: 2285To just output the public part of a private key:
2176.Pp 2286.Pp
2177\& $ openssl dsa -in key.pem -pubout -out pubkey.pem 2287.Dl $ openssl dsa -in key.pem -pubout -out pubkey.pem
2178.\" 2288.\"
2179.\" DSAPARAM 2289.\" DSAPARAM
2180.\" 2290.\"
2181.Sh DSAPARAM 2291.Sh DSAPARAM
2182.Nm openssl dsaparam 2292.Nm openssl dsaparam
2183.Bk -words 2293.Bk -words
2184.Op Fl inform Ar DER|PEM 2294.Op Fl inform Ar DER | PEM
2185.Op Fl outform Ar DER|PEM 2295.Op Fl outform Ar DER | PEM
2186.Op Fl in Ar filename 2296.Op Fl in Ar filename
2187.Op Fl out Ar filename 2297.Op Fl out Ar filename
2188.Op Fl noout 2298.Op Fl noout
@@ -2196,22 +2306,23 @@ To just output the public part of a private key:
2196.Pp 2306.Pp
2197The 2307The
2198.Nm dsaparam 2308.Nm dsaparam
2199command is used to manipulate or generate \s-1DSA\s0 parameter files. 2309command is used to manipulate or generate DSA parameter files.
2200.Pp 2310.Pp
2201The options are as follows: 2311The options are as follows:
2202.Bl -tag -width "XXXX" 2312.Bl -tag -width "XXXX"
2203.It Fl inform Ar DER|PEM 2313.It Fl inform Ar DER | PEM
2204This specifies the input format. 2314This specifies the input format.
2205The 2315The
2206.Ar DER 2316.Ar DER
2207argument uses an ASN1 DER encoded form compatible with RFC 2459 (PKIX) 2317argument uses an ASN1 DER encoded form compatible with RFC 2459
2318.Pq PKIX
2208DSS-Parms that is a SEQUENCE consisting of p, q and g, respectively. 2319DSS-Parms that is a SEQUENCE consisting of p, q and g, respectively.
2209The 2320The
2210.Ar PEM 2321.Ar PEM
2211form is the default format: 2322form is the default format:
2212it consists of the DER format base64 encoded with additional header 2323it consists of the DER format base64 encoded with additional header
2213and footer lines. 2324and footer lines.
2214.It Fl outform Ar DER|PEM 2325.It Fl outform Ar DER | PEM
2215This specifies the output format; the options have the same meaning as the 2326This specifies the output format; the options have the same meaning as the
2216.Fl inform 2327.Fl inform
2217option. 2328option.
@@ -2221,7 +2332,7 @@ This specifies the input
2221to read parameters from, or standard input if this option is not specified. 2332to read parameters from, or standard input if this option is not specified.
2222If the 2333If the
2223.Ar numbits 2334.Ar numbits
2224parameter is included then this option will be ignored. 2335parameter is included, then this option will be ignored.
2225.It Fl out Ar filename 2336.It Fl out Ar filename
2226This specifies the output 2337This specifies the output
2227.Ar filename 2338.Ar filename
@@ -2243,31 +2354,23 @@ function.
2243This option will generate a DSA either using the specified or generated 2354This option will generate a DSA either using the specified or generated
2244parameters. 2355parameters.
2245.It Fl rand Ar file ... 2356.It Fl rand Ar file ...
2246A 2357A file or files containing random data used to seed the random number
2247.Ar file
2248or
2249.Ar file Ns Li s
2250containing random data used to seed the random number
2251generator, or an EGD socket (see 2358generator, or an EGD socket (see
2252.Xr RAND_egd 3 ) . 2359.Xr RAND_egd 3 ) .
2253Multiple files can be specified, separated by an OS-dependent character. 2360Multiple files can be specified, separated by a
2254The separator is 2361.Sq \&: .
2255.Cm \&;
2256for MS-Windows,
2257.Cm \&,
2258for OpenVMS, and
2259.Cm \&:
2260for all others.
2261.It Ar numbits 2362.It Ar numbits
2262This option specifies that a parameter set should be generated of size 2363This option specifies that a parameter set should be generated of size
2263.Ar numbits . 2364.Ar numbits .
2264It must be the last option. 2365It must be the last option.
2265If this option is included, then the input file (if any) is ignored. 2366If this option is included, then the input file
2367.Pq if any
2368is ignored.
2266.It Fl engine Ar id 2369.It Fl engine Ar id
2267Specifying an engine (by it's unique 2370Specifying an engine (by it's unique
2268.Ar id 2371.Ar id
2269string) will cause 2372string) will cause
2270.Nm req 2373.Nm dsaparam
2271to attempt to obtain a functional reference to the specified engine, 2374to attempt to obtain a functional reference to the specified engine,
2272thus initialising it if needed. 2375thus initialising it if needed.
2273The engine will then be set as the default for all available algorithms. 2376The engine will then be set as the default for all available algorithms.
@@ -2275,9 +2378,9 @@ The engine will then be set as the default for all available algorithms.
2275.Sh DSAPARAM NOTES 2378.Sh DSAPARAM NOTES
2276.Ar PEM 2379.Ar PEM
2277format DSA parameters use the header and footer lines: 2380format DSA parameters use the header and footer lines:
2278.Bd -literal 2381.Bd -unfilled -offset indent
2279\& -----BEGIN DSA PARAMETERS----- 2382-----BEGIN DSA PARAMETERS-----
2280\& -----END DSA PARAMETERS----- 2383-----END DSA PARAMETERS-----
2281.Ed 2384.Ed
2282.Pp 2385.Pp
2283DSA parameter generation is a slow process and as a result the same set of 2386DSA parameter generation is a slow process and as a result the same set of
@@ -2287,16 +2390,20 @@ DSA parameters is often used to generate several distinct keys.
2287.\" 2390.\"
2288.Sh ENC 2391.Sh ENC
2289.Nm openssl enc 2392.Nm openssl enc
2393.Bk -words
2290.Fl ciphername 2394.Fl ciphername
2291.Op Fl in Ar filename 2395.Op Fl in Ar filename
2292.Op Fl out Ar filename 2396.Op Fl out Ar filename
2293.Op Fl pass Ar arg 2397.Op Fl pass Ar arg
2398.Op Fl salt
2399.Op Fl nosalt
2294.Op Fl e 2400.Op Fl e
2295.Op Fl d 2401.Op Fl d
2296.Op Fl a 2402.Op Fl a
2297.Op Fl A 2403.Op Fl A
2298.Op Fl k Ar password 2404.Op Fl k Ar password
2299.Op Fl kfile Ar filename 2405.Op Fl kfile Ar filename
2406.Op Fl S Ar salt
2300.Op Fl K Ar key 2407.Op Fl K Ar key
2301.Op Fl iv Ar IV 2408.Op Fl iv Ar IV
2302.Op Fl p 2409.Op Fl p
@@ -2304,11 +2411,14 @@ DSA parameters is often used to generate several distinct keys.
2304.Op Fl bufsize Ar number 2411.Op Fl bufsize Ar number
2305.Op Fl nopad 2412.Op Fl nopad
2306.Op Fl debug 2413.Op Fl debug
2414.Op Fl engine Ar id
2415.Ek
2307.Pp 2416.Pp
2308The symmetric cipher commands allow data to be encrypted or decrypted 2417The symmetric cipher commands allow data to be encrypted or decrypted
2309using various block and stream ciphers using keys based on passwords 2418using various block and stream ciphers using keys based on passwords
2310or explicitly provided. Base64 encoding or decoding can also be performed 2419or explicitly provided.
2311either by itself or in addition to the encryption or decryption. 2420Base64 encoding or decoding can also be performed either by itself
2421or in addition to the encryption or decryption.
2312.Pp 2422.Pp
2313The options are as follows: 2423The options are as follows:
2314.Bl -tag -width "XXXX" 2424.Bl -tag -width "XXXX"
@@ -2323,7 +2433,7 @@ standard output by default.
2323.It Fl pass Ar arg 2433.It Fl pass Ar arg
2324The password source. 2434The password source.
2325For more information about the format of 2435For more information about the format of
2326.Ar arg 2436.Ar arg ,
2327see the 2437see the
2328.Sx PASS PHRASE ARGUMENTS 2438.Sx PASS PHRASE ARGUMENTS
2329section above. 2439section above.
@@ -2443,6 +2553,14 @@ Set the buffer size for I/O.
2443Disable standard block padding. 2553Disable standard block padding.
2444.It Fl debug 2554.It Fl debug
2445Debug the BIOs used for I/O. 2555Debug the BIOs used for I/O.
2556.It Fl engine Ar id
2557Specifying an engine (by it's unique
2558.Ar id
2559string) will cause
2560.Nm enc
2561to attempt to obtain a functional reference to the specified engine,
2562thus initialising it if needed.
2563The engine will then be set as the default for all available algorithms.
2446.El 2564.El
2447.Sh ENC NOTES 2565.Sh ENC NOTES
2448The program can be called either as 2566The program can be called either as
@@ -2493,111 +2611,109 @@ this allows a rudimentary integrity or password check to be performed.
2493However, since the chance of random data passing the test is 2611However, since the chance of random data passing the test is
2494better than 1 in 256, it isn't a very good test. 2612better than 1 in 256, it isn't a very good test.
2495.Pp 2613.Pp
2496If padding is disabled then the input data must be a multiple of the cipher 2614If padding is disabled, then the input data must be a multiple of the cipher
2497block length. 2615block length.
2498.Pp 2616.Pp
2499All RC2 ciphers have the same key and effective key length. 2617All RC2 ciphers have the same key and effective key length.
2500.Pp 2618.Pp
2501Blowfish and RC5 algorithms use a 128 bit key. 2619Blowfish and RC5 algorithms use a 128-bit key.
2502.Sh ENC SUPPORTED CIPHERS 2620.Sh ENC SUPPORTED CIPHERS
2503.Bd -literal 2621.Bd -unfilled -offset indent
2504\& base64 Base 64 2622aes-128-cbc 128-bit AES in CBC mode
2505.Ed 2623aes128 Alias for aes-128-cbc
2506.Bd -literal 2624aes-128-cfb 128-bit AES in CFB mode
2507\& bf-cbc Blowfish in CBC mode 2625aes-128-ecb 128-bit AES in ECB mode
2508\& bf Alias for bf-cbc 2626aes-128-ofb 128-bit AES in OFB mode
2509\& bf-cfb Blowfish in CFB mode 2627
2510\& bf-ecb Blowfish in ECB mode 2628aes-192-cbc 192-bit AES in CBC mode
2511\& bf-ofb Blowfish in OFB mode 2629aes192 Alias for aes-192-cbc
2512.Ed 2630aes-192-cfb 192-bit AES in CFB mode
2513.Bd -literal 2631aes-192-ecb 192-bit AES in ECB mode
2514\& cast-cbc CAST in CBC mode 2632aes-192-ofb 192-bit AES in OFB mode
2515\& cast Alias for cast-cbc 2633
2516\& cast5-cbc CAST5 in CBC mode 2634aes-256-cbc 256-bit AES in CBC mode
2517\& cast5-cfb CAST5 in CFB mode 2635aes256 Alias for aes-256-cbc
2518\& cast5-ecb CAST5 in ECB mode 2636aes-256-cfb 256-bit AES in CFB mode
2519\& cast5-ofb CAST5 in OFB mode 2637aes-256-ecb 256-bit AES in ECB mode
2520.Ed 2638aes-256-ofb 256-bit AES in OFB mode
2521.Bd -literal 2639
2522\& des-cbc DES in CBC mode 2640base64 Base 64
2523\& des Alias for des-cbc 2641
2524\& des-cfb DES in CBC mode 2642bf-cbc Blowfish in CBC mode
2525\& des-ofb DES in OFB mode 2643bf Alias for bf-cbc
2526\& des-ecb DES in ECB mode 2644blowfish Alias for bf-cbc
2527.Ed 2645bf-cfb Blowfish in CFB mode
2528.Bd -literal 2646bf-ecb Blowfish in ECB mode
2529\& des-ede-cbc Two key triple DES EDE in CBC mode 2647bf-ofb Blowfish in OFB mode
2530\& des-ede Alias for des-ede 2648
2531\& des-ede-cfb Two key triple DES EDE in CFB mode 2649cast-cbc CAST in CBC mode
2532\& des-ede-ofb Two key triple DES EDE in OFB mode 2650cast Alias for cast-cbc
2533.Ed 2651cast5-cbc CAST5 in CBC mode
2534.Bd -literal 2652cast5-cfb CAST5 in CFB mode
2535\& des-ede3-cbc Three key triple DES EDE in CBC mode 2653cast5-ecb CAST5 in ECB mode
2536\& des-ede3 Alias for des-ede3-cbc 2654cast5-ofb CAST5 in OFB mode
2537\& des3 Alias for des-ede3-cbc 2655
2538\& des-ede3-cfb Three key triple DES EDE CFB mode 2656des-cbc DES in CBC mode
2539\& des-ede3-ofb Three key triple DES EDE in OFB mode 2657des Alias for des-cbc
2540.Ed 2658des-cfb DES in CBC mode
2541.Bd -literal 2659des-ofb DES in OFB mode
2542\& desx DESX algorithm. 2660des-ecb DES in ECB mode
2543.Ed 2661
2544.Bd -literal 2662des-ede-cbc Two key triple DES EDE in CBC mode
2545\& idea-cbc IDEA algorithm in CBC mode 2663des-ede Alias for des-ede
2546\& idea same as idea-cbc 2664des-ede-cfb Two key triple DES EDE in CFB mode
2547\& idea-cfb IDEA in CFB mode 2665des-ede-ofb Two key triple DES EDE in OFB mode
2548\& idea-ecb IDEA in ECB mode 2666
2549\& idea-ofb IDEA in OFB mode 2667des-ede3-cbc Three key triple DES EDE in CBC mode
2550.Ed 2668des-ede3 Alias for des-ede3-cbc
2551.Bd -literal 2669des3 Alias for des-ede3-cbc
2552\& rc2-cbc 128 bit RC2 in CBC mode 2670des-ede3-cfb Three key triple DES EDE CFB mode
2553\& rc2 Alias for rc2-cbc 2671des-ede3-ofb Three key triple DES EDE in OFB mode
2554\& rc2-cfb 128 bit RC2 in CBC mode 2672
2555\& rc2-ecb 128 bit RC2 in CBC mode 2673desx-cbc DESX algorithm
2556\& rc2-ofb 128 bit RC2 in CBC mode 2674desx Alias for desx-cbc
2557\& rc2-64-cbc 64 bit RC2 in CBC mode 2675
2558\& rc2-40-cbc 40 bit RC2 in CBC mode 2676rc2-cbc 128-bit RC2 in CBC mode
2559.Ed 2677rc2 Alias for rc2-cbc
2560.Bd -literal 2678rc2-cfb 128-bit RC2 in CBC mode
2561\& rc4 128 bit RC4 2679rc2-ecb 128-bit RC2 in CBC mode
2562\& rc4-64 64 bit RC4 2680rc2-ofb 128-bit RC2 in CBC mode
2563\& rc4-40 40 bit RC4 2681rc2-64-cbc 64-bit RC2 in CBC mode
2564.Ed 2682rc2-40-cbc 40-bit RC2 in CBC mode
2565.Bd -literal 2683
2566\& rc5-cbc RC5 cipher in CBC mode 2684rc4 128-bit RC4
2567\& rc5 Alias for rc5-cbc 2685rc4-40 40-bit RC4
2568\& rc5-cfb RC5 cipher in CBC mode
2569\& rc5-ecb RC5 cipher in CBC mode
2570\& rc5-ofb RC5 cipher in CBC mode
2571.Ed 2686.Ed
2572.Sh ENC EXAMPLES 2687.Sh ENC EXAMPLES
2573Just base64 encode a binary file: 2688Just base64 encode a binary file:
2574.Pp 2689.Pp
2575\& $ openssl base64 -in file.bin -out file.b64 2690.Dl $ openssl base64 -in file.bin -out file.b64
2576.Pp 2691.Pp
2577Decode the same file: 2692Decode the same file:
2578.Pp 2693.Pp
2579\& $ openssl base64 -d -in file.b64 -out file.bin 2694.Dl $ openssl base64 -d -in file.b64 -out file.bin
2580.Pp 2695.Pp
2581Encrypt a file using triple DES in CBC mode using a prompted password: 2696Encrypt a file using triple DES in CBC mode using a prompted password:
2582.Pp 2697.Pp
2583\& $ openssl des3 -salt -in file.txt -out file.des3 2698.Dl $ openssl des3 -salt -in file.txt -out file.des3
2584.Pp 2699.Pp
2585Decrypt a file using a supplied password: 2700Decrypt a file using a supplied password:
2586.Pp 2701.Pp
2587\& $ openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword 2702.Dl "$ openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword"
2588.Pp 2703.Pp
2589Encrypt a file then base64 encode it (so it can be sent via mail for example) 2704Encrypt a file then base64 encode it
2705(so it can be sent via mail for example)
2590using Blowfish in CBC mode: 2706using Blowfish in CBC mode:
2591.Pp 2707.Pp
2592\& $ openssl bf -a -salt -in file.txt -out file.bf 2708.Dl $ openssl bf -a -salt -in file.txt -out file.bf
2593.Pp 2709.Pp
2594Base64 decode a file then decrypt it: 2710Base64 decode a file then decrypt it:
2595.Pp 2711.Pp
2596\& $ openssl bf -d -salt -a -in file.bf -out file.txt 2712.Dl "$ openssl bf -d -salt -a -in file.bf -out file.txt"
2597.Pp 2713.Pp
2598Decrypt some data using a supplied 40 bit RC4 key: 2714Decrypt some data using a supplied 40-bit RC4 key:
2599.Pp 2715.Pp
2600\& $ openssl rc4-40 -in file.rc4 -out file.txt -K 0102030405 2716.Dl $ openssl rc4-40 -in file.rc4 -out file.txt -K 0102030405
2601.Sh ENC BUGS 2717.Sh ENC BUGS
2602The 2718The
2603.Fl A 2719.Fl A
@@ -2616,12 +2732,13 @@ or RC4 with an 84-bit key with this program.
2616.Sh ERRSTR 2732.Sh ERRSTR
2617The 2733The
2618.Nm errstr 2734.Nm errstr
2619utility is undocumented. 2735utility is currently undocumented.
2620.\" 2736.\"
2621.\" GENDH 2737.\" GENDH
2622.\" 2738.\"
2623.Sh GENDH 2739.Sh GENDH
2624Generation of Diffie-Hellman Parameters. Replaced by 2740Generation of Diffie-Hellman Parameters.
2741Replaced by
2625.Nm dhparam . 2742.Nm dhparam .
2626See 2743See
2627.Sx DHPARAM 2744.Sx DHPARAM
@@ -2631,49 +2748,45 @@ above.
2631.\" 2748.\"
2632.Sh GENDSA 2749.Sh GENDSA
2633.Nm openssl gendsa 2750.Nm openssl gendsa
2751.Bk -words
2634.Op Fl out Ar filename 2752.Op Fl out Ar filename
2635.Op Fl des
2636.Op Fl des3
2637.Op Fl idea
2638.Op Fl rand Ar file ... 2753.Op Fl rand Ar file ...
2639.Op Fl engine Ar id 2754.Op Fl engine Ar id
2755.Oo
2756.Fl des | des3 | aes128 |
2757.Fl aes192 | aes256
2758.Oc
2640.Op Ar paramfile 2759.Op Ar paramfile
2760.Ek
2641.Pp 2761.Pp
2642The 2762The
2643.Nm gendsa 2763.Nm gendsa
2644command generates a DSA private key from a DSA parameter file 2764command generates a DSA private key from a DSA parameter file
2645(which will be typically generated by the 2765(which will typically be generated by the
2646.Nm openssl dsaparam 2766.Nm openssl dsaparam
2647command). 2767command).
2648.Pp 2768.Pp
2649The options are as follows: 2769The options are as follows:
2650.Bl -tag -width "XXXX" 2770.Bl -tag -width "XXXX"
2651.It Cm -des|-des3|-idea 2771.It Xo
2772.Fl des | des3 | aes128 |
2773.Fl aes192 | aes256
2774.Xc
2652These options encrypt the private key with the DES, triple DES, 2775These options encrypt the private key with the DES, triple DES,
2653or the IDEA ciphers, respectively, before outputting it. 2776or the AES ciphers, respectively, before outputting it.
2654A pass phrase is prompted for. 2777A pass phrase is prompted for.
2655If none of these options is specified, no encryption is used. 2778If none of these options is specified, no encryption is used.
2656.It Fl rand Ar file ... 2779.It Fl rand Ar file ...
2657A 2780A file or files containing random data used to seed the random number
2658.Ar file
2659or
2660.Ar file Ns Li s
2661containing random data used to seed the random number
2662generator, or an EGD socket (see 2781generator, or an EGD socket (see
2663.Xr RAND_egd 3 ) . 2782.Xr RAND_egd 3 ) .
2664Multiple files can be specified separated by an OS-dependent character. 2783Multiple files can be specified separated by a
2665The separator is 2784.Sq \&: .
2666.Cm \&;
2667for MS-Windows,
2668.Cm \&,
2669for OpenVMS, and
2670.Cm \&:
2671for all others.
2672.It Fl engine Ar id 2785.It Fl engine Ar id
2673Specifying an engine (by it's unique 2786Specifying an engine (by it's unique
2674.Ar id 2787.Ar id
2675string) will cause 2788string) will cause
2676.Nm req 2789.Nm gendsa
2677to attempt to obtain a functional reference to the specified engine, 2790to attempt to obtain a functional reference to the specified engine,
2678thus initialising it if needed. 2791thus initialising it if needed.
2679The engine will then be set as the default for all available algorithms. 2792The engine will then be set as the default for all available algorithms.
@@ -2692,16 +2805,18 @@ much quicker that RSA key generation for example.
2692.\" 2805.\"
2693.Sh GENRSA 2806.Sh GENRSA
2694.Nm openssl genrsa 2807.Nm openssl genrsa
2808.Bk -words
2809.Oo
2810.Fl des | des3 | aes128 |
2811.Fl aes192 | aes256
2812.Oc
2695.Op Fl out Ar filename 2813.Op Fl out Ar filename
2696.Op Fl passout Ar arg 2814.Op Fl passout Ar arg
2697.Op Fl des 2815.Op Fl f4 | 3
2698.Op Fl des3
2699.Op Fl idea
2700.Op Fl f4
2701.Op Fl 3
2702.Op Fl rand Ar file ... 2816.Op Fl rand Ar file ...
2703.Op Fl engine Ar id 2817.Op Fl engine Ar id
2704.Op Ar numbits 2818.Op Ar numbits
2819.Ek
2705.Pp 2820.Pp
2706The 2821The
2707.Nm genrsa 2822.Nm genrsa
@@ -2716,42 +2831,36 @@ If this argument is not specified then standard output is used.
2716.It Fl passout Ar arg 2831.It Fl passout Ar arg
2717The output file password source. 2832The output file password source.
2718For more information about the format of 2833For more information about the format of
2719.Ar arg 2834.Ar arg ,
2720see the 2835see the
2721.Sx PASS PHRASE ARGUMENTS 2836.Sx PASS PHRASE ARGUMENTS
2722section above. 2837section above.
2723.It Cm -des|-des3|-idea 2838.It Xo
2839.Fl des | des3 | aes128 |
2840.Fl aes192 | aes256
2841.Xc
2724These options encrypt the private key with the DES, triple DES, or the 2842These options encrypt the private key with the DES, triple DES, or the
2725IDEA ciphers, respectively, before outputting it. 2843AES ciphers, respectively, before outputting it.
2726If none of these options is specified, no encryption is used. 2844If none of these options is specified, no encryption is used.
2727If encryption is used a pass phrase is prompted for, 2845If encryption is used a pass phrase is prompted for,
2728if it is not supplied via the 2846if it is not supplied via the
2729.Fl passout 2847.Fl passout
2730option. 2848option.
2731.It Cm -F4|-3 2849.It Fl F4 | 3
2732The public exponent to use, either 65537 or 3. 2850The public exponent to use, either 65537 or 3.
2733The default is 65537. 2851The default is 65537.
2734.It Fl rand Ar file ... 2852.It Fl rand Ar file ...
2735A 2853A file or files
2736.Ar file
2737or
2738.Ar file Ns Li s
2739containing random data used to seed the random number 2854containing random data used to seed the random number
2740generator, or an EGD socket (see 2855generator, or an EGD socket (see
2741.Xr RAND_egd 3 ) . 2856.Xr RAND_egd 3 ) .
2742Multiple files can be specified separated by an OS-dependent character. 2857Multiple files can be specified separated by a
2743The separator is 2858.Sq \&: .
2744.Cm \&;
2745for MS-Windows,
2746.Cm \&,
2747for OpenVMS, and
2748.Cm \&:
2749for all others.
2750.It Fl engine Ar id 2859.It Fl engine Ar id
2751Specifying an engine (by it's unique 2860Specifying an engine (by it's unique
2752.Ar id 2861.Ar id
2753string) will cause 2862string) will cause
2754.Nm req 2863.Nm genrsa
2755to attempt to obtain a functional reference to the specified engine, 2864to attempt to obtain a functional reference to the specified engine,
2756thus initialising it if needed. 2865thus initialising it if needed.
2757The engine will then be set as the default for all available algorithms. 2866The engine will then be set as the default for all available algorithms.
@@ -2766,12 +2875,12 @@ numbers.
2766When generating a private key, various symbols will be output to 2875When generating a private key, various symbols will be output to
2767indicate the progress of the generation. 2876indicate the progress of the generation.
2768A 2877A
2769.Em \&. 2878.Sq \&.
2770represents each number which has passed an initial sieve test, 2879represents each number which has passed an initial sieve test;
2771.Em \&+ 2880.Sq +
2772means a number has passed a single round of the Miller-Rabin primality test. 2881means a number has passed a single round of the Miller-Rabin primality test.
2773A newline means that the number has passed all the prime tests 2882A newline means that the number has passed all the prime tests
2774(the actual number depends on the key size). 2883.Pq the actual number depends on the key size .
2775.Pp 2884.Pp
2776Because key generation is a random process the time taken to generate a key 2885Because key generation is a random process the time taken to generate a key
2777may vary somewhat. 2886may vary somewhat.
@@ -2780,7 +2889,8 @@ A quirk of the prime generation algorithm is that it cannot generate small
2780primes. 2889primes.
2781Therefore the number of bits should not be less that 64. 2890Therefore the number of bits should not be less that 64.
2782For typical private keys this will not matter because for security reasons 2891For typical private keys this will not matter because for security reasons
2783they will be much larger (typically 1024 bits). 2892they will be much larger
2893.Pq typically 1024 bits .
2784.\" 2894.\"
2785.\" NSEQ 2895.\" NSEQ
2786.\" 2896.\"
@@ -2808,7 +2918,7 @@ Specifies the output
2808.Ar filename 2918.Ar filename
2809or standard output by default. 2919or standard output by default.
2810.It Fl toseq 2920.It Fl toseq
2811Normally a Netscape certificate sequence will be input and the output 2921Normally, a Netscape certificate sequence will be input and the output
2812is the certificates contained in it. 2922is the certificates contained in it.
2813With the 2923With the
2814.Fl toseq 2924.Fl toseq
@@ -2818,20 +2928,20 @@ a Netscape certificate sequence is created from a file of certificates.
2818.Sh NSEQ EXAMPLES 2928.Sh NSEQ EXAMPLES
2819Output the certificates in a Netscape certificate sequence: 2929Output the certificates in a Netscape certificate sequence:
2820.Bd -literal 2930.Bd -literal
2821\& $ openssl nseq -in nseq.pem -out certs.pem 2931.Dl $ openssl nseq -in nseq.pem -out certs.pem
2822.Ed 2932.Ed
2823.Pp 2933.Pp
2824Create a Netscape certificate sequence: 2934Create a Netscape certificate sequence:
2825.Bd -literal 2935.Bd -literal
2826\& $ openssl nseq -in certs.pem -toseq -out nseq.pem 2936.Dl $ openssl nseq -in certs.pem -toseq -out nseq.pem
2827.Ed 2937.Ed
2828.Sh NSEQ NOTES 2938.Sh NSEQ NOTES
2829The 2939The
2830.Em PEM 2940.Em PEM
2831encoded form uses the same headers and footers as a certificate: 2941encoded form uses the same headers and footers as a certificate:
2832.Bd -literal 2942.Bd -unfilled -offset indent
2833\& -----BEGIN CERTIFICATE----- 2943-----BEGIN CERTIFICATE-----
2834\& -----END CERTIFICATE----- 2944-----END CERTIFICATE-----
2835.Ed 2945.Ed
2836.Pp 2946.Pp
2837A Netscape certificate sequence is a Netscape specific form that can be sent 2947A Netscape certificate sequence is a Netscape specific form that can be sent
@@ -2870,7 +2980,10 @@ input and output files and allowing multiple certificate files to be used.
2870.Op Fl nonce 2980.Op Fl nonce
2871.Op Fl no_nonce 2981.Op Fl no_nonce
2872.Op Fl url Ar URL 2982.Op Fl url Ar URL
2873.Op Fl host Ar host:n 2983.Oo
2984.Fl host
2985.Ar hostname Ns : Ns Ar port
2986.Oc
2874.Op Fl path 2987.Op Fl path
2875.Op Fl CApath Ar dir 2988.Op Fl CApath Ar dir
2876.Op Fl CAfile Ar file 2989.Op Fl CAfile Ar file
@@ -2898,15 +3011,19 @@ input and output files and allowing multiple certificate files to be used.
2898.Op Fl nrequest Ar n 3011.Op Fl nrequest Ar n
2899.Ek 3012.Ek
2900.Pp 3013.Pp
2901The Online Certificate Status Protocol (OCSP) enables applications to 3014The Online Certificate Status Protocol
2902determine the (revocation) state of an identified certificate (RFC 2560). 3015.Pq OCSP
3016enables applications to determine the
3017.Pq revocation
3018state of an identified certificate
3019.Pq RFC 2560 .
2903.Pp 3020.Pp
2904The 3021The
2905.Nm ocsp 3022.Nm ocsp
2906command performs many common OCSP tasks. 3023command performs many common OCSP tasks.
2907It can be used to print out requests and responses, 3024It can be used to print out requests and responses,
2908create requests and send queries to an OCSP responder and behave like 3025create requests and send queries to an OCSP responder,
2909a mini OCSP server itself. 3026and behave like a mini OCSP server itself.
2910.Pp 3027.Pp
2911The options are as follows: 3028The options are as follows:
2912.Bl -tag -width "XXXX" 3029.Bl -tag -width "XXXX"
@@ -2936,8 +3053,10 @@ option except the certificate with serial number
2936.Ar num 3053.Ar num
2937is added to the request. 3054is added to the request.
2938The serial number is interpreted as a decimal integer unless preceded by 3055The serial number is interpreted as a decimal integer unless preceded by
2939.Em 0x . 3056.Sq 0x .
2940Negative integers can also be specified by preceding the value by a `-' sign. 3057Negative integers can also be specified by preceding the value with a
3058.Sq -
3059sign.
2941.It Fl signer Ar filename , Fl signkey Ar filename 3060.It Fl signer Ar filename , Fl signkey Ar filename
2942Sign the OCSP request using the certificate specified in the 3061Sign the OCSP request using the certificate specified in the
2943.Fl signer 3062.Fl signer
@@ -2946,9 +3065,9 @@ option and the private key specified by the
2946option. 3065option.
2947If the 3066If the
2948.Fl signkey 3067.Fl signkey
2949option is not present then the private key is read from the same file 3068option is not present, then the private key is read from the same file
2950as the certificate. 3069as the certificate.
2951If neither option is specified then the OCSP request is not signed. 3070If neither option is specified, then the OCSP request is not signed.
2952.It Fl sign_other Ar filename 3071.It Fl sign_other Ar filename
2953Additional certificates to include in the signed request. 3072Additional certificates to include in the signed request.
2954.It Fl nonce , no_nonce 3073.It Fl nonce , no_nonce
@@ -2977,7 +3096,7 @@ is automatically added; specifying
2977.Fl no_nonce 3096.Fl no_nonce
2978overrides this. 3097overrides this.
2979.It Fl req_text , resp_text , text 3098.It Fl req_text , resp_text , text
2980Print out the text form of the OCSP request, response or both, respectively. 3099Print out the text form of the OCSP request, response, or both, respectively.
2981.It Fl reqout Ar file , Fl respout Ar file 3100.It Fl reqout Ar file , Fl respout Ar file
2982Write out the DER encoded certificate request or response to 3101Write out the DER encoded certificate request or response to
2983.Ar file . 3102.Ar file .
@@ -2993,8 +3112,13 @@ and
2993options). 3112options).
2994.It Fl url Ar responder_url 3113.It Fl url Ar responder_url
2995Specify the responder URL. 3114Specify the responder URL.
2996Both HTTP and HTTPS (SSL/TLS) URLs can be specified. 3115Both HTTP and HTTPS
2997.It Fl host Ar hostname:port , Fl path Ar pathname 3116.Pq SSL/TLS
3117URLs can be specified.
3118.It Xo
3119.Fl host Ar hostname Ns : Ns Ar port ,
3120.Fl path Ar pathname
3121.Xc
2998If the 3122If the
2999.Fl host 3123.Fl host
3000option is present, then the OCSP request is sent to the host 3124option is present, then the OCSP request is sent to the host
@@ -3002,7 +3126,9 @@ option is present, then the OCSP request is sent to the host
3002on port 3126on port
3003.Ar port . 3127.Ar port .
3004.Fl path 3128.Fl path
3005specifies the HTTP path name to use, or "/" by default. 3129specifies the HTTP path name to use, or
3130.Sq /
3131by default.
3006.It Fl CAfile Ar file , Fl CApath Ar pathname 3132.It Fl CAfile Ar file , Fl CApath Ar pathname
3007.Ar file 3133.Ar file
3008or 3134or
@@ -3049,16 +3175,16 @@ Don't check the signature on the OCSP response.
3049Since this option tolerates invalid signatures on OCSP responses, 3175Since this option tolerates invalid signatures on OCSP responses,
3050it will normally only be used for testing purposes. 3176it will normally only be used for testing purposes.
3051.It Fl no_cert_verify 3177.It Fl no_cert_verify
3052Don't verify the OCSP response signers certificate at all. 3178Don't verify the OCSP response signer's certificate at all.
3053Since this option allows the OCSP response to be signed by any certificate, 3179Since this option allows the OCSP response to be signed by any certificate,
3054it should only be used for testing purposes. 3180it should only be used for testing purposes.
3055.It Fl no_chain 3181.It Fl no_chain
3056Do not use certificates in the response as additional untrusted CA 3182Do not use certificates in the response as additional untrusted CA
3057certificates. 3183certificates.
3058.It Fl no_cert_checks 3184.It Fl no_cert_checks
3059Don't perform any additional checks on the OCSP response signers certificate. 3185Don't perform any additional checks on the OCSP response signer's certificate.
3060That is, do not make any checks to see if the signers certificate is authorised 3186That is, do not make any checks to see if the signer's certificate is
3061to provide the necessary status information: 3187authorised to provide the necessary status information:
3062as a result this option should only be used for testing purposes. 3188as a result this option should only be used for testing purposes.
3063.It Fl validity_period Ar nsec , Fl status_age Ar age 3189.It Fl validity_period Ar nsec , Fl status_age Ar age
3064These options specify the range of times, in seconds, which will be tolerated 3190These options specify the range of times, in seconds, which will be tolerated
@@ -3079,14 +3205,14 @@ the default value is 5 minutes.
3079.Pp 3205.Pp
3080If the 3206If the
3081.Em notAfter 3207.Em notAfter
3082time is omitted from a response then this means that new status 3208time is omitted from a response, then this means that new status
3083information is immediately available. 3209information is immediately available.
3084In this case the age of the 3210In this case the age of the
3085.Em notBefore 3211.Em notBefore
3086field is checked to see it is not older than 3212field is checked to see it is not older than
3087.Ar age 3213.Ar age
3088seconds old. 3214seconds old.
3089By default this additional check is not performed. 3215By default, this additional check is not performed.
3090.El 3216.El
3091.Sh OCSP SERVER OPTIONS 3217.Sh OCSP SERVER OPTIONS
3092.Bl -tag -width "XXXX" 3218.Bl -tag -width "XXXX"
@@ -3139,7 +3265,7 @@ Identify the signer certificate using the key ID,
3139default is to use the subject name. 3265default is to use the subject name.
3140.It Fl rkey Ar file 3266.It Fl rkey Ar file
3141The private key to sign OCSP responses with; 3267The private key to sign OCSP responses with;
3142if not present the file specified in the 3268if not present, the file specified in the
3143.Fl rsigner 3269.Fl rsigner
3144option is used. 3270option is used.
3145.It Fl port Ar portnum 3271.It Fl port Ar portnum
@@ -3159,9 +3285,9 @@ or
3159when fresh revocation information is available: used in the 3285when fresh revocation information is available: used in the
3160.Ar nextUpdate 3286.Ar nextUpdate
3161field. 3287field.
3162If neither option is present then the 3288If neither option is present, then the
3163.Em nextUpdate 3289.Em nextUpdate
3164field is omitted meaning fresh revocation information is immediately available. 3290field is omitted, meaning fresh revocation information is immediately available.
3165.El 3291.El
3166.Sh OCSP RESPONSE VERIFICATION 3292.Sh OCSP RESPONSE VERIFICATION
3167OCSP Response follows the rules specified in RFC 2560. 3293OCSP Response follows the rules specified in RFC 2560.
@@ -3181,7 +3307,7 @@ options or they will be looked for in the standard
3181certificates 3307certificates
3182directory. 3308directory.
3183.Pp 3309.Pp
3184If the initial verify fails then the OCSP verify process halts with an 3310If the initial verify fails, then the OCSP verify process halts with an
3185error. 3311error.
3186.Pp 3312.Pp
3187Otherwise the issuing CA certificate in the request is compared to the OCSP 3313Otherwise the issuing CA certificate in the request is compared to the OCSP
@@ -3192,34 +3318,37 @@ CA certificate in the request.
3192If there is a match and the OCSPSigning extended key usage is present 3318If there is a match and the OCSPSigning extended key usage is present
3193in the OCSP responder certificate, then the OCSP verify succeeds. 3319in the OCSP responder certificate, then the OCSP verify succeeds.
3194.Pp 3320.Pp
3195Otherwise the root CA of the OCSP responders CA is checked to see if it 3321Otherwise the root CA of the OCSP responder's CA is checked to see if it
3196is trusted for OCSP signing. 3322is trusted for OCSP signing.
3197If it is, the OCSP verify succeeds. 3323If it is, the OCSP verify succeeds.
3198.Pp 3324.Pp
3199If none of these checks is successful then the OCSP verify fails. 3325If none of these checks is successful, then the OCSP verify fails.
3200.Pp 3326.Pp
3201What this effectively means is that if the OCSP responder certificate is 3327What this effectively means is that if the OCSP responder certificate is
3202authorised directly by the CA it is issuing revocation information about 3328authorised directly by the CA it is issuing revocation information about
3203(and it is correctly configured) then verification will succeed. 3329.Pq and it is correctly configured ,
3330then verification will succeed.
3204.Pp 3331.Pp
3205If the OCSP responder is a 3332If the OCSP responder is a
3206.Em global responder 3333.Em global responder
3207which can give details about multiple CAs and has its own separate 3334which can give details about multiple CAs and has its own separate
3208certificate chain, then its root CA can be trusted for OCSP signing. 3335certificate chain, then its root CA can be trusted for OCSP signing.
3209For example: 3336For example:
3210.Bd -literal 3337.Bd -literal -offset indent
3211\& $ openssl x509 -in ocspCA.pem -addtrust OCSPSigning -out trustedCA.pem 3338$ openssl x509 -in ocspCA.pem -addtrust OCSPSigning \e
3339 -out trustedCA.pem
3212.Ed 3340.Ed
3213.Pp 3341.Pp
3214Alternatively the responder certificate itself can be explicitly trusted 3342Alternatively, the responder certificate itself can be explicitly trusted
3215with the 3343with the
3216.Fl VAfile 3344.Fl VAfile
3217option. 3345option.
3218.Sh OCSP NOTES 3346.Sh OCSP NOTES
3219As noted, most of the verify options are for testing or debugging purposes. 3347As noted, most of the verify options are for testing or debugging purposes.
3220Normally only the 3348Normally, only the
3221.Fl CApath , CAfile 3349.Fl CApath , CAfile
3222and (if the responder is a 'global VA') 3350and
3351.Pq if the responder is a `global VA'
3223.Fl VAfile 3352.Fl VAfile
3224options need to be used. 3353options need to be used.
3225.Pp 3354.Pp
@@ -3243,49 +3372,48 @@ and
3243options. 3372options.
3244.Sh OCSP EXAMPLES 3373.Sh OCSP EXAMPLES
3245Create an OCSP request and write it to a file: 3374Create an OCSP request and write it to a file:
3246.Bd -literal 3375.Bd -literal -offset indent
3247\& $ openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem -reqout \e 3376$ openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \e
3248 req.der 3377 -reqout req.der
3249.Ed 3378.Ed
3250.Pp 3379.Pp
3251Send a query to an OCSP responder with URL 3380Send a query to an OCSP responder with URL
3252.Pa http://ocsp.myhost.com/ , 3381.Pa http://ocsp.myhost.com/ ,
3253save the response to a file and print it out in text form: 3382save the response to a file and print it out in text form:
3254.Bd -literal 3383.Bd -literal -offset indent
3255\& $ openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \e 3384$ openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \e
3256\& -url http://ocsp.myhost.com/ -resp_text -respout resp.der 3385 -url http://ocsp.myhost.com/ -resp_text -respout resp.der
3257.Ed 3386.Ed
3258.Pp 3387.Pp
3259Read in an OCSP response and print out text form: 3388Read in an OCSP response and print out text form:
3260.Bd -literal 3389.Pp
3261\& $ openssl ocsp -respin resp.der -text 3390.Dl $ openssl ocsp -respin resp.der -text
3262.Ed
3263.Pp 3391.Pp
3264OCSP server on port 8888 using a standard 3392OCSP server on port 8888 using a standard
3265.Nm ca 3393.Nm ca
3266configuration, and a separate responder certificate. 3394configuration, and a separate responder certificate.
3267All requests and responses are printed to a file: 3395All requests and responses are printed to a file:
3268.Bd -literal 3396.Bd -literal -offset indent
3269\& $ openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem \e 3397$ openssl ocsp -index demoCA/index.txt -port 8888 -rsigner \e
3270 -CA demoCA/cacert.pem -text -out log.txt 3398 rcert.pem -CA demoCA/cacert.pem -text -out log.txt
3271.Ed 3399.Ed
3272.Pp 3400.Pp
3273As above, but exit after processing one request: 3401As above, but exit after processing one request:
3274.Bd -literal 3402.Bd -literal -offset indent
3275\& $ openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem \e 3403$ openssl ocsp -index demoCA/index.txt -port 8888 -rsigner \e
3276 -CA demoCA/cacert.pem -nrequest 1 3404 rcert.pem -CA demoCA/cacert.pem -nrequest 1
3277.Ed 3405.Ed
3278.Pp 3406.Pp
3279Query status information using internally generated request: 3407Query status information using internally generated request:
3280.Bd -literal 3408.Bd -literal -offset indent
3281\& $ openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA \e 3409$ openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA \e
3282 demoCA/cacert.pem -issuer demoCA/cacert.pem -serial 1 3410 demoCA/cacert.pem -issuer demoCA/cacert.pem -serial 1
3283.Ed 3411.Ed
3284.Pp 3412.Pp
3285Query status information using request read from a file, write response to a 3413Query status information using request read from a file, write response to a
3286second file: 3414second file:
3287.Bd -literal 3415.Bd -literal -offset indent
3288\& $ openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA \e 3416$ openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA \e
3289 demoCA/cacert.pem -reqin req.der -respout resp.der 3417 demoCA/cacert.pem -reqin req.der -respout resp.der
3290.Ed 3418.Ed
3291.\" 3419.\"
@@ -3302,6 +3430,7 @@ second file:
3302.Op Fl noverify 3430.Op Fl noverify
3303.Op Fl quiet 3431.Op Fl quiet
3304.Op Fl table 3432.Op Fl table
3433.Op Fl reverse
3305.Op Ar password 3434.Op Ar password
3306.Pp 3435.Pp
3307The 3436The
@@ -3315,9 +3444,13 @@ for option
3315from stdin for option 3444from stdin for option
3316.Fl stdin , 3445.Fl stdin ,
3317or from the command line, or from the terminal otherwise. 3446or from the command line, or from the terminal otherwise.
3318The Unix standard algorithm 3447The
3448.Ux
3449standard algorithm
3319.Em crypt 3450.Em crypt
3320and the MD5-based BSD password algorithm 3451and the MD5-based
3452.Bx
3453password algorithm
3321.Em 1 3454.Em 1
3322and its Apache variant 3455and its Apache variant
3323.Em apr1 3456.Em apr1
@@ -3328,14 +3461,20 @@ The options are as follows:
3328.It Fl crypt 3461.It Fl crypt
3329Use the 3462Use the
3330.Em crypt 3463.Em crypt
3331algorithm (default). 3464algorithm
3465.Pq default .
3332.It Fl 1 3466.It Fl 1
3333Use the MD5 based BSD password algorithm 3467Use the MD5 based
3468.Bx
3469password algorithm
3334.Em 1 . 3470.Em 1 .
3335.It Fl apr1 3471.It Fl apr1
3336Use the 3472Use the
3337.Em apr1 3473.Em apr1
3338algorithm (Apache variant of the BSD algorithm). 3474algorithm
3475.Pq Apache variant of the
3476.Bx
3477algorithm.
3339.It Fl salt Ar string 3478.It Fl salt Ar string
3340Use the specified 3479Use the specified
3341.Ar salt . 3480.Ar salt .
@@ -3350,31 +3489,33 @@ Read passwords from
3350.It Fl noverify 3489.It Fl noverify
3351Don't verify when reading a password from the terminal. 3490Don't verify when reading a password from the terminal.
3352.It Fl quiet 3491.It Fl quiet
3353Don't output warnings when passwords given at the command line are truncated. 3492Don't output warnings when passwords given on the command line are truncated.
3354.It Fl table 3493.It Fl table
3355In the output list, prepend the cleartext password and a TAB character 3494In the output list, prepend the cleartext password and a TAB character
3356to each password hash. 3495to each password hash.
3496.It Fl reverse
3497Switch table columns.
3357.El 3498.El
3358.Sh PASSWD EXAMPLES 3499.Sh PASSWD EXAMPLES
3359.Bl -tag -width "XXXX" 3500.Dl $ openssl passwd -crypt -salt xx password
3360.It $ openssl passwd -crypt -salt xx password
3361prints 3501prints
3362.Em xxj31ZMTZzkVA . 3502.Qq xxj31ZMTZzkVA .
3363.It $ openssl passwd -1 -salt xxxxxxxx password 3503.Pp
3504.Dl $ openssl passwd -1 -salt xxxxxxxx password
3364prints 3505prints
3365.Em $1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a. . 3506.Qq $1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a. .
3366.It $ openssl passwd -apr1 -salt xxxxxxxx password 3507.Pp
3508.Dl $ openssl passwd -apr1 -salt xxxxxxxx password
3367prints 3509prints
3368.Em $apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0 . 3510.Qq $apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0 .
3369.El
3370.\" 3511.\"
3371.\" PKCS7 3512.\" PKCS7
3372.\" 3513.\"
3373.Sh PKCS7 3514.Sh PKCS7
3374.Nm openssl pkcs7 3515.Nm openssl pkcs7
3375.Bk -words 3516.Bk -words
3376.Op Fl inform Ar PEM|DER 3517.Op Fl inform Ar DER | PEM
3377.Op Fl outform Ar PEM|DER 3518.Op Fl outform Ar DER | PEM
3378.Op Fl in Ar filename 3519.Op Fl in Ar filename
3379.Op Fl out Ar filename 3520.Op Fl out Ar filename
3380.Op Fl print_certs 3521.Op Fl print_certs
@@ -3393,15 +3534,15 @@ format.
3393.Pp 3534.Pp
3394The options are as follows: 3535The options are as follows:
3395.Bl -tag -width "XXXX" 3536.Bl -tag -width "XXXX"
3396.It Fl inform Ar DER|PEM 3537.It Fl inform Ar DER | PEM
3397This specifies the input format. 3538This specifies the input format.
3398.Ar DER 3539.Ar DER
3399format is DER encoded PKCS#7 v1.5 structure. 3540format is a DER encoded PKCS#7 v1.5 structure.
3400.Ar PEM 3541.Ar PEM
3401(the default) is a base64 encoded version of the DER form with header 3542.Pq the default
3402and footer lines. 3543is a base64 encoded version of the DER form with header and footer lines.
3403.It Fl outform Ar DER|PEM 3544.It Fl outform Ar DER | PEM
3404This specifies the output format, the options have the same meaning as the 3545This specifies the output format; the options have the same meaning as the
3405.Fl inform 3546.Fl inform
3406option. 3547option.
3407.It Fl in Ar filename 3548.It Fl in Ar filename
@@ -3427,7 +3568,7 @@ is set).
3427Specifying an engine (by it's unique 3568Specifying an engine (by it's unique
3428.Ar id 3569.Ar id
3429string) will cause 3570string) will cause
3430.Nm req 3571.Nm pkcs7
3431to attempt to obtain a functional reference to the specified engine, 3572to attempt to obtain a functional reference to the specified engine,
3432thus initialising it if needed. 3573thus initialising it if needed.
3433The engine will then be set as the default for all available algorithms. 3574The engine will then be set as the default for all available algorithms.
@@ -3438,24 +3579,24 @@ Convert a PKCS#7 file from
3438to 3579to
3439.Em DER : 3580.Em DER :
3440.Pp 3581.Pp
3441\& $ openssl pkcs7 -in file.pem -outform DER -out file.der 3582.Dl $ openssl pkcs7 -in file.pem -outform DER -out file.der
3442.Pp 3583.Pp
3443Output all certificates in a file: 3584Output all certificates in a file:
3444.Pp 3585.Pp
3445\& $ openssl pkcs7 -in file.pem -print_certs -out certs.pem 3586.Dl $ openssl pkcs7 -in file.pem -print_certs -out certs.pem
3446.Sh PKCS7 NOTES 3587.Sh PKCS7 NOTES
3447The 3588The
3448.Em PEM 3589.Em PEM
3449PKCS#7 format uses the header and footer lines: 3590PKCS#7 format uses the header and footer lines:
3450.Bd -literal 3591.Bd -unfilled -offset indent
3451\& -----BEGIN PKCS7----- 3592-----BEGIN PKCS7-----
3452\& -----END PKCS7----- 3593-----END PKCS7-----
3453.Ed 3594.Ed
3454.Pp 3595.Pp
3455For compatibility with some CAs it will also accept: 3596For compatibility with some CAs it will also accept:
3456.Bd -literal 3597.Bd -unfilled -offset indent
3457\& -----BEGIN CERTIFICATE----- 3598-----BEGIN CERTIFICATE-----
3458\& -----END CERTIFICATE----- 3599-----END CERTIFICATE-----
3459.Ed 3600.Ed
3460.Sh PKCS7 RESTRICTIONS 3601.Sh PKCS7 RESTRICTIONS
3461There is no option to print out all the fields of a PKCS#7 file. 3602There is no option to print out all the fields of a PKCS#7 file.
@@ -3469,8 +3610,8 @@ They cannot currently parse, for example, the new CMS as described in RFC 2630.
3469.Nm openssl pkcs8 3610.Nm openssl pkcs8
3470.Bk -words 3611.Bk -words
3471.Op Fl topk8 3612.Op Fl topk8
3472.Op Fl inform Ar PEM|DER 3613.Op Fl inform Ar DER | PEM
3473.Op Fl outform Ar PEM|DER 3614.Op Fl outform Ar DER | PEM
3474.Op Fl in Ar filename 3615.Op Fl in Ar filename
3475.Op Fl passin Ar arg 3616.Op Fl passin Ar arg
3476.Op Fl out Ar filename 3617.Op Fl out Ar filename
@@ -3490,18 +3631,19 @@ The
3490command processes private keys in PKCS#8 format. 3631command processes private keys in PKCS#8 format.
3491It can handle both unencrypted PKCS#8 PrivateKeyInfo format 3632It can handle both unencrypted PKCS#8 PrivateKeyInfo format
3492and EncryptedPrivateKeyInfo format with a variety of PKCS#5 3633and EncryptedPrivateKeyInfo format with a variety of PKCS#5
3493(v1.5 and v2.0) and PKCS#12 algorithms. 3634.Pq v1.5 and v2.0
3635and PKCS#12 algorithms.
3494.Pp 3636.Pp
3495The options are as follows: 3637The options are as follows:
3496.Bl -tag -width "XXXX" 3638.Bl -tag -width "XXXX"
3497.It Fl topk8 3639.It Fl topk8
3498Normally a PKCS#8 private key is expected on input and a traditional format 3640Normally, a PKCS#8 private key is expected on input and a traditional format
3499private key will be written. 3641private key will be written.
3500With the 3642With the
3501.Fl topk8 3643.Fl topk8
3502option the situation is reversed: 3644option the situation is reversed:
3503it reads a traditional format private key and writes a PKCS#8 format key. 3645it reads a traditional format private key and writes a PKCS#8 format key.
3504.It Fl inform Ar DER|PEM 3646.It Fl inform Ar DER | PEM
3505This specifies the input format. 3647This specifies the input format.
3506If a PKCS#8 format key is expected on input, 3648If a PKCS#8 format key is expected on input,
3507then either a 3649then either a
@@ -3514,19 +3656,19 @@ Otherwise the
3514or 3656or
3515.Em PEM 3657.Em PEM
3516format of the traditional format private key is used. 3658format of the traditional format private key is used.
3517.It Fl outform Ar DER|PEM 3659.It Fl outform Ar DER | PEM
3518This specifies the output format, the options have the same meaning as the 3660This specifies the output format; the options have the same meaning as the
3519.Fl inform 3661.Fl inform
3520option. 3662option.
3521.It Fl in Ar filename 3663.It Fl in Ar filename
3522This specifies the input 3664This specifies the input
3523.Ar filename 3665.Ar filename
3524to read a key from or standard input if this option is not specified. 3666to read a key from or standard input if this option is not specified.
3525If the key is encrypted a pass phrase will be prompted for. 3667If the key is encrypted, a pass phrase will be prompted for.
3526.It Fl passin Ar arg 3668.It Fl passin Ar arg
3527The input file password source. 3669The input file password source.
3528For more information about the format of 3670For more information about the format of
3529.Ar arg 3671.Ar arg ,
3530see the 3672see the
3531.Sx PASS PHRASE ARGUMENTS 3673.Sx PASS PHRASE ARGUMENTS
3532section above. 3674section above.
@@ -3541,7 +3683,7 @@ be the same as the input filename.
3541.It Fl passout Ar arg 3683.It Fl passout Ar arg
3542The output file password source. 3684The output file password source.
3543For more information about the format of 3685For more information about the format of
3544.Ar arg 3686.Ar arg ,
3545see the 3687see the
3546.Sx PASS PHRASE ARGUMENTS 3688.Sx PASS PHRASE ARGUMENTS
3547section above. 3689section above.
@@ -3579,15 +3721,15 @@ The
3579contains a SEQUENCE consisting of the public and private keys, respectively. 3721contains a SEQUENCE consisting of the public and private keys, respectively.
3580.It Fl v2 Ar alg 3722.It Fl v2 Ar alg
3581This option enables the use of PKCS#5 v2.0 algorithms. 3723This option enables the use of PKCS#5 v2.0 algorithms.
3582Normally PKCS#8 private keys are encrypted with the password based 3724Normally, PKCS#8 private keys are encrypted with the password based
3583encryption algorithm called 3725encryption algorithm called
3584.Em pbeWithMD5AndDES-CBC ; 3726.Em pbeWithMD5AndDES-CBC ;
3585this uses 56 bit DES encryption but it was the strongest encryption 3727this uses 56-bit DES encryption but it was the strongest encryption
3586algorithm supported in PKCS#5 v1.5. 3728algorithm supported in PKCS#5 v1.5.
3587Using the 3729Using the
3588.Fl v2 3730.Fl v2
3589option PKCS#5 v2.0 algorithms are used which can use any 3731option PKCS#5 v2.0 algorithms are used which can use any
3590encryption algorithm such as 168 bit triple DES or 128 bit RC2, however 3732encryption algorithm such as 168-bit triple DES or 128-bit RC2, however
3591not many implementations support PKCS#5 v2.0 yet. 3733not many implementations support PKCS#5 v2.0 yet.
3592If using private keys with 3734If using private keys with
3593.Nm OpenSSL 3735.Nm OpenSSL
@@ -3609,7 +3751,7 @@ A complete list of possible algorithms is included below.
3609Specifying an engine (by it's unique 3751Specifying an engine (by it's unique
3610.Ar id 3752.Ar id
3611string) will cause 3753string) will cause
3612.Nm req 3754.Nm pkcs8
3613to attempt to obtain a functional reference to the specified engine, 3755to attempt to obtain a functional reference to the specified engine,
3614thus initialising it if needed. 3756thus initialising it if needed.
3615The engine will then be set as the default for all available algorithms. 3757The engine will then be set as the default for all available algorithms.
@@ -3619,15 +3761,15 @@ The encrypted form of a
3619.Em PEM 3761.Em PEM
3620encoded PKCS#8 file uses the following 3762encoded PKCS#8 file uses the following
3621headers and footers: 3763headers and footers:
3622.Bd -literal 3764.Bd -unfilled -offset indent
3623\& -----BEGIN ENCRYPTED PRIVATE KEY----- 3765-----BEGIN ENCRYPTED PRIVATE KEY-----
3624\& -----END ENCRYPTED PRIVATE KEY----- 3766-----END ENCRYPTED PRIVATE KEY-----
3625.Ed 3767.Ed
3626.Pp 3768.Pp
3627The unencrypted form uses: 3769The unencrypted form uses:
3628.Bd -literal 3770.Bd -unfilled -offset indent
3629\& -----BEGIN PRIVATE KEY----- 3771-----BEGIN PRIVATE KEY-----
3630\& -----END PRIVATE KEY----- 3772-----END PRIVATE KEY-----
3631.Ed 3773.Ed
3632.Pp 3774.Pp
3633Private keys encrypted using PKCS#5 v2.0 algorithms and high iteration 3775Private keys encrypted using PKCS#5 v2.0 algorithms and high iteration
@@ -3655,49 +3797,59 @@ Various algorithms can be used with the
3655.Fl v1 3797.Fl v1
3656command line option, including PKCS#5 v1.5 and PKCS#12. 3798command line option, including PKCS#5 v1.5 and PKCS#12.
3657These are described in more detail below. 3799These are described in more detail below.
3658.Bl -tag -width "XXXX" 3800.Pp
3659.It Ar PBE-MD2-DES PBE-MD5-DES 3801.Bl -tag -width "XXXX" -compact
3802.It Ar PBE-MD2-DES | PBE-MD5-DES
3660These algorithms were included in the original PKCS#5 v1.5 specification. 3803These algorithms were included in the original PKCS#5 v1.5 specification.
3661They only offer 56 bits of protection since they both use DES. 3804They only offer 56 bits of protection since they both use DES.
3662.It Ar PBE-SHA1-RC2-64 PBE-MD2-RC2-64 PBE-MD5-RC2-64 PBE-SHA1-DES 3805.Pp
3806.It Ar PBE-SHA1-RC2-64 | PBE-MD2-RC2-64 | PBE-MD5-RC2-64 | PBE-SHA1-DES
3663These algorithms are not mentioned in the original PKCS#5 v1.5 specification 3807These algorithms are not mentioned in the original PKCS#5 v1.5 specification
3664but they use the same key derivation algorithm and are supported by some 3808but they use the same key derivation algorithm and are supported by some
3665software. 3809software.
3666They are mentioned in PKCS#5 v2.0. 3810They are mentioned in PKCS#5 v2.0.
3667They use either 64 bit RC2 or 56 bit DES. 3811They use either 64-bit RC2 or 56-bit DES.
3668.It Ar PBE-SHA1-RC4-128 PBE-SHA1-RC4-40 PBE-SHA1-3DES PBE-SHA1-2DES PBE-SHA1-RC2-128 PBE-SHA1-RC2-40 3812.Pp
3813.It Ar PBE-SHA1-RC4-128 | PBE-SHA1-RC4-40 | PBE-SHA1-3DES | PBE-SHA1-2DES
3814.It Ar PBE-SHA1-RC2-128 | PBE-SHA1-RC2-40
3669These algorithms use the PKCS#12 password based encryption algorithm and 3815These algorithms use the PKCS#12 password based encryption algorithm and
3670allow strong encryption algorithms like triple DES or 128 bit RC2 to be used. 3816allow strong encryption algorithms like triple DES or 128-bit RC2 to be used.
3671.El 3817.El
3672.Sh PKCS8 EXAMPLES 3818.Sh PKCS8 EXAMPLES
3673Convert a private from traditional to PKCS#5 v2.0 format using triple DES: 3819Convert a private key from traditional to PKCS#5 v2.0 format using triple DES:
3674.Pp 3820.Pp
3675\& $ openssl pkcs8 -in key.pem -topk8 -v2 des3 -out enckey.pem 3821.Dl "$ openssl pkcs8 -in key.pem -topk8 -v2 des3 -out enckey.pem"
3676.Pp 3822.Pp
3677Convert a private key to PKCS#8 using a PKCS#5 1.5 compatible algorithm (DES): 3823Convert a private key to PKCS#8 using a PKCS#5 1.5 compatible algorithm
3824.Pq DES :
3678.Pp 3825.Pp
3679\& $ openssl pkcs8 -in key.pem -topk8 -out enckey.pem 3826.Dl $ openssl pkcs8 -in key.pem -topk8 -out enckey.pem
3680.Pp 3827.Pp
3681Convert a private key to PKCS#8 using a PKCS#12 compatible algorithm (3DES): 3828Convert a private key to PKCS#8 using a PKCS#12 compatible algorithm
3682.Pp 3829.Pq 3DES :
3683\& $ openssl pkcs8 -in key.pem -topk8 -out enckey.pem -v1 PBE-SHA1-3DES 3830.Bd -literal -offset indent
3831$ openssl pkcs8 -in key.pem -topk8 -out enckey.pem \e
3832 -v1 PBE-SHA1-3DES
3833.Ed
3684.Pp 3834.Pp
3685Read a DER unencrypted PKCS#8 format private key: 3835Read a DER unencrypted PKCS#8 format private key:
3686.Pp 3836.Pp
3687\& $ openssl pkcs8 -inform DER -nocrypt -in key.der -out key.pem 3837.Dl "$ openssl pkcs8 -inform DER -nocrypt -in key.der -out key.pem"
3688.Pp 3838.Pp
3689Convert a private key from any PKCS#8 format to traditional format: 3839Convert a private key from any PKCS#8 format to traditional format:
3690.Pp 3840.Pp
3691\& $ openssl pkcs8 -in pk8.pem -out key.pem 3841.Dl $ openssl pkcs8 -in pk8.pem -out key.pem
3692.Sh PKCS8 STANDARDS 3842.Sh PKCS8 STANDARDS
3693Test vectors from this PKCS#5 v2.0 implementation were posted to the 3843Test vectors from this PKCS#5 v2.0 implementation were posted to the
3694pkcs-tng mailing list using triple DES, DES and RC2 with high iteration 3844pkcs-tng mailing list using triple DES, DES and RC2 with high iteration counts;
3695counts, several people confirmed that they could decrypt the private 3845several people confirmed that they could decrypt the private
3696keys produced and therefore it can be assumed that the PKCS#5 v2.0 3846keys produced and therefore it can be assumed that the PKCS#5 v2.0
3697implementation is reasonably accurate at least as far as these 3847implementation is reasonably accurate at least as far as these
3698algorithms are concerned. 3848algorithms are concerned.
3699.Pp 3849.Pp
3700The format of PKCS#8 DSA (and other) private keys is not well documented: 3850The format of PKCS#8 DSA
3851.Pq and other
3852private keys is not well documented:
3701it is hidden away in PKCS#11 v2.01, section 11.9.; 3853it is hidden away in PKCS#11 v2.01, section 11.9.;
3702.Nm OpenSSL Ns Li 's 3854.Nm OpenSSL Ns Li 's
3703default DSA PKCS#8 private key format complies with this standard. 3855default DSA PKCS#8 private key format complies with this standard.
@@ -3714,10 +3866,13 @@ compatibility, several of the utilities use the old format at present.
3714.\" 3866.\"
3715.Sh PKCS12 3867.Sh PKCS12
3716.Nm "openssl pkcs12" 3868.Nm "openssl pkcs12"
3869.Bk -words
3717.Op Fl export 3870.Op Fl export
3718.Op Fl chain 3871.Op Fl chain
3719.Op Fl inkey Ar filename 3872.Op Fl inkey Ar filename
3720.Op Fl certfile Ar filename 3873.Op Fl certfile Ar filename
3874.Op Fl CApath Ar directory
3875.Op Fl CAfile Ar filename
3721.Op Fl name Ar name 3876.Op Fl name Ar name
3722.Op Fl caname Ar name 3877.Op Fl caname Ar name
3723.Op Fl in Ar filename 3878.Op Fl in Ar filename
@@ -3729,9 +3884,10 @@ compatibility, several of the utilities use the old format at present.
3729.Op Fl cacerts 3884.Op Fl cacerts
3730.Op Fl nokeys 3885.Op Fl nokeys
3731.Op Fl info 3886.Op Fl info
3732.Op Fl des 3887.Oo
3733.Op Fl des3 3888.Fl des | des3 | aes128 |
3734.Op Fl idea 3889.Fl aes192 | aes256
3890.Oc
3735.Op Fl nodes 3891.Op Fl nodes
3736.Op Fl noiter 3892.Op Fl noiter
3737.Op Fl maciter 3893.Op Fl maciter
@@ -3745,20 +3901,24 @@ compatibility, several of the utilities use the old format at present.
3745.Op Fl passin Ar arg 3901.Op Fl passin Ar arg
3746.Op Fl passout Ar arg 3902.Op Fl passout Ar arg
3747.Op Fl rand Ar file ... 3903.Op Fl rand Ar file ...
3904.Op Fl engine Ar id
3905.Ek
3748.Pp 3906.Pp
3749The 3907The
3750.Nm pkcs12 3908.Nm pkcs12
3751command allows PKCS#12 files (sometimes referred to as PFX files) 3909command allows PKCS#12 files
3910.Pq sometimes referred to as PFX files
3752to be created and parsed. 3911to be created and parsed.
3753PKCS#12 files are used by several programs including Netscape, MSIE 3912PKCS#12 files are used by several programs including Netscape, MSIE
3754and MS Outlook. 3913and MS Outlook.
3755.Pp 3914.Pp
3756There are a lot of options; the meaning of some depends on whether a 3915There are a lot of options; the meaning of some depends on whether a
3757PKCS#12 file is being created or parsed. 3916PKCS#12 file is being created or parsed.
3758By default a PKCS#12 file is parsed; 3917By default, a PKCS#12 file is parsed;
3759a PKCS#12 file can be created by using the 3918a PKCS#12 file can be created by using the
3760.Fl export 3919.Fl export
3761option (see below). 3920option
3921.Pq see below .
3762.Sh PKCS12 PARSING OPTIONS 3922.Sh PKCS12 PARSING OPTIONS
3763.Bl -tag -width "XXXX" 3923.Bl -tag -width "XXXX"
3764.It Fl in Ar filename 3924.It Fl in Ar filename
@@ -3774,16 +3934,18 @@ They are all written in
3774.Em PEM 3934.Em PEM
3775format. 3935format.
3776.It Fl pass Ar arg , Fl passin Ar arg 3936.It Fl pass Ar arg , Fl passin Ar arg
3777The PKCS#12 file (i.e. input file) password source. 3937The PKCS#12 file
3938.Pq i.e. input file
3939password source.
3778For more information about the format of 3940For more information about the format of
3779.Ar arg 3941.Ar arg ,
3780see the 3942see the
3781.Sx PASS PHRASE ARGUMENTS 3943.Sx PASS PHRASE ARGUMENTS
3782section above. 3944section above.
3783.It Fl passout Ar arg 3945.It Fl passout Ar arg
3784Pass phrase source to encrypt any outputed private keys with. 3946Pass phrase source to encrypt any outputed private keys with.
3785For more information about the format of 3947For more information about the format of
3786.Ar arg 3948.Ar arg ,
3787see the 3949see the
3788.Sx PASS PHRASE ARGUMENTS 3950.Sx PASS PHRASE ARGUMENTS
3789section above. 3951section above.
@@ -3791,9 +3953,11 @@ section above.
3791This option inhibits output of the keys and certificates to the output file 3953This option inhibits output of the keys and certificates to the output file
3792version of the PKCS#12 file. 3954version of the PKCS#12 file.
3793.It Fl clcerts 3955.It Fl clcerts
3794Only output client certificates (not CA certificates). 3956Only output client certificates
3957.Pq not CA certificates .
3795.It Fl cacerts 3958.It Fl cacerts
3796Only output CA certificates (not client certificates). 3959Only output CA certificates
3960.Pq not client certificates .
3797.It Fl nocerts 3961.It Fl nocerts
3798No certificates at all will be output. 3962No certificates at all will be output.
3799.It Fl nokeys 3963.It Fl nokeys
@@ -3801,12 +3965,13 @@ No private keys will be output.
3801.It Fl info 3965.It Fl info
3802Output additional information about the PKCS#12 file structure, 3966Output additional information about the PKCS#12 file structure,
3803algorithms used and iteration counts. 3967algorithms used and iteration counts.
3804.It Fl des 3968.It Xo
3805Use DES to encrypt private keys before outputting. 3969.Fl des | des3 | aes128 |
3806.It Fl des3 3970.Fl aes192 | aes256
3807Use triple DES to encrypt private keys before outputting, this is the default. 3971.Xc
3808.It Fl idea 3972Use DES, triple DES, or AES, respectively,
3809Use IDEA to encrypt private keys before outputting. 3973to encrypt private keys before outputting.
3974The default is triple DES.
3810.It Fl nodes 3975.It Fl nodes
3811Don't encrypt the private keys at all. 3976Don't encrypt the private keys at all.
3812.It Fl nomacver 3977.It Fl nomacver
@@ -3841,72 +4006,89 @@ in the PKCS#12 file.
3841File to read private key from. 4006File to read private key from.
3842If not present then a private key must be present in the input file. 4007If not present then a private key must be present in the input file.
3843.It Fl name Ar friendlyname 4008.It Fl name Ar friendlyname
3844This specifies the "friendly name" for the certificate and private key. 4009This specifies the
4010.Qq friendly name
4011for the certificate and private key.
3845This name is typically displayed in list boxes by software importing the file. 4012This name is typically displayed in list boxes by software importing the file.
3846.It Fl certfile Ar filename 4013.It Fl certfile Ar filename
3847A filename to read additional certificates from. 4014A filename to read additional certificates from.
4015.It Fl CApath Ar directory
4016Directory of CAs
4017.Pq PEM format .
4018.It Fl CAfile Ar filename
4019File of CAs
4020.Pq PEM format .
3848.It Fl caname Ar friendlyname 4021.It Fl caname Ar friendlyname
3849This specifies the "friendly name" for other certificates. 4022This specifies the
4023.Qq friendly name
4024for other certificates.
3850This option may be used multiple times to specify names for all certificates 4025This option may be used multiple times to specify names for all certificates
3851in the order they appear. 4026in the order they appear.
3852Netscape ignores friendly names on other certificates, 4027Netscape ignores friendly names on other certificates,
3853whereas MSIE displays them. 4028whereas MSIE displays them.
3854.It Fl pass Ar arg , Fl passout Ar arg 4029.It Fl pass Ar arg , Fl passout Ar arg
3855The PKCS#12 file (i.e. output file) password source. 4030The PKCS#12 file
4031.Pq i.e. output file
4032password source.
3856For more information about the format of 4033For more information about the format of
3857.Ar arg 4034.Ar arg ,
3858see the 4035see the
3859.Sx PASS PHRASE ARGUMENTS 4036.Sx PASS PHRASE ARGUMENTS
3860section above. 4037section above.
3861.It Fl passin Ar password 4038.It Fl passin Ar password
3862Pass phrase source to decrypt any input private keys with. 4039Pass phrase source to decrypt any input private keys with.
3863For more information about the format of 4040For more information about the format of
3864.Ar arg 4041.Ar arg ,
3865see the 4042see the
3866.Sx PASS PHRASE ARGUMENTS 4043.Sx PASS PHRASE ARGUMENTS
3867section above. 4044section above.
3868.It Fl chain 4045.It Fl chain
3869If this option is present then an attempt is made to include the entire 4046If this option is present, then an attempt is made to include the entire
3870certificate chain of the user certificate. 4047certificate chain of the user certificate.
3871The standard CA store is used for this search. 4048The standard CA store is used for this search.
3872If the search fails it is considered a fatal error. 4049If the search fails, it is considered a fatal error.
3873.It Fl descert 4050.It Fl descert
3874Encrypt the certificate using triple DES; this may render the PKCS#12 4051Encrypt the certificate using triple DES; this may render the PKCS#12
3875file unreadable by some "export grade" software. 4052file unreadable by some
3876By default the private key is encrypted using triple DES and the 4053.Qq export grade
3877certificate using 40 bit RC2. 4054software.
4055By default, the private key is encrypted using triple DES and the
4056certificate using 40-bit RC2.
3878.It Fl keypbe Ar alg , Fl certpbe Ar alg 4057.It Fl keypbe Ar alg , Fl certpbe Ar alg
3879These options allow the algorithm used to encrypt the private key and 4058These options allow the algorithm used to encrypt the private key and
3880certificates to be selected. 4059certificates to be selected.
3881Although any PKCS#5 v1.5 or PKCS#12 algorithms can be selected, 4060Although any PKCS#5 v1.5 or PKCS#12 algorithms can be selected,
3882it is advisable only to use PKCS#12 algorithms. 4061it is advisable to only use PKCS#12 algorithms.
3883See the list in the 4062See the list in the
3884.Sx PKCS12 NOTES 4063.Sx PKCS12 NOTES
3885section for more information. 4064section for more information.
3886.It Fl keyex | keysig 4065.It Fl keyex | keysig
3887Specifies that the private key is to be used for key exchange or just signing. 4066Specifies that the private key is to be used for key exchange or just signing.
3888This option is only interpreted by MSIE and similar MS software. 4067This option is only interpreted by MSIE and similar MS software.
3889Normally "export grade" software will only allow 512 bit RSA keys to be 4068Normally,
4069.Qq export grade
4070software will only allow 512-bit RSA keys to be
3890used for encryption purposes, but arbitrary length keys for signing. 4071used for encryption purposes, but arbitrary length keys for signing.
3891The 4072The
3892.Fl keysig 4073.Fl keysig
3893option marks the key for signing only. 4074option marks the key for signing only.
3894Signing only keys can be used for S/MIME signing, 4075Signing only keys can be used for S/MIME signing, authenticode
3895authenticode (ActiveX control signing) and SSL client authentication; 4076.Pq ActiveX control signing
4077and SSL client authentication;
3896however, due to a bug only MSIE 5.0 and later support 4078however, due to a bug only MSIE 5.0 and later support
3897the use of signing only keys for SSL client authentication. 4079the use of signing only keys for SSL client authentication.
3898.It Fl nomaciter , noiter 4080.It Fl nomaciter , noiter
3899These options affect the iteration counts on the MAC and key algorithms. 4081These options affect the iteration counts on the MAC and key algorithms.
3900Unless you wish to produce files compatible with MSIE 4.0 you should leave 4082Unless you wish to produce files compatible with MSIE 4.0, you should leave
3901these options alone. 4083these options alone.
3902.Pp 4084.Pp
3903To discourage attacks by using large dictionaries of common passwords the 4085To discourage attacks by using large dictionaries of common passwords,
3904algorithm that derives keys from passwords can have an iteration count applied 4086the algorithm that derives keys from passwords can have an iteration count
3905to it: this causes a certain part of the algorithm to be repeated and slows it 4087applied to it: this causes a certain part of the algorithm to be repeated
3906down. 4088and slows it down.
3907The MAC is used to check the file integrity but since it will normally 4089The MAC is used to check the file integrity but since it will normally
3908have the same password as the keys and certificates it could also be attacked. 4090have the same password as the keys and certificates it could also be attacked.
3909By default both MAC and encryption iteration counts are set to 2048; 4091By default, both MAC and encryption iteration counts are set to 2048;
3910using these options the MAC and encryption iteration counts can be set to 1. 4092using these options the MAC and encryption iteration counts can be set to 1.
3911Since this reduces the file security you should not use these options 4093Since this reduces the file security you should not use these options
3912unless you really have to. 4094unless you really have to.
@@ -3915,29 +4097,28 @@ MSIE 4.0 doesn't support MAC iteration counts, so it needs the
3915.Fl nomaciter 4097.Fl nomaciter
3916option. 4098option.
3917.It Fl maciter 4099.It Fl maciter
3918This option is included for compatibility with previous versions, it used 4100This option is included for compatibility with previous versions; it used
3919to be needed to use MAC iterations counts but they are now used by default. 4101to be needed to use MAC iterations counts but they are now used by default.
3920.It Fl rand Ar file ... 4102.It Fl rand Ar file ...
3921A 4103A file or files
3922.Ar file
3923or
3924.Ar file Ns Li s
3925containing random data used to seed the random number generator, 4104containing random data used to seed the random number generator,
3926or an EGD socket (see 4105or an EGD socket (see
3927.Xr RAND_egd 3 ) . 4106.Xr RAND_egd 3 ) .
3928Multiple files can be specified separated by an OS-dependent character. 4107Multiple files can be specified separated by a
3929The separator is 4108.Sq \&: .
3930.Cm \&; 4109.It Fl engine Ar id
3931for MS-Windows, 4110Specifying an engine (by it's unique
3932.Cm \&, 4111.Ar id
3933for OpenVMS, and 4112string) will cause
3934.Cm \&: 4113.Nm pkcs12
3935for all others. 4114to attempt to obtain a functional reference to the specified engine,
4115thus initialising it if needed.
4116The engine will then be set as the default for all available algorithms.
3936.El 4117.El
3937.Sh PKCS12 NOTES 4118.Sh PKCS12 NOTES
3938Although there are a large number of options, 4119Although there are a large number of options,
3939most of them are very rarely used. 4120most of them are very rarely used.
3940For PKCS#12 file parsing only 4121For PKCS#12 file parsing, only
3941.Fl in 4122.Fl in
3942and 4123and
3943.Fl out 4124.Fl out
@@ -3948,10 +4129,10 @@ and
3948are also used. 4129are also used.
3949.Pp 4130.Pp
3950If none of the 4131If none of the
3951.Fl clcerts , cacerts 4132.Fl clcerts , cacerts ,
3952or 4133or
3953.Fl nocerts 4134.Fl nocerts
3954options are present then all certificates will be output in the order 4135options are present, then all certificates will be output in the order
3955they appear in the input PKCS#12 files. 4136they appear in the input PKCS#12 files.
3956There is no guarantee that the first certificate present is 4137There is no guarantee that the first certificate present is
3957the one corresponding to the private key. 4138the one corresponding to the private key.
@@ -3962,7 +4143,7 @@ Using the
3962.Fl clcerts 4143.Fl clcerts
3963option will solve this problem by only outputting the certificate 4144option will solve this problem by only outputting the certificate
3964corresponding to the private key. 4145corresponding to the private key.
3965If the CA certificates are required then they can be output to a separate 4146If the CA certificates are required, then they can be output to a separate
3966file using the 4147file using the
3967.Fl nokeys 4148.Fl nokeys
3968and 4149and
@@ -3975,40 +4156,40 @@ and
3975.Fl certpbe 4156.Fl certpbe
3976algorithms allow the precise encryption algorithms for private keys 4157algorithms allow the precise encryption algorithms for private keys
3977and certificates to be specified. 4158and certificates to be specified.
3978Normally the defaults are fine but occasionally software can't handle 4159Normally, the defaults are fine but occasionally software can't handle
3979triple DES encrypted private keys; 4160triple DES encrypted private keys;
3980then the option 4161then the option
3981.Fl keypbe Ar PBE-SHA1-RC2-40 4162.Fl keypbe Ar PBE-SHA1-RC2-40
3982can be used to reduce the private key encryption to 40 bit RC2. 4163can be used to reduce the private key encryption to 40-bit RC2.
3983A complete description of all algorithms is contained in the 4164A complete description of all algorithms is contained in the
3984.Sx PKCS8 4165.Sx PKCS8
3985section above. 4166section above.
3986.Sh PKCS12 EXAMPLES 4167.Sh PKCS12 EXAMPLES
3987Parse a PKCS#12 file and output it to a file: 4168Parse a PKCS#12 file and output it to a file:
3988.Pp 4169.Pp
3989\& $ openssl pkcs12 -in file.p12 -out file.pem 4170.Dl $ openssl pkcs12 -in file.p12 -out file.pem
3990.Pp 4171.Pp
3991Output only client certificates to a file: 4172Output only client certificates to a file:
3992.Pp 4173.Pp
3993\& $ openssl pkcs12 -in file.p12 -clcerts -out file.pem 4174.Dl $ openssl pkcs12 -in file.p12 -clcerts -out file.pem
3994.Pp 4175.Pp
3995Don't encrypt the private key: 4176Don't encrypt the private key:
3996.Pp 4177.Pp
3997\& $ openssl pkcs12 -in file.p12 -out file.pem -nodes 4178.Dl $ openssl pkcs12 -in file.p12 -out file.pem -nodes
3998.Pp 4179.Pp
3999Print some info about a PKCS#12 file: 4180Print some info about a PKCS#12 file:
4000.Pp 4181.Pp
4001\& $ openssl pkcs12 -in file.p12 -info -noout 4182.Dl $ openssl pkcs12 -in file.p12 -info -noout
4002.Pp 4183.Pp
4003Create a PKCS#12 file: 4184Create a PKCS#12 file:
4004.Bd -literal 4185.Bd -literal -offset indent
4005\& $ openssl pkcs12 -export -in file.pem -out file.p12 \e 4186$ openssl pkcs12 -export -in file.pem -out file.p12 \e
4006 -name "My Certificate" 4187 -name "My Certificate"
4007.Ed 4188.Ed
4008.Pp 4189.Pp
4009Include some extra certificates: 4190Include some extra certificates:
4010.Bd -literal 4191.Bd -literal -offset indent
4011\& $ openssl pkcs12 -export -in file.pem -out file.p12 \e 4192$ openssl pkcs12 -export -in file.pem -out file.p12 \e
4012 -name "My Certificate" -certfile othercerts.pem 4193 -name "My Certificate" -certfile othercerts.pem
4013.Ed 4194.Ed
4014.Sh PKCS12 BUGS 4195.Sh PKCS12 BUGS
@@ -4020,8 +4201,9 @@ before 0.9.6a had a bug in the PKCS#12 key generation routines.
4020Under rare circumstances this could produce a PKCS#12 file encrypted 4201Under rare circumstances this could produce a PKCS#12 file encrypted
4021with an invalid key. 4202with an invalid key.
4022As a result some PKCS#12 files which triggered this bug 4203As a result some PKCS#12 files which triggered this bug
4023from other implementations (MSIE or Netscape) could not be decrypted 4204from other implementations
4024by 4205.Pq MSIE or Netscape
4206could not be decrypted by
4025.Nm OpenSSL 4207.Nm OpenSSL
4026and similarly 4208and similarly
4027.Nm OpenSSL 4209.Nm OpenSSL
@@ -4043,9 +4225,10 @@ and recreating
4043the PKCS#12 file from the keys and certificates using a newer version of 4225the PKCS#12 file from the keys and certificates using a newer version of
4044.Nm OpenSSL . 4226.Nm OpenSSL .
4045For example: 4227For example:
4046.Bd -literal 4228.Bd -literal -offset indent
4047\& $ old-openssl -in bad.p12 -out keycerts.pem 4229$ old-openssl -in bad.p12 -out keycerts.pem
4048\& $ openssl -in keycerts.pem -export -name "My PKCS#12 file" -out fixed.p12 4230$ openssl -in keycerts.pem -export -name "My PKCS#12 file" \e
4231 -out fixed.p12
4049.Ed 4232.Ed
4050.\" 4233.\"
4051.\" RAND 4234.\" RAND
@@ -4053,8 +4236,9 @@ For example:
4053.Sh RAND 4236.Sh RAND
4054.Cm openssl rand 4237.Cm openssl rand
4055.Op Fl out Ar file 4238.Op Fl out Ar file
4056.Op Fl rand Ar file 4239.Op Fl rand Ar file ...
4057.Op Fl base64 4240.Op Fl base64
4241.Op Fl engine Ar id
4058.Ar num 4242.Ar num
4059.Pp 4243.Pp
4060The 4244The
@@ -4086,25 +4270,23 @@ Write to
4086.Ar file 4270.Ar file
4087instead of standard output. 4271instead of standard output.
4088.It Fl rand Ar file ... 4272.It Fl rand Ar file ...
4089Use specified 4273Use specified file or files, or EGD socket (see
4090.Ar file
4091or
4092.Ar file Ns Li s
4093or EGD socket (see
4094.Xr RAND_egd 3 ) 4274.Xr RAND_egd 3 )
4095for seeding the random number generator. 4275for seeding the random number generator.
4096Multiple files can be specified separated by an OS-dependent character. 4276Multiple files can be specified separated by a
4097The separator is 4277.Sq \&: .
4098.Cm \&;
4099for MS-Windows,
4100.Cm \&,
4101for OpenVMS, and
4102.Cm \&:
4103for all others.
4104.It Fl base64 4278.It Fl base64
4105Perform 4279Perform
4106.Em base64 4280.Em base64
4107encoding on the output. 4281encoding on the output.
4282.It Fl engine Ar id
4283Specifying an engine (by it's unique
4284.Ar id
4285string) will cause
4286.Nm rand
4287to attempt to obtain a functional reference to the specified engine,
4288thus initialising it if needed.
4289The engine will then be set as the default for all available algorithms.
4108.El 4290.El
4109.\" 4291.\"
4110.\" REQ 4292.\" REQ
@@ -4112,8 +4294,8 @@ encoding on the output.
4112.Sh REQ 4294.Sh REQ
4113.Nm openssl req 4295.Nm openssl req
4114.Bk -words 4296.Bk -words
4115.Op Fl inform Ar PEM|DER 4297.Op Fl inform Ar DER | PEM
4116.Op Fl outform Ar PEM|DER 4298.Op Fl outform Ar DER | PEM
4117.Op Fl in Ar filename 4299.Op Fl in Ar filename
4118.Op Fl passin Ar arg 4300.Op Fl passin Ar arg
4119.Op Fl out Ar filename 4301.Op Fl out Ar filename
@@ -4125,13 +4307,22 @@ encoding on the output.
4125.Op Fl modulus 4307.Op Fl modulus
4126.Op Fl new 4308.Op Fl new
4127.Op Fl rand Ar file ... 4309.Op Fl rand Ar file ...
4128.Op Fl newkey Ar rsa:bits 4310.Oo Xo
4129.Op Fl newkey Ar dsa:file 4311.Fl newkey
4312.Ar rsa Ns : Ns Ar bits
4313.Xc
4314.Oc
4315.Oo Xo
4316.Fl newkey
4317.Ar dsa Ns : Ns Ar file
4318.Xc
4319.Oc
4130.Op Fl nodes 4320.Op Fl nodes
4321.Op Fl subject
4131.Op Fl key Ar filename 4322.Op Fl key Ar filename
4132.Op Fl keyform Ar PEM|DER 4323.Op Fl keyform Ar DER | PEM
4133.Op Fl keyout Ar filename 4324.Op Fl keyout Ar filename
4134.Op Fl Op Cm md5|sha1|md2|mdc2 4325.Op Fl md5 | sha1 | md2 | md4
4135.Op Fl config Ar filename 4326.Op Fl config Ar filename
4136.Op Fl subj Ar arg 4327.Op Fl subj Ar arg
4137.Op Fl x509 4328.Op Fl x509
@@ -4157,7 +4348,7 @@ for use as root CAs, for example.
4157.Pp 4348.Pp
4158The options are as follows: 4349The options are as follows:
4159.Bl -tag -width "XXXX" 4350.Bl -tag -width "XXXX"
4160.It Fl inform Ar DER|PEM 4351.It Fl inform Ar DER | PEM
4161This specifies the input format. 4352This specifies the input format.
4162The 4353The
4163.Ar DER 4354.Ar DER
@@ -4168,8 +4359,8 @@ The
4168form is the default format: 4359form is the default format:
4169it consists of the DER format base64 encoded with additional header and 4360it consists of the DER format base64 encoded with additional header and
4170footer lines. 4361footer lines.
4171.It Fl outform Ar DER|PEM 4362.It Fl outform Ar DER | PEM
4172This specifies the output format, the options have the same meaning as the 4363This specifies the output format; the options have the same meaning as the
4173.Fl inform 4364.Fl inform
4174option. 4365option.
4175.It Fl in Ar filename 4366.It Fl in Ar filename
@@ -4185,7 +4376,7 @@ are not specified.
4185.It Fl passin Ar arg 4376.It Fl passin Ar arg
4186The input file password source. 4377The input file password source.
4187For more information about the format of 4378For more information about the format of
4188.Ar arg 4379.Ar arg ,
4189see the 4380see the
4190.Sx PASS PHRASE ARGUMENTS 4381.Sx PASS PHRASE ARGUMENTS
4191section above. 4382section above.
@@ -4196,7 +4387,7 @@ to write to, or standard output by default.
4196.It Fl passout Ar arg 4387.It Fl passout Ar arg
4197The output file password source. 4388The output file password source.
4198For more information about the format of 4389For more information about the format of
4199.Ar arg 4390.Ar arg ,
4200see the 4391see the
4201.Sx PASS PHRASE ARGUMENTS 4392.Sx PASS PHRASE ARGUMENTS
4202section above. 4393section above.
@@ -4219,34 +4410,24 @@ are specified in the configuration file and any requested extensions.
4219.Pp 4410.Pp
4220If the 4411If the
4221.Fl key 4412.Fl key
4222option is not used it will generate a new RSA private 4413option is not used, it will generate a new RSA private
4223key using information specified in the configuration file. 4414key using information specified in the configuration file.
4224.It Fl rand Ar file ... 4415.It Fl rand Ar file ...
4225A 4416A file or files containing random data used to seed the random number generator,
4226.Ar file
4227or
4228.Ar file Ns Li s
4229containing random data used to seed the random number generator,
4230or an EGD socket (see 4417or an EGD socket (see
4231.Xr RAND_egd 3 ) . 4418.Xr RAND_egd 3 ) .
4232Multiple files can be specified separated by an OS-dependent character. 4419Multiple files can be specified separated by a
4233The separator is 4420.Sq \&: .
4234.Cm \&;
4235for MS-Windows,
4236.Cm \&,
4237for OpenVMS, and
4238.Cm \&:
4239for all others.
4240.It Fl newkey Ar arg 4421.It Fl newkey Ar arg
4241This option creates a new certificate request and a new private key. 4422This option creates a new certificate request and a new private key.
4242The argument takes one of two forms: 4423The argument takes one of two forms:
4243.Ar rsa:nbits , 4424.Ar rsa Ns : Ns Ar nbits ,
4244where 4425where
4245.Ar nbits 4426.Ar nbits
4246is the number of bits, generates an RSA key 4427is the number of bits, generates an RSA key
4247.Ar nbits 4428.Ar nbits
4248in size. 4429in size.
4249.Ar dsa:filename 4430.Ar dsa Ns : Ns Ar filename
4250generates a DSA key using the parameters in the file 4431generates a DSA key using the parameters in the file
4251.Ar filename . 4432.Ar filename .
4252.It Fl key Ar filename 4433.It Fl key Ar filename
@@ -4254,11 +4435,11 @@ This specifies the file to read the private key from.
4254It also accepts PKCS#8 format private keys for 4435It also accepts PKCS#8 format private keys for
4255.Em PEM 4436.Em PEM
4256format files. 4437format files.
4257.It Fl keyform Ar PEM|DER 4438.It Fl keyform Ar DER | PEM
4258The format of the private key file specified in the 4439The format of the private key file specified in the
4259.Fl key 4440.Fl key
4260argument. 4441argument.
4261.AR PEM 4442.Ar PEM
4262is the default. 4443is the default.
4263.It Fl keyout Ar filename 4444.It Fl keyout Ar filename
4264This gives the 4445This gives the
@@ -4267,9 +4448,11 @@ to write the newly created private key to.
4267If this option is not specified, then the filename present in the 4448If this option is not specified, then the filename present in the
4268configuration file is used. 4449configuration file is used.
4269.It Fl nodes 4450.It Fl nodes
4270If this option is specified then if a private key is created it 4451If this option is specified and a private key is created, it
4271will not be encrypted. 4452will not be encrypted.
4272.It Fl md5|sha1|md2|mdc2 4453.It Fl subject
4454Output the request's subject.
4455.It Fl md5 | sha1 | md2 | md4
4273This specifies the message digest to sign the request with. 4456This specifies the message digest to sign the request with.
4274This overrides the digest algorithm specified in the configuration file. 4457This overrides the digest algorithm specified in the configuration file.
4275This option is ignored for DSA requests: they always use SHA1. 4458This option is ignored for DSA requests: they always use SHA1.
@@ -4277,34 +4460,38 @@ This option is ignored for DSA requests: they always use SHA1.
4277This allows an alternative configuration file to be specified; 4460This allows an alternative configuration file to be specified;
4278this overrides the compile time filename or any specified in 4461this overrides the compile time filename or any specified in
4279the 4462the
4280.Em OPENSSL_CONF 4463.Ev OPENSSL_CONF
4281environment variable. 4464environment variable.
4282.It Fl subj Ar arg 4465.It Fl subj Ar arg
4283Sets subject name for new request or supersedes the subject name 4466Sets subject name for new request or supersedes the subject name
4284when processing a request. 4467when processing a request.
4285The arg must be formatted as 4468The arg must be formatted as
4286.Em /type0=value0/type1=value1/type2=... , 4469.Em /type0=value0/type1=value1/type2=... ;
4287characters may be escaped by \e (backslash), no spaces are skipped. 4470characters may be escaped by
4471.Sq \e
4472.Pq backslash ,
4473no spaces are skipped.
4288.It Fl x509 4474.It Fl x509
4289This option outputs a self-signed certificate instead of a certificate 4475This option outputs a self-signed certificate instead of a certificate
4290request. 4476request.
4291This is typically used to generate a test certificate or 4477This is typically used to generate a test certificate or
4292a self-signed root CA. 4478a self-signed root CA.
4293The extensions added to the certificate 4479The extensions added to the certificate
4294(if any) are specified in the configuration file. 4480.Pq if any
4481are specified in the configuration file.
4295Unless specified using the 4482Unless specified using the
4296.Fl set_serial 4483.Fl set_serial
4297option, 0 will be used for the serial number. 4484option, 0 will be used for the serial number.
4298.It Fl days Ar n 4485.It Fl days Ar n
4299When the 4486When the
4300.Fl x509 4487.Fl x509
4301option is being used this specifies the number of 4488option is being used, this specifies the number of
4302days to certify the certificate for. 4489days to certify the certificate for.
4303The default is 30 days. 4490The default is 30 days.
4304.It Fl set_serial Ar n 4491.It Fl set_serial Ar n
4305Serial number to use when outputting a self-signed certificate. 4492Serial number to use when outputting a self-signed certificate.
4306This may be specified as a decimal value or a hex value if preceded by 4493This may be specified as a decimal value or a hex value if preceded by
4307.Em 0x . 4494.Sq 0x .
4308It is possible to use negative serial numbers but this is not recommended. 4495It is possible to use negative serial numbers but this is not recommended.
4309.It Fl extensions Ar section , Fl reqexts Ar section 4496.It Fl extensions Ar section , Fl reqexts Ar section
4310These options specify alternative sections to include certificate 4497These options specify alternative sections to include certificate
@@ -4315,8 +4502,8 @@ This allows several different sections to
4315be used in the same configuration file to specify requests for 4502be used in the same configuration file to specify requests for
4316a variety of purposes. 4503a variety of purposes.
4317.It Fl utf8 4504.It Fl utf8
4318This option causes field values to be interpreted as UTF8 strings, by 4505This option causes field values to be interpreted as UTF8 strings;
4319default they are interpreted as ASCII. 4506by default they are interpreted as ASCII.
4320This means that the field values, whether prompted from a terminal or 4507This means that the field values, whether prompted from a terminal or
4321obtained from a configuration file, must be valid UTF8 strings. 4508obtained from a configuration file, must be valid UTF8 strings.
4322.It Fl nameopt Ar option 4509.It Fl nameopt Ar option
@@ -4331,7 +4518,7 @@ See the
4331.Sx X509 4518.Sx X509
4332section below for details. 4519section below for details.
4333.It Fl asn1-kludge 4520.It Fl asn1-kludge
4334By default the 4521By default, the
4335.Nm req 4522.Nm req
4336command outputs certificate requests containing 4523command outputs certificate requests containing
4337no attributes in the correct PKCS#10 format. 4524no attributes in the correct PKCS#10 format.
@@ -4339,7 +4526,7 @@ However certain CAs will only
4339accept requests containing no attributes in an invalid form: this 4526accept requests containing no attributes in an invalid form: this
4340option produces this invalid format. 4527option produces this invalid format.
4341.Pp 4528.Pp
4342More precisely the 4529More precisely, the
4343.Em Attributes 4530.Em Attributes
4344in a PKCS#10 certificate request are defined as a SET OF Attribute. 4531in a PKCS#10 certificate request are defined as a SET OF Attribute.
4345They are 4532They are
@@ -4354,7 +4541,9 @@ It should be noted that very few CAs still require the use of this option.
4354Adds the word NEW to the 4541Adds the word NEW to the
4355.Em PEM 4542.Em PEM
4356file header and footer lines on the outputed request. 4543file header and footer lines on the outputed request.
4357Some software (Netscape certificate server) and some CAs need this. 4544Some software
4545.Pq Netscape certificate server
4546and some CAs need this.
4358.It Fl batch 4547.It Fl batch
4359Non-interactive mode. 4548Non-interactive mode.
4360.It Fl verbose 4549.It Fl verbose
@@ -4373,7 +4562,7 @@ The configuration options are specified in the
4373.Em req 4562.Em req
4374section of the configuration file. 4563section of the configuration file.
4375As with all configuration files, if no value is specified in the specific 4564As with all configuration files, if no value is specified in the specific
4376section (i.e. 4565section (i.e.\&
4377.Em req ) 4566.Em req )
4378then the initial unnamed or 4567then the initial unnamed or
4379.Em default 4568.Em default
@@ -4381,9 +4570,11 @@ section is searched too.
4381.Pp 4570.Pp
4382The options available are described in detail below. 4571The options available are described in detail below.
4383.Bl -tag -width "XXXX" 4572.Bl -tag -width "XXXX"
4384.It Ar input_password output_password 4573.It Ar input_password | output_password
4385The passwords for the input private key file (if present) and 4574The passwords for the input private key file
4386the output private key file (if one will be created). 4575.Pq if present
4576and the output private key file
4577.Pq if one will be created .
4387The command line options 4578The command line options
4388.Fl passin 4579.Fl passin
4389and 4580and
@@ -4414,7 +4605,7 @@ This specifies a section in the configuration file containing extra
4414object identifiers. 4605object identifiers.
4415Each line should consist of the short name of the 4606Each line should consist of the short name of the
4416object identifier followed by 4607object identifier followed by
4417.Cm = 4608.Sq =
4418and the numerical form. 4609and the numerical form.
4419The short and long names are the same when this option is used. 4610The short and long names are the same when this option is used.
4420.It Ar RANDFILE 4611.It Ar RANDFILE
@@ -4425,7 +4616,7 @@ It is used for private key generation.
4425.It Ar encrypt_key 4616.It Ar encrypt_key
4426If this is set to 4617If this is set to
4427.Em no 4618.Em no
4428then if a private key is generated it is 4619and a private key is generated, it is
4429.Em not 4620.Em not
4430encrypted. 4621encrypted.
4431This is equivalent to the 4622This is equivalent to the
@@ -4437,10 +4628,10 @@ is an equivalent option.
4437.It Ar default_md 4628.It Ar default_md
4438This option specifies the digest algorithm to use. 4629This option specifies the digest algorithm to use.
4439Possible values include 4630Possible values include
4440.Ar md5 , sha1 4631.Ar md5
4441and 4632and
4442.Ar mdc2 . 4633.Ar sha1 .
4443If not present then MD5 is used. 4634If not present, then MD5 is used.
4444This option can be overridden on the command line. 4635This option can be overridden on the command line.
4445.It Ar string_mask 4636.It Ar string_mask
4446This option masks out the use of certain string types in certain 4637This option masks out the use of certain string types in certain
@@ -4455,7 +4646,7 @@ and
4455.Em BMPStrings ; 4646.Em BMPStrings ;
4456if the 4647if the
4457.Ar pkix 4648.Ar pkix
4458value is used then only 4649value is used, then only
4459.Em PrintableStrings 4650.Em PrintableStrings
4460and 4651and
4461.Em BMPStrings 4652.Em BMPStrings
@@ -4463,7 +4654,7 @@ will be used.
4463This follows the PKIX recommendation in RFC 2459. 4654This follows the PKIX recommendation in RFC 2459.
4464If the 4655If the
4465.Fl utf8only 4656.Fl utf8only
4466option is used then only 4657option is used, then only
4467.Em UTF8Strings 4658.Em UTF8Strings
4468will be used: this is the PKIX recommendation in RFC 2459 after 2003. 4659will be used: this is the PKIX recommendation in RFC 2459 after 2003.
4469Finally, the 4660Finally, the
@@ -4531,16 +4722,18 @@ sections.
4531If the 4722If the
4532.Fl prompt 4723.Fl prompt
4533option is set to 4724option is set to
4534.Em no 4725.Em no ,
4535then these sections just consist of field names and values: for example, 4726then these sections just consist of field names and values: for example,
4536.Bd -literal 4727.Bd -unfilled -offset indent
4537\& CN=My Name 4728CN=My Name
4538\& OU=My Organization 4729OU=My Organization
4539\& emailAddress=someone@somewhere.org 4730emailAddress=someone@somewhere.org
4540.Ed 4731.Ed
4541.Pp 4732.Pp
4542This allows external programs (e.g. GUI based) to generate a template file 4733This allows external programs
4543with all the field names and values and just pass it to 4734.Pq e.g. GUI based
4735to generate a template file with all the field names and values
4736and just pass it to
4544.Nm req . 4737.Nm req .
4545An example of this kind of configuration file is contained in the 4738An example of this kind of configuration file is contained in the
4546.Sx REQ EXAMPLES 4739.Sx REQ EXAMPLES
@@ -4552,21 +4745,26 @@ option is absent or not set to
4552.Em no , 4745.Em no ,
4553then the file contains field prompting information. 4746then the file contains field prompting information.
4554It consists of lines of the form: 4747It consists of lines of the form:
4555.Bd -literal 4748.Bd -unfilled -offset indent
4556\& fieldName="prompt" 4749fieldName="prompt"
4557\& fieldName_default="default field value" 4750fieldName_default="default field value"
4558\& fieldName_min= 2 4751fieldName_min= 2
4559\& fieldName_max= 4 4752fieldName_max= 4
4560.Ed 4753.Ed
4561.Pp 4754.Pp
4562"fieldName" is the field name being used, for example 4755.Qq fieldName
4756is the field name being used, for example
4563.Em commonName 4757.Em commonName
4564(or CN). 4758.Pq or CN .
4565The "prompt" string is used to ask the user to enter the relevant details. 4759The
4760.Qq prompt
4761string is used to ask the user to enter the relevant details.
4566If the user enters nothing, then the default value is used; 4762If the user enters nothing, then the default value is used;
4567if no default value is present then the field is omitted. 4763if no default value is present, then the field is omitted.
4568A field can still be omitted if a default value is present, 4764A field can still be omitted if a default value is present,
4569if the user just enters the '.' character. 4765if the user just enters the
4766.Sq \&.
4767character.
4570.Pp 4768.Pp
4571The number of characters entered must be between the 4769The number of characters entered must be between the
4572.Em fieldName_min 4770.Em fieldName_min
@@ -4584,12 +4782,13 @@ Some fields (such as
4584can be used more than once in a DN. 4782can be used more than once in a DN.
4585This presents a problem because configuration files will 4783This presents a problem because configuration files will
4586not recognize the same name occurring twice. 4784not recognize the same name occurring twice.
4587To avoid this problem if the 4785To avoid this problem, if the
4588.Em fieldName 4786.Em fieldName
4589contains some characters followed by a full stop they will be ignored. 4787contains some characters followed by a full stop, they will be ignored.
4590So, for example, a second 4788So, for example, a second
4591.Em organizationName 4789.Em organizationName
4592can be input by calling it "1.organizationName". 4790can be input by calling it
4791.Qq 1.organizationName .
4593.Pp 4792.Pp
4594The actual permitted field names are any object identifier short or 4793The actual permitted field names are any object identifier short or
4595long names. 4794long names.
@@ -4598,7 +4797,7 @@ These are compiled into
4598and include the usual values such as 4797and include the usual values such as
4599.Em commonName , countryName , localityName , organizationName , 4798.Em commonName , countryName , localityName , organizationName ,
4600.Em organizationUnitName , stateOrProvinceName . 4799.Em organizationUnitName , stateOrProvinceName .
4601Additionally 4800Additionally,
4602.Em emailAddress 4801.Em emailAddress
4603is included as well as 4802is included as well as
4604.Em name , surname , givenName initials 4803.Em name , surname , givenName initials
@@ -4615,36 +4814,36 @@ Any additional fields will be treated as though they were a
4615.Sh REQ EXAMPLES 4814.Sh REQ EXAMPLES
4616Examine and verify certificate request: 4815Examine and verify certificate request:
4617.Pp 4816.Pp
4618\& $ openssl req -in req.pem -text -verify -noout 4817.Dl $ openssl req -in req.pem -text -verify -noout
4619.Pp 4818.Pp
4620Create a private key and then generate a certificate request from it: 4819Create a private key and then generate a certificate request from it:
4621.Bd -literal 4820.Bd -literal -offset indent
4622\& $ openssl genrsa -out key.pem 1024 4821$ openssl genrsa -out key.pem 1024
4623\& $ openssl req -new -key key.pem -out req.pem 4822$ openssl req -new -key key.pem -out req.pem
4624.Ed 4823.Ed
4625.Pp 4824.Pp
4626The same but just using req: 4825The same but just using req:
4627.Pp 4826.Pp
4628\& $ openssl req -newkey rsa:1024 -keyout key.pem -out req.pem 4827.Dl $ openssl req -newkey rsa:1024 -keyout key.pem -out req.pem
4629.Pp 4828.Pp
4630Generate a self-signed root certificate: 4829Generate a self-signed root certificate:
4631.Pp 4830.Pp
4632\& $ openssl req -x509 -newkey rsa:1024 -keyout key.pem -out req.pem 4831.Dl "$ openssl req -x509 -newkey rsa:1024 -keyout key.pem -out req.pem"
4633.Pp 4832.Pp
4634Example of a file pointed to by the 4833Example of a file pointed to by the
4635.Ar oid_file 4834.Ar oid_file
4636option: 4835option:
4637.Bd -literal 4836.Bd -unfilled -offset indent
4638\& 1.2.3.4 shortName A longer Name 48371.2.3.4 shortName A longer Name
4639\& 1.2.3.6 otherName Other longer Name 48381.2.3.6 otherName Other longer Name
4640.Ed 4839.Ed
4641.Pp 4840.Pp
4642Example of a section pointed to by 4841Example of a section pointed to by
4643.Ar oid_section 4842.Ar oid_section
4644making use of variable expansion: 4843making use of variable expansion:
4645.Bd -literal 4844.Bd -unfilled -offset indent
4646\& testoid1=1.2.3.5 4845testoid1=1.2.3.5
4647\& testoid2=${testoid1}.6 4846testoid2=${testoid1}.6
4648.Ed 4847.Ed
4649.Pp 4848.Pp
4650Sample configuration file prompting for field values: 4849Sample configuration file prompting for field values:
@@ -4655,32 +4854,32 @@ Sample configuration file prompting for field values:
4655\& distinguished_name = req_distinguished_name 4854\& distinguished_name = req_distinguished_name
4656\& attributes = req_attributes 4855\& attributes = req_attributes
4657\& x509_extensions = v3_ca 4856\& x509_extensions = v3_ca
4658.Pp 4857
4659\& dirstring_type = nobmp 4858\& dirstring_type = nobmp
4660.Pp 4859
4661\& [ req_distinguished_name ] 4860\& [ req_distinguished_name ]
4662\& countryName = Country Name (2 letter code) 4861\& countryName = Country Name (2 letter code)
4663\& countryName_default = AU 4862\& countryName_default = AU
4664\& countryName_min = 2 4863\& countryName_min = 2
4665\& countryName_max = 2 4864\& countryName_max = 2
4666.Pp 4865
4667\& localityName = Locality Name (eg, city) 4866\& localityName = Locality Name (eg, city)
4668.Pp 4867
4669\& organizationalUnitName = Organizational Unit Name (eg, section) 4868\& organizationalUnitName = Organizational Unit Name (eg, section)
4670.Pp 4869
4671\& commonName = Common Name (eg, YOUR name) 4870\& commonName = Common Name (eg, YOUR name)
4672\& commonName_max = 64 4871\& commonName_max = 64
4673.Pp 4872
4674\& emailAddress = Email Address 4873\& emailAddress = Email Address
4675\& emailAddress_max = 40 4874\& emailAddress_max = 40
4676.Pp 4875
4677\& [ req_attributes ] 4876\& [ req_attributes ]
4678\& challengePassword = A challenge password 4877\& challengePassword = A challenge password
4679\& challengePassword_min = 4 4878\& challengePassword_min = 4
4680\& challengePassword_max = 20 4879\& challengePassword_max = 20
4681.Pp 4880
4682\& [ v3_ca ] 4881\& [ v3_ca ]
4683.Pp 4882
4684\& subjectKeyIdentifier=hash 4883\& subjectKeyIdentifier=hash
4685\& authorityKeyIdentifier=keyid:always,issuer:always 4884\& authorityKeyIdentifier=keyid:always,issuer:always
4686\& basicConstraints = CA:true 4885\& basicConstraints = CA:true
@@ -4689,7 +4888,7 @@ Sample configuration file prompting for field values:
4689Sample configuration containing all field values: 4888Sample configuration containing all field values:
4690.Bd -literal 4889.Bd -literal
4691\& RANDFILE = $ENV::HOME/.rnd 4890\& RANDFILE = $ENV::HOME/.rnd
4692.Pp 4891
4693\& [ req ] 4892\& [ req ]
4694\& default_bits = 1024 4893\& default_bits = 1024
4695\& default_keyfile = keyfile.pem 4894\& default_keyfile = keyfile.pem
@@ -4697,7 +4896,7 @@ Sample configuration containing all field values:
4697\& attributes = req_attributes 4896\& attributes = req_attributes
4698\& prompt = no 4897\& prompt = no
4699\& output_password = mypass 4898\& output_password = mypass
4700.Pp 4899
4701\& [ req_distinguished_name ] 4900\& [ req_distinguished_name ]
4702\& C = GB 4901\& C = GB
4703\& ST = Test State or Province 4902\& ST = Test State or Province
@@ -4706,7 +4905,7 @@ Sample configuration containing all field values:
4706\& OU = Organizational Unit Name 4905\& OU = Organizational Unit Name
4707\& CN = Common Name 4906\& CN = Common Name
4708\& emailAddress = test@email.address 4907\& emailAddress = test@email.address
4709.Pp 4908
4710\& [ req_attributes ] 4909\& [ req_attributes ]
4711\& challengePassword = A challenge password 4910\& challengePassword = A challenge password
4712.Ed 4911.Ed
@@ -4714,15 +4913,17 @@ Sample configuration containing all field values:
4714The header and footer lines in the 4913The header and footer lines in the
4715.Ar PEM 4914.Ar PEM
4716format are normally: 4915format are normally:
4717.Bd -literal 4916.Bd -unfilled -offset indent
4718\& -----BEGIN CERTIFICATE REQUEST----- 4917-----BEGIN CERTIFICATE REQUEST-----
4719\& -----END CERTIFICATE REQUEST----- 4918-----END CERTIFICATE REQUEST-----
4720.Ed 4919.Ed
4721.Pp 4920.Pp
4722Some software (some versions of Netscape certificate server) instead needs: 4921Some software
4723.Bd -literal 4922.Pq some versions of Netscape certificate server
4724\& -----BEGIN NEW CERTIFICATE REQUEST----- 4923instead needs:
4725\& -----END NEW CERTIFICATE REQUEST----- 4924.Bd -unfilled -offset indent
4925-----BEGIN NEW CERTIFICATE REQUEST-----
4926-----END NEW CERTIFICATE REQUEST-----
4726.Ed 4927.Ed
4727.Pp 4928.Pp
4728which is produced with the 4929which is produced with the
@@ -4733,69 +4934,73 @@ Either form is accepted transparently on input.
4733The certificate requests generated by Xenroll with MSIE have extensions added. 4934The certificate requests generated by Xenroll with MSIE have extensions added.
4734It includes the 4935It includes the
4735.Em keyUsage 4936.Em keyUsage
4736extension which determines the type of 4937extension which determines the type of key
4737key (signature only or general purpose) and any additional OIDs entered 4938.Pq signature only or general purpose
4738by the script in an 4939and any additional OIDs entered by the script in an
4739.Em extendedKeyUsage 4940.Em extendedKeyUsage
4740extension. 4941extension.
4741.Sh REQ DIAGNOSTICS 4942.Sh REQ DIAGNOSTICS
4742The following messages are frequently asked about: 4943The following messages are frequently asked about:
4743.Bd -literal 4944.Bd -unfilled -offset indent
4744\& Using configuration from /some/path/openssl.cnf 4945Using configuration from /some/path/openssl.cnf
4745\& Unable to load config info 4946Unable to load config info
4746.Ed 4947.Ed
4747.Pp 4948.Pp
4748This is followed some time later by... 4949This is followed some time later by...
4749.Bd -literal 4950.Bd -unfilled -offset indent
4750\& unable to find 'distinguished_name' in config 4951unable to find 'distinguished_name' in config
4751\& problems making Certificate Request 4952problems making Certificate Request
4752.Ed 4953.Ed
4753.Pp 4954.Pp
4754The first error message is the clue: it can't find the configuration 4955The first error message is the clue: it can't find the configuration
4755file! 4956file!
4756Certain operations (like examining a certificate request) don't 4957Certain operations
4757need a configuration file so its use isn't enforced. 4958.Pq like examining a certificate request
4959don't need a configuration file so its use isn't enforced.
4758Generation of certificates or requests, however, do need a configuration file. 4960Generation of certificates or requests, however, do need a configuration file.
4759This could be regarded as a bug. 4961This could be regarded as a bug.
4760.Pp 4962.Pp
4761Another puzzling message is this: 4963Another puzzling message is this:
4762.Bd -literal 4964.Bd -unfilled -offset indent
4763\& Attributes: 4965Attributes:
4764\& a0:00 4966 a0:00
4765.Ed 4967.Ed
4766.Pp 4968.Pp
4767This is displayed when no attributes are present and the request includes 4969This is displayed when no attributes are present and the request includes
4768the correct empty SET OF structure (the DER encoding of which is 0xa0 0x00). 4970the correct empty SET OF structure
4971.Pq the DER encoding of which is 0xa0 0x00 .
4769If you just see: 4972If you just see:
4770.Pp 4973.Pp
4771\& Attributes: 4974.D1 Attributes:
4772.Pp 4975.Pp
4773then the SET OF is missing and the encoding is technically invalid (but 4976then the SET OF is missing and the encoding is technically invalid
4774it is tolerated). 4977.Pq but it is tolerated .
4775See the description of the command line option 4978See the description of the command line option
4776.Fl asn1-kludge 4979.Fl asn1-kludge
4777for more information. 4980for more information.
4778.Sh REQ ENVIRONMENT VARIABLES 4981.Sh REQ ENVIRONMENT VARIABLES
4779The variable 4982The variable
4780.Em OPENSSL_CONF , 4983.Ev OPENSSL_CONF ,
4781if defined, allows an alternative configuration 4984if defined, allows an alternative configuration
4782file location to be specified; it will be overridden by the 4985file location to be specified; it will be overridden by the
4783.Fl config 4986.Fl config
4784command line switch if it is present. 4987command line switch if it is present.
4785For compatibility reasons the 4988For compatibility reasons the
4786.Em SSLEAY_CONF 4989.Ev SSLEAY_CONF
4787environment variable serves the same purpose but its use is discouraged. 4990environment variable serves the same purpose but its use is discouraged.
4788.Sh REQ BUGS 4991.Sh REQ BUGS
4789.Nm OpenSSL Ns Li 's 4992.Nm OpenSSL Ns Li 's
4790handling of T61Strings (aka TeletexStrings) is broken: it effectively 4993handling of T61Strings
4791treats them as ISO-8859-1 (Latin 1); 4994.Pq aka TeletexStrings
4995is broken: it effectively treats them as ISO-8859-1
4996.Pq Latin 1 ;
4792Netscape and MSIE have similar behaviour. 4997Netscape and MSIE have similar behaviour.
4793This can cause problems if you need characters that aren't available in 4998This can cause problems if you need characters that aren't available in
4794.Em PrintableStrings 4999.Em PrintableStrings
4795and you don't want to or can't use 5000and you don't want to or can't use
4796.Em BMPStrings . 5001.Em BMPStrings .
4797.Pp 5002.Pp
4798As a consequence of the T61String handling the only correct way to represent 5003As a consequence of the T61String handling, the only correct way to represent
4799accented characters in 5004accented characters in
4800.Nm OpenSSL 5005.Nm OpenSSL
4801is to use a 5006is to use a
@@ -4806,10 +5011,10 @@ and MSIE then you currently need to use the invalid T61String form.
4806.Pp 5011.Pp
4807The current prompting is not very friendly. 5012The current prompting is not very friendly.
4808It doesn't allow you to confirm what you've just entered. 5013It doesn't allow you to confirm what you've just entered.
4809Other things like extensions in certificate requests are 5014Other things, like extensions in certificate requests, are
4810statically defined in the configuration file. 5015statically defined in the configuration file.
4811Some of these, like an email address in 5016Some of these, like an email address in
4812.Em subjectAltName 5017.Em subjectAltName ,
4813should be input by the user. 5018should be input by the user.
4814.\" 5019.\"
4815.\" RSA 5020.\" RSA
@@ -4817,16 +5022,17 @@ should be input by the user.
4817.Sh RSA 5022.Sh RSA
4818.Cm openssl rsa 5023.Cm openssl rsa
4819.Bk -words 5024.Bk -words
4820.Op Fl inform Ar PEM|NET|DER 5025.Op Fl inform Ar DER | NET | PEM
4821.Op Fl outform Ar PEM|NET|DER 5026.Op Fl outform Ar DER | NET | PEM
4822.Op Fl in Ar filename 5027.Op Fl in Ar filename
4823.Op Fl passin Ar arg 5028.Op Fl passin Ar arg
4824.Op Fl out Ar filename 5029.Op Fl out Ar filename
4825.Op Fl passout Ar arg 5030.Op Fl passout Ar arg
4826.Op Fl sgckey 5031.Op Fl sgckey
4827.Op Fl des 5032.Oo
4828.Op Fl des3 5033.Fl des | des3 | aes128 |
4829.Op Fl idea 5034.Fl aes192 | aes256
5035.Oc
4830.Op Fl text 5036.Op Fl text
4831.Op Fl noout 5037.Op Fl noout
4832.Op Fl modulus 5038.Op Fl modulus
@@ -4851,7 +5057,7 @@ utility.
4851.Pp 5057.Pp
4852The options are as follows: 5058The options are as follows:
4853.Bl -tag -width "XXXX" 5059.Bl -tag -width "XXXX"
4854.It Fl inform Ar DER|NET|PEM 5060.It Fl inform Ar DER | NET | PEM
4855This specifies the input format. 5061This specifies the input format.
4856The 5062The
4857.Ar DER 5063.Ar DER
@@ -4868,8 +5074,8 @@ The
4868form is a format described in the 5074form is a format described in the
4869.Sx RSA NOTES 5075.Sx RSA NOTES
4870section. 5076section.
4871.It Fl outform Ar DER|NET|PEM 5077.It Fl outform Ar DER | NET | PEM
4872This specifies the output format, the options have the same meaning as the 5078This specifies the output format; the options have the same meaning as the
4873.Fl inform 5079.Fl inform
4874option. 5080option.
4875.It Fl in Ar filename 5081.It Fl in Ar filename
@@ -4881,7 +5087,7 @@ If the key is encrypted, a pass phrase will be prompted for.
4881.It Fl passin Ar arg 5087.It Fl passin Ar arg
4882The input file password source. 5088The input file password source.
4883For more information about the format of 5089For more information about the format of
4884.Ar arg 5090.Ar arg ,
4885see the 5091see the
4886.Sx PASS PHRASE ARGUMENTS 5092.Sx PASS PHRASE ARGUMENTS
4887section above. 5093section above.
@@ -4889,14 +5095,14 @@ section above.
4889This specifies the output 5095This specifies the output
4890.Ar filename 5096.Ar filename
4891to write a key to, or standard output if this option is not specified. 5097to write a key to, or standard output if this option is not specified.
4892If any encryption options are set then a pass phrase will be prompted for. 5098If any encryption options are set then, a pass phrase will be prompted for.
4893The output filename should 5099The output filename should
4894.Em not 5100.Em not
4895be the same as the input filename. 5101be the same as the input filename.
4896.It Fl passout Ar password 5102.It Fl passout Ar password
4897The output file password source. 5103The output file password source.
4898For more information about the format of 5104For more information about the format of
4899.Ar arg 5105.Ar arg ,
4900see the 5106see the
4901.Sx PASS PHRASE ARGUMENTS 5107.Sx PASS PHRASE ARGUMENTS
4902section above. 5108section above.
@@ -4904,9 +5110,12 @@ section above.
4904Use the modified 5110Use the modified
4905.Em NET 5111.Em NET
4906algorithm used with some versions of Microsoft IIS and SGC keys. 5112algorithm used with some versions of Microsoft IIS and SGC keys.
4907.It Cm -des|-des3|-idea 5113.It Xo
5114.Fl des | des3 | aes128 |
5115.Fl aes192 | aes256
5116.Xc
4908These options encrypt the private key with the DES, triple DES, or the 5117These options encrypt the private key with the DES, triple DES, or the
4909IDEA ciphers, respectively, before outputting it. 5118AES ciphers, respectively, before outputting it.
4910A pass phrase is prompted for. 5119A pass phrase is prompted for.
4911If none of these options is specified the key is written in plain text. 5120If none of these options is specified the key is written in plain text.
4912This means that using the 5121This means that using the
@@ -4927,17 +5136,17 @@ This option prints out the value of the modulus of the key.
4927.It Fl check 5136.It Fl check
4928This option checks the consistency of an RSA private key. 5137This option checks the consistency of an RSA private key.
4929.It Fl pubin 5138.It Fl pubin
4930By default a private key is read from the input file: with this 5139By default, a private key is read from the input file: with this
4931option a public key is read instead. 5140option a public key is read instead.
4932.It Fl pubout 5141.It Fl pubout
4933By default a private key is output: 5142By default, a private key is output:
4934with this option a public key will be output instead. 5143with this option a public key will be output instead.
4935This option is automatically set if the input is a public key. 5144This option is automatically set if the input is a public key.
4936.It Fl engine Ar id 5145.It Fl engine Ar id
4937Specifying an engine (by it's unique 5146Specifying an engine (by it's unique
4938.Ar id 5147.Ar id
4939string) will cause 5148string) will cause
4940.Nm req 5149.Nm rsa
4941to attempt to obtain a functional reference to the specified engine, 5150to attempt to obtain a functional reference to the specified engine,
4942thus initialising it if needed. 5151thus initialising it if needed.
4943The engine will then be set as the default for all available algorithms. 5152The engine will then be set as the default for all available algorithms.
@@ -4946,17 +5155,17 @@ The engine will then be set as the default for all available algorithms.
4946The 5155The
4947.Em PEM 5156.Em PEM
4948private key format uses the header and footer lines: 5157private key format uses the header and footer lines:
4949.Bd -literal 5158.Bd -unfilled -offset indent
4950\& -----BEGIN RSA PRIVATE KEY----- 5159-----BEGIN RSA PRIVATE KEY-----
4951\& -----END RSA PRIVATE KEY----- 5160-----END RSA PRIVATE KEY-----
4952.Ed 5161.Ed
4953.Pp 5162.Pp
4954The 5163The
4955.Em PEM 5164.Em PEM
4956public key format uses the header and footer lines: 5165public key format uses the header and footer lines:
4957.Bd -literal 5166.Bd -unfilled -offset indent
4958\& -----BEGIN PUBLIC KEY----- 5167-----BEGIN PUBLIC KEY-----
4959\& -----END PUBLIC KEY----- 5168-----END PUBLIC KEY-----
4960.Ed 5169.Ed
4961.Pp 5170.Pp
4962The 5171The
@@ -4969,8 +5178,10 @@ Some newer version of IIS have additional data in the exported .key files.
4969To use these with the 5178To use these with the
4970.Nm rsa 5179.Nm rsa
4971utility, view the file with a binary editor 5180utility, view the file with a binary editor
4972and look for the string "private-key", then trace back to the byte 5181and look for the string
4973sequence 0x30, 0x82 (this is an ASN1 SEQUENCE). 5182.Qq private-key ,
5183then trace back to the byte sequence 0x30, 0x82
5184.Pq this is an ASN1 SEQUENCE .
4974Copy all the data from this point onwards to another file and use that as 5185Copy all the data from this point onwards to another file and use that as
4975the input to the 5186the input to the
4976.Nm rsa 5187.Nm rsa
@@ -4983,11 +5194,11 @@ option.
4983.Sh RSA EXAMPLES 5194.Sh RSA EXAMPLES
4984To remove the pass phrase on an RSA private key: 5195To remove the pass phrase on an RSA private key:
4985.Pp 5196.Pp
4986\& $ openssl rsa -in key.pem -out keyout.pem 5197.Dl $ openssl rsa -in key.pem -out keyout.pem
4987.Pp 5198.Pp
4988To encrypt a private key using triple DES: 5199To encrypt a private key using triple DES:
4989.Pp 5200.Pp
4990\& $ openssl rsa -in key.pem -des3 -out keyout.pem 5201.Dl $ openssl rsa -in key.pem -des3 -out keyout.pem
4991.Pp 5202.Pp
4992To convert a private key from 5203To convert a private key from
4993.Em PEM 5204.Em PEM
@@ -4995,15 +5206,15 @@ to
4995.Em DER 5206.Em DER
4996format: 5207format:
4997.Pp 5208.Pp
4998\& $ openssl rsa -in key.pem -outform DER -out keyout.der 5209.Dl $ openssl rsa -in key.pem -outform DER -out keyout.der
4999.Pp 5210.Pp
5000To print out the components of a private key to standard output: 5211To print out the components of a private key to standard output:
5001.Pp 5212.Pp
5002\& $ openssl rsa -in key.pem -text -noout 5213.Dl $ openssl rsa -in key.pem -text -noout
5003.Pp 5214.Pp
5004To just output the public part of a private key: 5215To just output the public part of a private key:
5005.Pp 5216.Pp
5006\& $ openssl rsa -in key.pem -pubout -out pubkey.pem 5217.Dl $ openssl rsa -in key.pem -pubout -out pubkey.pem
5007.Sh RSA BUGS 5218.Sh RSA BUGS
5008The command line password arguments don't currently work with 5219The command line password arguments don't currently work with
5009.Em NET 5220.Em NET
@@ -5016,20 +5227,22 @@ without having to manually edit them.
5016.\" 5227.\"
5017.Sh RSAUTL 5228.Sh RSAUTL
5018.Nm openssl rsautl 5229.Nm openssl rsautl
5230.Bk -words
5019.Op Fl in Ar file 5231.Op Fl in Ar file
5020.Op Fl out Ar file 5232.Op Fl out Ar file
5021.Op Fl inkey Ar file 5233.Op Fl inkey Ar file
5234.Op Fl keyform Ar DER | PEM
5022.Op Fl pubin 5235.Op Fl pubin
5023.Op Fl certin 5236.Op Fl certin
5024.Op Fl sign 5237.Op Fl sign
5025.Op Fl verify 5238.Op Fl verify
5026.Op Fl encrypt 5239.Op Fl encrypt
5027.Op Fl decrypt 5240.Op Fl decrypt
5028.Op Fl pkcs 5241.Op Fl pkcs | oaep | ssl | raw
5029.Op Fl ssl
5030.Op Fl raw
5031.Op Fl hexdump 5242.Op Fl hexdump
5032.Op Fl asn1parse 5243.Op Fl asn1parse
5244.Op Fl engine Ar id
5245.Ek
5033.Pp 5246.Pp
5034The 5247The
5035.Nm rsautl 5248.Nm rsautl
@@ -5050,6 +5263,10 @@ to write to or standard output by
5050default. 5263default.
5051.It Fl inkey Ar file 5264.It Fl inkey Ar file
5052The input key file, by default it should be an RSA private key. 5265The input key file, by default it should be an RSA private key.
5266.It Fl keyform Ar DER | PEM
5267Private ket format.
5268Default is
5269.Ar PEM .
5053.It Fl pubin 5270.It Fl pubin
5054The input file is an RSA public key. 5271The input file is an RSA public key.
5055.It Fl certin 5272.It Fl certin
@@ -5063,9 +5280,10 @@ Verify the input data and output the recovered data.
5063Encrypt the input data using an RSA public key. 5280Encrypt the input data using an RSA public key.
5064.It Fl decrypt 5281.It Fl decrypt
5065Decrypt the input data using an RSA private key. 5282Decrypt the input data using an RSA private key.
5066.It Fl pkcs , oaep , ssl , raw 5283.It Fl pkcs | oaep | ssl | raw
5067The padding to use: PKCS#1 v1.5 (the default), PKCS#1 OAEP, 5284The padding to use: PKCS#1 v1.5
5068special padding used in SSL v2 backwards compatible handshakes, 5285.Pq the default ,
5286PKCS#1 OAEP, special padding used in SSL v2 backwards compatible handshakes,
5069or no padding, respectively. 5287or no padding, respectively.
5070For signatures, only 5288For signatures, only
5071.Fl pkcs 5289.Fl pkcs
@@ -5075,9 +5293,17 @@ can be used.
5075.It Fl hexdump 5293.It Fl hexdump
5076Hex dump the output data. 5294Hex dump the output data.
5077.It Fl asn1parse 5295.It Fl asn1parse
5078Asn1parse the output data, this is useful when combined with the 5296Asn1parse the output data; this is useful when combined with the
5079.Fl verify 5297.Fl verify
5080option. 5298option.
5299.It Fl engine Ar id
5300Specifying an engine (by it's unique
5301.Ar id
5302string) will cause
5303.Nm rsautl
5304to attempt to obtain a functional reference to the specified engine,
5305thus initialising it if needed.
5306The engine will then be set as the default for all available algorithms.
5081.El 5307.El
5082.Sh RSAUTL NOTES 5308.Sh RSAUTL NOTES
5083.Nm rsautl , 5309.Nm rsautl ,
@@ -5086,16 +5312,16 @@ used to sign or verify small pieces of data.
5086.Sh RSAUTL EXAMPLES 5312.Sh RSAUTL EXAMPLES
5087Sign some data using a private key: 5313Sign some data using a private key:
5088.Pp 5314.Pp
5089\& $ openssl rsautl -sign -in file -inkey key.pem -out sig 5315.Dl "$ openssl rsautl -sign -in file -inkey key.pem -out sig"
5090.Pp 5316.Pp
5091Recover the signed data: 5317Recover the signed data:
5092.Pp 5318.Pp
5093\& $ openssl rsautl -verify -in sig -inkey key.pem 5319.Dl $ openssl rsautl -verify -in sig -inkey key.pem
5094.Pp 5320.Pp
5095Examine the raw signed data: 5321Examine the raw signed data:
5096.Pp 5322.Pp
5097\& $ openssl rsautl -verify -in file -inkey key.pem -raw -hexdump 5323.Li "\ \&$ openssl rsautl -verify -in file -inkey key.pem -raw -hexdump"
5098.Bd -literal 5324.Bd -unfilled
5099\& 0000 - 00 01 ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................ 5325\& 0000 - 00 01 ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................
5100\& 0010 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................ 5326\& 0010 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................
5101\& 0020 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................ 5327\& 0020 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................
@@ -5106,8 +5332,9 @@ Examine the raw signed data:
5106\& 0070 - ff ff ff ff 00 68 65 6c-6c 6f 20 77 6f 72 6c 64 .....hello world 5332\& 0070 - ff ff ff ff 00 68 65 6c-6c 6f 20 77 6f 72 6c 64 .....hello world
5107.Ed 5333.Ed
5108.Pp 5334.Pp
5109The PKCS#1 block formatting is evident from this. If this was done using 5335The PKCS#1 block formatting is evident from this.
5110encrypt and decrypt the block would have been of type 2 (the second byte) 5336If this was done using encrypt and decrypt, the block would have been of type 2
5337.Pq the second byte
5111and random padding data visible instead of the 0xff bytes. 5338and random padding data visible instead of the 0xff bytes.
5112.Pp 5339.Pp
5113It is possible to analyse the signature of certificates using this 5340It is possible to analyse the signature of certificates using this
@@ -5115,12 +5342,12 @@ utility in conjunction with
5115.Nm asn1parse . 5342.Nm asn1parse .
5116Consider the self-signed example in 5343Consider the self-signed example in
5117.Pa certs/pca-cert.pem : 5344.Pa certs/pca-cert.pem :
5118Running 5345running
5119.Nm asn1parse 5346.Nm asn1parse
5120as follows yields: 5347as follows yields:
5121.Pp 5348.Pp
5122\& $ openssl asn1parse -in pca-cert.pem 5349.Li "\ \&$ openssl asn1parse -in pca-cert.pem"
5123.Bd -literal 5350.Bd -unfilled
5124\& 0:d=0 hl=4 l= 742 cons: SEQUENCE 5351\& 0:d=0 hl=4 l= 742 cons: SEQUENCE
5125\& 4:d=1 hl=4 l= 591 cons: SEQUENCE 5352\& 4:d=1 hl=4 l= 591 cons: SEQUENCE
5126\& 8:d=2 hl=2 l= 3 cons: cont [ 0 ] 5353\& 8:d=2 hl=2 l= 3 cons: cont [ 0 ]
@@ -5144,22 +5371,22 @@ as follows yields:
5144The final BIT STRING contains the actual signature. 5371The final BIT STRING contains the actual signature.
5145It can be extracted with: 5372It can be extracted with:
5146.Pp 5373.Pp
5147\& $ openssl asn1parse -in pca-cert.pem -out sig -noout -strparse 614 5374.Dl "$ openssl asn1parse -in pca-cert.pem -out sig -noout -strparse 614"
5148.Pp 5375.Pp
5149The certificate public key can be extracted with: 5376The certificate public key can be extracted with:
5150.Pp 5377.Pp
5151\& $ openssl x509 -in test/testx509.pem -pubout -noout >pubkey.pem 5378.Dl $ openssl x509 -in test/testx509.pem -pubout -noout >pubkey.pem
5152.Pp 5379.Pp
5153The signature can be analysed with: 5380The signature can be analysed with:
5154.Pp 5381.Pp
5155\& $ openssl rsautl -in sig -verify -asn1parse -inkey pubkey.pem -pubin 5382.Li "\ \&$ openssl rsautl -in sig -verify -asn1parse -inkey pubkey.pem -pubin"
5156.Bd -literal 5383.Bd -unfilled
5157\& 0:d=0 hl=2 l= 32 cons: SEQUENCE 5384\& 0:d=0 hl=2 l= 32 cons: SEQUENCE
5158\& 2:d=1 hl=2 l= 12 cons: SEQUENCE 5385\& 2:d=1 hl=2 l= 12 cons: SEQUENCE
5159\& 4:d=2 hl=2 l= 8 prim: OBJECT :md5 5386\& 4:d=2 hl=2 l= 8 prim: OBJECT :md5
5160\& 14:d=2 hl=2 l= 0 prim: NULL 5387\& 14:d=2 hl=2 l= 0 prim: NULL
5161\& 16:d=1 hl=2 l= 16 prim: OCTET STRING 5388\& 16:d=1 hl=2 l= 16 prim: OCTET STRING
5162\& 0000 - f3 46 9e aa 1a 4a 73 c9-37 ea 93 00 48 25 08 b5 .F...Js.7...H%.. 5389\& 0000 - f3 46 9e aa 1a 4a 73 c9-37 ea 93 00 48 25 08 b5 .F...Js.7...H%..
5163.Ed 5390.Ed
5164.Pp 5391.Pp
5165This is the parsed version of an ASN1 5392This is the parsed version of an ASN1
@@ -5168,13 +5395,12 @@ structure.
5168It can be seen that the digest used was md5. 5395It can be seen that the digest used was md5.
5169The actual part of the certificate that was signed can be extracted with: 5396The actual part of the certificate that was signed can be extracted with:
5170.Pp 5397.Pp
5171\& $ openssl asn1parse -in pca-cert.pem -out tbs -noout -strparse 4 5398.Dl "$ openssl asn1parse -in pca-cert.pem -out tbs -noout -strparse 4"
5172.Pp 5399.Pp
5173and its digest computed with: 5400and its digest computed with:
5174.Bd -literal 5401.Pp
5175\& $ openssl md5 -c tbs 5402.Dl $ openssl md5 -c tbs
5176\& MD5(tbs)= f3:46:9e:aa:1a:4a:73:c9:37:ea:93:00:48:25:08:b5 5403.D1 MD5(tbs)= f3:46:9e:aa:1a:4a:73:c9:37:ea:93:00:48:25:08:b5
5177.Ed
5178.Pp 5404.Pp
5179which it can be seen agrees with the recovered value above. 5405which it can be seen agrees with the recovered value above.
5180.\" 5406.\"
@@ -5183,7 +5409,9 @@ which it can be seen agrees with the recovered value above.
5183.Sh S_CLIENT 5409.Sh S_CLIENT
5184.Nm openssl s_client 5410.Nm openssl s_client
5185.Bk -words 5411.Bk -words
5186.Op Fl connect Ar host:port> 5412.Oo
5413.Fl connect Ar host Ns : Ns Ar port
5414.Oc
5187.Op Fl verify Ar depth 5415.Op Fl verify Ar depth
5188.Op Fl cert Ar filename 5416.Op Fl cert Ar filename
5189.Op Fl key Ar filename 5417.Op Fl key Ar filename
@@ -5192,6 +5420,7 @@ which it can be seen agrees with the recovered value above.
5192.Op Fl reconnect 5420.Op Fl reconnect
5193.Op Fl pause 5421.Op Fl pause
5194.Op Fl showcerts 5422.Op Fl showcerts
5423.Op Fl prexit
5195.Op Fl debug 5424.Op Fl debug
5196.Op Fl msg 5425.Op Fl msg
5197.Op Fl nbio_test 5426.Op Fl nbio_test
@@ -5207,9 +5436,9 @@ which it can be seen agrees with the recovered value above.
5207.Op Fl no_ssl3 5436.Op Fl no_ssl3
5208.Op Fl no_tls1 5437.Op Fl no_tls1
5209.Op Fl bugs 5438.Op Fl bugs
5439.Op Fl serverpref
5210.Op Fl cipher Ar cipherlist 5440.Op Fl cipher Ar cipherlist
5211.Op Fl starttls Ar protocol 5441.Op Fl starttls Ar protocol
5212.Op Fl starttls Ar protocol
5213.Op Fl engine Ar id 5442.Op Fl engine Ar id
5214.Op Fl rand Ar file ... 5443.Op Fl rand Ar file ...
5215.Ek 5444.Ek
@@ -5224,20 +5453,22 @@ useful diagnostic tool for SSL servers.
5224.Pp 5453.Pp
5225The options are as follows: 5454The options are as follows:
5226.Bl -tag -width "XXXX" 5455.Bl -tag -width "XXXX"
5227.It Fl connect Ar host:port 5456.It Xo
5457.Fl connect Ar host Ns : Ns Ar port
5458.Xc
5228This specifies the 5459This specifies the
5229.Ar host 5460.Ar host
5230and optional 5461and optional
5231.Ar port 5462.Ar port
5232to connect to. 5463to connect to.
5233If not specified then an attempt is made to connect to the local host 5464If not specified, then an attempt is made to connect to the local host
5234on port 4433. 5465on port 4433.
5235.It Fl cert Ar certname 5466.It Fl cert Ar certname
5236The certificate to use, if one is requested by the server. 5467The certificate to use, if one is requested by the server.
5237The default is not to use a certificate. 5468The default is not to use a certificate.
5238.It Fl key Ar keyfile 5469.It Fl key Ar keyfile
5239The private key to use. 5470The private key to use.
5240If not specified then the certificate file will be used. 5471If not specified, then the certificate file will be used.
5241.It Fl verify Ar depth 5472.It Fl verify Ar depth
5242The verify 5473The verify
5243.Ar depth 5474.Ar depth
@@ -5252,7 +5483,9 @@ certificate verify failure.
5252The 5483The
5253.Ar directory 5484.Ar directory
5254to use for server certificate verification. 5485to use for server certificate verification.
5255This directory must be in "hash format", see 5486This directory must be in
5487.Qq hash format ;
5488see
5256.Fl verify 5489.Fl verify
5257for more information. 5490for more information.
5258These are also used when building the client certificate chain. 5491These are also used when building the client certificate chain.
@@ -5273,7 +5506,7 @@ certificate itself is displayed.
5273Print session information when the program exits. 5506Print session information when the program exits.
5274This will always attempt 5507This will always attempt
5275to print out information even if the connection fails. 5508to print out information even if the connection fails.
5276Normally information will only be printed out once if the connection succeeds. 5509Normally, information will only be printed out once if the connection succeeds.
5277This option is useful because the cipher in use may be renegotiated 5510This option is useful because the cipher in use may be renegotiated
5278or the connection may fail because a client certificate is required or is 5511or the connection may fail because a client certificate is required or is
5279requested only after an attempt is made to access a certain URL. 5512requested only after an attempt is made to access a certain URL.
@@ -5301,10 +5534,12 @@ Inhibit printing of session and certificate information.
5301This implicitly turns on 5534This implicitly turns on
5302.Fl ign_eof 5535.Fl ign_eof
5303as well. 5536as well.
5304.It Fl ssl2 , ssl3 , tls1 , no_ssl2 , 5537.It Xo
5305.It Fl no_ssl3 , no_tls1 5538.Fl ssl2 | ssl3 | tls1 |
5539.Fl no_ssl2 | no_ssl3 | no_tls1
5540.Xc
5306These options disable the use of certain SSL or TLS protocols. 5541These options disable the use of certain SSL or TLS protocols.
5307By default the initial handshake uses a method which should be compatible 5542By default, the initial handshake uses a method which should be compatible
5308with all servers and permit them to use SSL v3, SSL v2 or TLS as appropriate. 5543with all servers and permit them to use SSL v3, SSL v2 or TLS as appropriate.
5309.Pp 5544.Pp
5310Unfortunately there are a lot of ancient and broken servers in use which 5545Unfortunately there are a lot of ancient and broken servers in use which
@@ -5317,9 +5552,12 @@ option.
5317.It Fl bugs 5552.It Fl bugs
5318There are several known bugs in SSL and TLS implementations. 5553There are several known bugs in SSL and TLS implementations.
5319Adding this option enables various workarounds. 5554Adding this option enables various workarounds.
5555.It Fl serverpref
5556Use server's cipher preferences
5557.Pq SSLv2 only .
5320.It Fl cipher Ar cipherlist 5558.It Fl cipher Ar cipherlist
5321This allows the cipher list sent by the client to be modified. 5559This allows the cipher list sent by the client to be modified.
5322Although the server determines which cipher suite is used it should take 5560Although the server determines which cipher suite is used, it should take
5323the first supported cipher in the list sent by the client. 5561the first supported cipher in the list sent by the client.
5324See the 5562See the
5325.Sx CIPHERS 5563.Sx CIPHERS
@@ -5328,7 +5566,8 @@ section above for more information.
5328Send the protocol-specific message(s) to switch to TLS for communication. 5566Send the protocol-specific message(s) to switch to TLS for communication.
5329.Ar protocol 5567.Ar protocol
5330is a keyword for the intended protocol. 5568is a keyword for the intended protocol.
5331Currently, the only supported keyword is "smtp". 5569Currently, the only supported keyword is
5570.Qq smtp .
5332.It Fl engine Ar id 5571.It Fl engine Ar id
5333Specifying an engine (by it's unique 5572Specifying an engine (by it's unique
5334.Ar id 5573.Ar id
@@ -5338,25 +5577,14 @@ to attempt to obtain a functional reference to the specified engine,
5338thus initialising it if needed. 5577thus initialising it if needed.
5339The engine will then be set as the default for all available algorithms. 5578The engine will then be set as the default for all available algorithms.
5340.It Fl rand Ar file ... 5579.It Fl rand Ar file ...
5341A 5580A file or files containing random data used to seed the random number generator,
5342.Ar file
5343or
5344.Ar file Ns Li s
5345containing random data used to seed the random number generator,
5346or an EGD socket (see 5581or an EGD socket (see
5347.Xr RAND_egd 3 ) . 5582.Xr RAND_egd 3 ) .
5348Multiple files can be specified separated by an OS-dependent character. 5583Multiple files can be specified separated by a
5349The separator is 5584.Sq \&: .
5350.Cm \&;
5351for MS-Windows,
5352.Cm \&,
5353for OpenVMS, and
5354.Cm \&:
5355for
5356all others.
5357.El 5585.El
5358.Sh S_CLIENT CONNECTED COMMANDS 5586.Sh S_CLIENT CONNECTED COMMANDS
5359If a connection is established with an SSL server then any data received 5587If a connection is established with an SSL server, then any data received
5360from the server is displayed and any key presses will be sent to the 5588from the server is displayed and any key presses will be sent to the
5361server. 5589server.
5362When used interactively (which means neither 5590When used interactively (which means neither
@@ -5364,8 +5592,8 @@ When used interactively (which means neither
5364nor 5592nor
5365.Fl ign_eof 5593.Fl ign_eof
5366have been given), the session will be renegotiated if the line begins with an 5594have been given), the session will be renegotiated if the line begins with an
5367.Em R , 5595.Em R ;
5368and if the line begins with a 5596if the line begins with a
5369.Em Q 5597.Em Q
5370or if end of file is reached, the connection will be closed down. 5598or if end of file is reached, the connection will be closed down.
5371.Sh S_CLIENT NOTES 5599.Sh S_CLIENT NOTES
@@ -5373,14 +5601,16 @@ or if end of file is reached, the connection will be closed down.
5373can be used to debug SSL servers. 5601can be used to debug SSL servers.
5374To connect to an SSL HTTP server the command: 5602To connect to an SSL HTTP server the command:
5375.Pp 5603.Pp
5376\& $ openssl s_client -connect servername:443 5604.Dl $ openssl s_client -connect servername:443
5377.Pp 5605.Pp
5378would typically be used (https uses port 443). 5606would typically be used
5379If the connection succeeds then an HTTP command can be given such as 5607.Pq HTTPS uses port 443 .
5380"GET" to retrieve a web page. 5608If the connection succeeds, then an HTTP command can be given such as
5609.Qq GET
5610to retrieve a web page.
5381.Pp 5611.Pp
5382If the handshake fails then there are several possible causes; if it is 5612If the handshake fails, then there are several possible causes; if it is
5383nothing obvious like no client certificate then the 5613nothing obvious like no client certificate, then the
5384.Fl bugs , ssl2 , ssl3 , tls1 , 5614.Fl bugs , ssl2 , ssl3 , tls1 ,
5385.Fl no_ssl2 , no_ssl3 5615.Fl no_ssl2 , no_ssl3
5386and 5616and
@@ -5395,9 +5625,10 @@ mailing list.
5395A frequent problem when attempting to get client certificates working 5625A frequent problem when attempting to get client certificates working
5396is that a web client complains it has no certificates or gives an empty 5626is that a web client complains it has no certificates or gives an empty
5397list to choose from. 5627list to choose from.
5398This is normally because the server is not sending the clients certificate 5628This is normally because the server is not sending the client's certificate
5399authority in its "acceptable CA list" when it 5629authority in its
5400requests a certificate. 5630.Qq acceptable CA list
5631when it requests a certificate.
5401By using 5632By using
5402.Nm s_client 5633.Nm s_client
5403the CA list can be viewed and checked. 5634the CA list can be viewed and checked.
@@ -5409,12 +5640,12 @@ command and send an HTTP request for an appropriate page.
5409.Pp 5640.Pp
5410If a certificate is specified on the command line using the 5641If a certificate is specified on the command line using the
5411.Fl cert 5642.Fl cert
5412option it will not be used unless the server specifically requests 5643option, it will not be used unless the server specifically requests
5413a client certificate. 5644a client certificate.
5414Therefore merely including a client certificate 5645Therefore merely including a client certificate
5415on the command line is no guarantee that the certificate works. 5646on the command line is no guarantee that the certificate works.
5416.Pp 5647.Pp
5417If there are problems verifying a server certificate then the 5648If there are problems verifying a server certificate, then the
5418.Fl showcerts 5649.Fl showcerts
5419option can be used to show the whole chain. 5650option can be used to show the whole chain.
5420.Sh S_CLIENT BUGS 5651.Sh S_CLIENT BUGS
@@ -5457,6 +5688,7 @@ We should really report information whenever a session is renegotiated.
5457.Op Fl CAfile Ar filename 5688.Op Fl CAfile Ar filename
5458.Op Fl nocert 5689.Op Fl nocert
5459.Op Fl cipher Ar cipherlist 5690.Op Fl cipher Ar cipherlist
5691.Op Fl serverpref
5460.Op Fl quiet 5692.Op Fl quiet
5461.Op Fl no_tmp_rsa 5693.Op Fl no_tmp_rsa
5462.Op Fl ssl2 5694.Op Fl ssl2
@@ -5493,16 +5725,17 @@ Sets the SSL context id.
5493It can be given any string value. 5725It can be given any string value.
5494If this option is not present, a default value will be used. 5726If this option is not present, a default value will be used.
5495.It Fl cert Ar certname 5727.It Fl cert Ar certname
5496The certificate to use; most servers cipher suites require the use of a 5728The certificate to use; most server's cipher suites require the use of a
5497certificate and some require a certificate with a certain public key type: 5729certificate and some require a certificate with a certain public key type:
5498for example the DSS cipher suites require a certificate containing a DSS 5730for example the DSS cipher suites require a certificate containing a DSS
5499(DSA) key. 5731.Pq DSA
5500If not specified then the filename 5732key.
5733If not specified, then the filename
5501.Pa server.pem 5734.Pa server.pem
5502will be used. 5735will be used.
5503.It Fl key Ar keyfile 5736.It Fl key Ar keyfile
5504The private key to use. 5737The private key to use.
5505If not specified then the certificate file will be used. 5738If not specified, then the certificate file will be used.
5506.It Fl dcert Ar filename , Fl dkey Ar keyname 5739.It Fl dcert Ar filename , Fl dkey Ar keyname
5507Specify an additional certificate and private key; these behave in the 5740Specify an additional certificate and private key; these behave in the
5508same manner as the 5741same manner as the
@@ -5510,18 +5743,20 @@ same manner as the
5510and 5743and
5511.Fl key 5744.Fl key
5512options except there is no default if they are not specified 5745options except there is no default if they are not specified
5513(no additional certificate and key is used). 5746.Pq no additional certificate and key is used .
5514As noted above some cipher suites require a certificate containing a key of 5747As noted above some cipher suites require a certificate containing a key of
5515a certain type. 5748a certain type.
5516Some cipher suites need a certificate carrying an RSA key 5749Some cipher suites need a certificate carrying an RSA key
5517and some a DSS (DSA) key. 5750and some a DSS
5751.Pq DSA
5752key.
5518By using RSA and DSS certificates and keys 5753By using RSA and DSS certificates and keys
5519a server can support clients which only support RSA or DSS cipher suites 5754a server can support clients which only support RSA or DSS cipher suites
5520by using an appropriate certificate. 5755by using an appropriate certificate.
5521.It Fl nocert 5756.It Fl nocert
5522If this option is set then no certificate is used. 5757If this option is set, then no certificate is used.
5523This restricts the cipher suites available to the anonymous ones 5758This restricts the cipher suites available to the anonymous ones
5524(currently just anonymous DH). 5759.Pq currently just anonymous DH .
5525.It Fl dhparam Ar filename 5760.It Fl dhparam Ar filename
5526The DH parameter file to use. 5761The DH parameter file to use.
5527The ephemeral DH cipher suites generate keys 5762The ephemeral DH cipher suites generate keys
@@ -5545,15 +5780,17 @@ This specifies the maximum length of the client certificate chain
5545and makes the server request a certificate from the client. 5780and makes the server request a certificate from the client.
5546With the 5781With the
5547.Fl verify 5782.Fl verify
5548option a certificate is requested but the client does not have to send one. 5783option, a certificate is requested but the client does not have to send one.
5549With the 5784With the
5550.Fl Verify 5785.Fl Verify
5551option the client must supply a certificate or an error occurs. 5786option, the client must supply a certificate or an error occurs.
5552.It Fl CApath Ar directory 5787.It Fl CApath Ar directory
5553The 5788The
5554.Ar directory 5789.Ar directory
5555to use for client certificate verification. 5790to use for client certificate verification.
5556This directory must be in "hash format", see 5791This directory must be in
5792.Qq hash format ;
5793see
5557.Fl verify 5794.Fl verify
5558for more information. 5795for more information.
5559These are also used when building the server certificate chain. 5796These are also used when building the server certificate chain.
@@ -5569,15 +5806,17 @@ Print extensive debugging information including a hex dump of all traffic.
5569.It Fl msg 5806.It Fl msg
5570Show all protocol messages with hex dump. 5807Show all protocol messages with hex dump.
5571.It Fl nbio_test 5808.It Fl nbio_test
5572Tests non blocking I/O. 5809Tests non-blocking I/O.
5573.It Fl nbio 5810.It Fl nbio
5574Turns on non blocking I/O. 5811Turns on non-blocking I/O.
5575.It Fl crlf 5812.It Fl crlf
5576This option translates a line feed from the terminal into CR+LF. 5813This option translates a line feed from the terminal into CR+LF.
5577.It Fl quiet 5814.It Fl quiet
5578Inhibit printing of session and certificate information. 5815Inhibit printing of session and certificate information.
5579.It Fl ssl2 , ssl3 , tls1 , no_ssl2 , 5816.It Xo
5580.It Fl no_ssl3 , no_tls1 5817.Fl ssl2 | ssl3 | tls1 |
5818.Fl no_ssl2 | no_ssl3 | no_tls1
5819.Xc
5581These options disable the use of certain SSL or TLS protocols. 5820These options disable the use of certain SSL or TLS protocols.
5582By default, the initial handshake uses a method which should be compatible 5821By default, the initial handshake uses a method which should be compatible
5583with all servers and permit them to use SSL v3, SSL v2 or TLS as appropriate. 5822with all servers and permit them to use SSL v3, SSL v2 or TLS as appropriate.
@@ -5586,16 +5825,19 @@ There are several known bugs in SSL and TLS implementations.
5586Adding this option enables various workarounds. 5825Adding this option enables various workarounds.
5587.It Fl hack 5826.It Fl hack
5588This option enables a further workaround for some some early Netscape 5827This option enables a further workaround for some some early Netscape
5589SSL code (?). 5828SSL code
5829.Pq \&? .
5590.It Fl cipher Ar cipherlist 5830.It Fl cipher Ar cipherlist
5591This allows the cipher list used by the server to be modified. 5831This allows the cipher list used by the server to be modified.
5592When the client sends a list of supported ciphers, the first client cipher 5832When the client sends a list of supported ciphers, the first client cipher
5593also included in the server list is used. 5833also included in the server list is used.
5594Because the client specifies the preference order, the order of the server 5834Because the client specifies the preference order, the order of the server
5595cipherlist irrelevant. 5835cipherlist is irrelevant.
5596See the 5836See the
5597.Sx CIPHERS 5837.Sx CIPHERS
5598section for more information. 5838section for more information.
5839.It Fl serverpref
5840Use server's cipher preferences.
5599.It Fl www 5841.It Fl www
5600Sends a status message back to the client when it connects. 5842Sends a status message back to the client when it connects.
5601This includes lots of information about the ciphers used and various 5843This includes lots of information about the ciphers used and various
@@ -5632,25 +5874,17 @@ The engine will then be set as the default for all available algorithms.
5632.It Fl id_prefix Ar arg 5874.It Fl id_prefix Ar arg
5633Generate SSL/TLS session IDs prefixed by 5875Generate SSL/TLS session IDs prefixed by
5634.Ar arg . 5876.Ar arg .
5635This is mostly useful for testing any SSL/TLS code (e.g. proxies) that wish 5877This is mostly useful for testing any SSL/TLS code
5636to deal with multiple servers, when each of which might be generating a 5878.Pq e.g. proxies
5637unique range of session IDs (e.g. with a certain prefix). 5879that wish to deal with multiple servers, when each of which might be
5880generating a unique range of session IDs
5881.Pq e.g. with a certain prefix .
5638.It Fl rand Ar file ... 5882.It Fl rand Ar file ...
5639A 5883A file or files containing random data used to seed the random number generator,
5640.Ar file
5641or
5642.Ar file Ns Li s
5643containing random data used to seed the random number generator,
5644or an EGD socket (see 5884or an EGD socket (see
5645.Xr RAND_egd 3 ) . 5885.Xr RAND_egd 3 ) .
5646Multiple files can be specified separated by an OS-dependent character. 5886Multiple files can be specified separated by a
5647The separator is 5887.Sq \&: .
5648.Cm \&;
5649for MS-Windows,
5650.Cm \&,
5651for OpenVMS, and
5652.Cm \&:
5653for all others.
5654.El 5888.El
5655.Sh S_SERVER CONNECTED COMMANDS 5889.Sh S_SERVER CONNECTED COMMANDS
5656If a connection request is established with an SSL client and neither the 5890If a connection request is established with an SSL client and neither the
@@ -5682,13 +5916,14 @@ Print out some session cache status information.
5682can be used to debug SSL clients. 5916can be used to debug SSL clients.
5683To accept connections from a web browser the command: 5917To accept connections from a web browser the command:
5684.Pp 5918.Pp
5685\& $ openssl s_server -accept 443 -www 5919.Dl $ openssl s_server -accept 443 -www
5686.Pp 5920.Pp
5687can be used for example. 5921can be used for example.
5688.Pp 5922.Pp
5689Most web browsers (in particular Netscape and MSIE) only support RSA cipher 5923Most web browsers
5690suites, so they cannot connect to servers which don't use a certificate 5924.Pq in particular Netscape and MSIE
5691carrying an RSA key or a version of 5925only support RSA cipher suites, so they cannot connect to servers
5926which don't use a certificate carrying an RSA key or a version of
5692.Nm OpenSSL 5927.Nm OpenSSL
5693with RSA disabled. 5928with RSA disabled.
5694.Pp 5929.Pp
@@ -5721,34 +5956,35 @@ unknown cipher suites a client says it supports.
5721.Sh S_TIME 5956.Sh S_TIME
5722The 5957The
5723.Nm s_time 5958.Nm s_time
5724utility is undocumented. 5959utility is currently undocumented.
5725.\" 5960.\"
5726.\" SESS_ID 5961.\" SESS_ID
5727.\" 5962.\"
5728.Sh SESS_ID 5963.Sh SESS_ID
5729.Nm openssl sess_id 5964.Nm openssl sess_id
5730.Bk -words 5965.Bk -words
5731.Op Fl inform Ar PEM|DER 5966.Op Fl inform Ar DER | PEM
5732.Op Fl outform Ar PEM|DER 5967.Op Fl outform Ar DER | PEM
5733.Op Fl in Ar filename 5968.Op Fl in Ar filename
5734.Op Fl out Ar filename 5969.Op Fl out Ar filename
5735.Op Fl text 5970.Op Fl text
5971.Op Fl cert
5736.Op Fl noout 5972.Op Fl noout
5737.Op Fl context Ar ID 5973.Op Fl context Ar ID
5738.Ek 5974.Ek
5739.Pp 5975.Pp
5740The 5976The
5741.Nm sess_id 5977.Nm sess_id
5742program processes the encoded version of the SSL 5978program processes the encoded version of the SSL session structure and
5743session structure and optionally prints out SSL 5979optionally prints out SSL session details
5744session details (for example the SSL 5980.Pq for example the SSL session master key
5745session master key) in human readable format. 5981in human readable format.
5746Since this is a diagnostic tool that needs some knowledge of the SSL 5982Since this is a diagnostic tool that needs some knowledge of the SSL
5747protocol to use properly, most users will not need to use it. 5983protocol to use properly, most users will not need to use it.
5748.Pp 5984.Pp
5749The options are as follows: 5985The options are as follows:
5750.Bl -tag -width "XXXX" 5986.Bl -tag -width "XXXX"
5751.It Fl inform Ar DER|PEM 5987.It Fl inform Ar DER | PEM
5752This specifies the input format. 5988This specifies the input format.
5753The 5989The
5754.Ar DER 5990.Ar DER
@@ -5759,8 +5995,8 @@ The
5759.Ar PEM 5995.Ar PEM
5760form is the default format: it consists of the DER 5996form is the default format: it consists of the DER
5761format base64 encoded with additional header and footer lines. 5997format base64 encoded with additional header and footer lines.
5762.It Fl outform Ar DER|PEM 5998.It Fl outform Ar DER | PEM
5763This specifies the output format, the options have the same meaning as the 5999This specifies the output format; the options have the same meaning as the
5764.Fl inform 6000.Fl inform
5765option. 6001option.
5766.It Fl in Ar filename 6002.It Fl in Ar filename
@@ -5776,14 +6012,15 @@ output if this option is not specified.
5776Prints out the various public or private key components in 6012Prints out the various public or private key components in
5777plain text in addition to the encoded version. 6013plain text in addition to the encoded version.
5778.It Fl cert 6014.It Fl cert
5779If a certificate is present in the session it will be output using this option, 6015If a certificate is present in the session,
6016it will be output using this option;
5780if the 6017if the
5781.Fl text 6018.Fl text
5782option is also present then it will be printed out in text form. 6019option is also present, then it will be printed out in text form.
5783.It Fl noout 6020.It Fl noout
5784This option prevents output of the encoded version of the session. 6021This option prevents output of the encoded version of the session.
5785.It Fl context Ar ID 6022.It Fl context Ar ID
5786This option can set the session id so the output session information uses the 6023This option can set the session ID so the output session information uses the
5787supplied 6024supplied
5788.Ar ID . 6025.Ar ID .
5789The 6026The
@@ -5793,7 +6030,7 @@ This option won't normally be used.
5793.El 6030.El
5794.Sh SESS_ID OUTPUT 6031.Sh SESS_ID OUTPUT
5795Typical output: 6032Typical output:
5796.Bd -literal 6033.Bd -unfilled
5797\& SSL-Session: 6034\& SSL-Session:
5798\& Protocol : TLSv1 6035\& Protocol : TLSv1
5799\& Cipher : 0016 6036\& Cipher : 0016
@@ -5820,10 +6057,11 @@ The session ID context in hex format.
5820.It Ar Master-Key 6057.It Ar Master-Key
5821This is the SSL session master key. 6058This is the SSL session master key.
5822.It Ar Key-Arg 6059.It Ar Key-Arg
5823The key argument, this is only used in SSL v2. 6060The key argument; this is only used in SSL v2.
5824.It Ar Start Time 6061.It Ar Start Time
5825This is the session start time, represented as an integer 6062This is the session start time, represented as an integer in standard
5826in standard Unix format. 6063.Ux
6064format.
5827.It Ar Timeout 6065.It Ar Timeout
5828The timeout in seconds. 6066The timeout in seconds.
5829.It Ar Verify return code 6067.It Ar Verify return code
@@ -5833,15 +6071,17 @@ This is the return code when an SSL client certificate is verified.
5833The 6071The
5834.Em PEM 6072.Em PEM
5835encoded session format uses the header and footer lines: 6073encoded session format uses the header and footer lines:
5836.Bd -literal 6074.Bd -unfilled -offset indent
5837\& -----BEGIN SSL SESSION PARAMETERS----- 6075-----BEGIN SSL SESSION PARAMETERS-----
5838\& -----END SSL SESSION PARAMETERS----- 6076-----END SSL SESSION PARAMETERS-----
5839.Ed 6077.Ed
5840.Pp 6078.Pp
5841Since the SSL session output contains the master key, it is possible to read 6079Since the SSL session output contains the master key, it is possible to read
5842the contents of an encrypted session using this information. 6080the contents of an encrypted session using this information.
5843Therefore appropriate security precautions 6081Therefore appropriate security precautions
5844should be taken if the information is being output by a "real" application. 6082should be taken if the information is being output by a
6083.Qq real
6084application.
5845This is, however, strongly discouraged and should only be used for 6085This is, however, strongly discouraged and should only be used for
5846debugging purposes. 6086debugging purposes.
5847.Sh SESS_ID BUGS 6087.Sh SESS_ID BUGS
@@ -5857,25 +6097,39 @@ The cipher and start time should be printed out in human readable form.
5857.Op Fl sign 6097.Op Fl sign
5858.Op Fl verify 6098.Op Fl verify
5859.Op Fl pk7out 6099.Op Fl pk7out
5860.Op Fl des 6100.Oo Xo
5861.Op Fl des3 6101.Fl des | des3 | rc2-40 | rc2-64 |
5862.Op Fl rc2-40 6102.Fl rc2-128 | aes128 | aes192 | aes256
5863.Op Fl rc2-64 6103.Xc
5864.Op Fl rc2-128 6104.Oc
6105.Op Fl nointern
6106.Op Fl noverify
6107.Op Fl nochain
6108.Op Fl nosigs
6109.Op Fl nocerts
6110.Op Fl noattr
6111.Op Fl binary
6112.Op Fl nodetach
5865.Op Fl in Ar file 6113.Op Fl in Ar file
5866.Op Fl certfile Ar file 6114.Op Fl certfile Ar file
5867.Op Fl signer Ar file 6115.Op Fl signer Ar file
5868.Op Fl recip Ar file 6116.Op Fl recip Ar file
5869.Op Fl inform Ar SMIME|PEM|DER 6117.Op Fl inform Ar SMIME | DER | PEM
5870.Op Fl passin Ar arg 6118.Op Fl passin Ar arg
5871.Op Fl inkey Ar file 6119.Op Fl inkey Ar file
6120.Op Fl keyform Ar PEM | ENGINE
5872.Op Fl out Ar file 6121.Op Fl out Ar file
5873.Op Fl outform Ar SMIME|PEM|DER 6122.Op Fl outform Ar SMIME | DER | PEM
5874.Op Fl content Ar file 6123.Op Fl content Ar file
5875.Op Fl to Ar addr 6124.Op Fl to Ar addr
5876.Op Fl from Ar addr 6125.Op Fl from Ar addr
5877.Op Fl subject Ar s 6126.Op Fl subject Ar s
5878.Op Fl text 6127.Op Fl text
6128.Op Fl CAfile Ar file
6129.Op Fl CApath Ar directory
6130.Op Fl crl_check
6131.Op Fl crl_check_all
6132.Op Fl engine Ar id
5879.Op Fl rand Ar file ... 6133.Op Fl rand Ar file ...
5880.Op Ar cert.pem ... 6134.Op Ar cert.pem ...
5881.Ek 6135.Ek
@@ -5925,7 +6179,7 @@ The input message to be encrypted or signed or the
5925.Em MIME 6179.Em MIME
5926message to 6180message to
5927be decrypted or verified. 6181be decrypted or verified.
5928.It Fl inform Ar SMIME|PEM|DER 6182.It Fl inform Ar SMIME | DER | PEM
5929This specifies the input format for the PKCS#7 structure. 6183This specifies the input format for the PKCS#7 structure.
5930The default is 6184The default is
5931.Em SMIME 6185.Em SMIME
@@ -5938,16 +6192,16 @@ and
5938format change this to expect PEM and DER format PKCS#7 structures 6192format change this to expect PEM and DER format PKCS#7 structures
5939instead. 6193instead.
5940This currently only affects the input format of the PKCS#7 6194This currently only affects the input format of the PKCS#7
5941structure, if no PKCS#7 structure is being input (for example with 6195structure; if no PKCS#7 structure is being input (for example with
5942.Fl encrypt 6196.Fl encrypt
5943or 6197or
5944.Fl sign ) 6198.Fl sign ) ,
5945this option has no effect. 6199this option has no effect.
5946.It Fl out Ar filename 6200.It Fl out Ar filename
5947The message text that has been decrypted or verified, or the output 6201The message text that has been decrypted or verified, or the output
5948.Em MIME 6202.Em MIME
5949format message that has been signed or verified. 6203format message that has been signed or verified.
5950.It Fl outform Ar SMIME|PEM|DER 6204.It Fl outform Ar SMIME | DER | PEM
5951This specifies the output format for the PKCS#7 structure. 6205This specifies the output format for the PKCS#7 structure.
5952The default is 6206The default is
5953.Em SMIME 6207.Em SMIME
@@ -5978,7 +6232,8 @@ and it uses the multipart/signed
5978.Em MIME 6232.Em MIME
5979content type. 6233content type.
5980.It Fl text 6234.It Fl text
5981This option adds plain text (text/plain) 6235This option adds plain text
6236.Pq text/plain
5982.Em MIME 6237.Em MIME
5983headers to the supplied message if encrypting or signing. 6238headers to the supplied message if encrypting or signing.
5984If decrypting or verifying it strips off text headers: 6239If decrypting or verifying it strips off text headers:
@@ -5988,36 +6243,44 @@ type text/plain then an error occurs.
5988.It Fl CAfile Ar file 6243.It Fl CAfile Ar file
5989A 6244A
5990.Ar file 6245.Ar file
5991containing trusted CA certificates, only used with 6246containing trusted CA certificates; only used with
5992.Fl verify . 6247.Fl verify .
5993.It Fl CApath Ar dir 6248.It Fl CApath Ar dir
5994A 6249A
5995.Ar directory 6250.Ar directory
5996containing trusted CA certificates, only used with 6251containing trusted CA certificates; only used with
5997.Fl verify . 6252.Fl verify .
5998This directory must be a standard certificate directory; 6253This directory must be a standard certificate directory;
5999that is, a hash of each subject name (using 6254that is, a hash of each subject name (using
6000.Nm x509 -hash ) 6255.Nm x509 -hash )
6001should be linked to each certificate. 6256should be linked to each certificate.
6002.It Fl des des3 rc2-40 rc2-64 rc2-128 6257.It Xo
6258.Fl des | des3 | rc2-40 | rc2-64 |
6259.Fl rc2-128 | aes128 | aes192 | aes256
6260.Xc
6003The encryption algorithm to use. 6261The encryption algorithm to use.
6004DES (56 bits), triple DES\s0 (168 bits) 6262DES
6005or 40, 64 or 128 bit RC2, respectively; if not specified 40 bit RC2 is 6263.Pq 56 bits ,
6264triple DES
6265.Pq 168 bits ,
626640-, 64-, or 128-bit RC2, or 128-, 192-, or 256-bit AES, respectively;
6267if not specified, 40-bit RC2 is
6006used. 6268used.
6007Only used with 6269Only used with
6008.Fl encrypt . 6270.Fl encrypt .
6009.It Fl nointern 6271.It Fl nointern
6010When verifying a message, normally certificates (if any) included in 6272When verifying a message, normally certificates
6011the message are searched for the signing certificate. 6273.Pq if any
6012With this option only the certificates specified in the 6274included in the message are searched for the signing certificate.
6275With this option, only the certificates specified in the
6013.Fl certfile 6276.Fl certfile
6014option are used. 6277option are used.
6015The supplied certificates can still be used as untrusted CAs however. 6278The supplied certificates can still be used as untrusted CAs however.
6016.It Fl noverify 6279.It Fl noverify
6017Do not verify the signer's certificate of a signed message. 6280Do not verify the signer's certificate of a signed message.
6018.It Fl nochain 6281.It Fl nochain
6019Do not do chain verification of signers' certificates: that is don't 6282Do not do chain verification of signers' certificates: that is,
6020use the certificates in the signed message as untrusted CAs. 6283don't use the certificates in the signed message as untrusted CAs.
6021.It Fl nosigs 6284.It Fl nosigs
6022Don't try to verify the signatures on the message. 6285Don't try to verify the signatures on the message.
6023.It Fl nocerts 6286.It Fl nocerts
@@ -6032,8 +6295,9 @@ Normally, when a message is signed a set of attributes are included which
6032include the signing time and supported symmetric algorithms. 6295include the signing time and supported symmetric algorithms.
6033With this option they are not included. 6296With this option they are not included.
6034.It Fl binary 6297.It Fl binary
6035Normally the input message is converted to "canonical" format which is 6298Normally, the input message is converted to
6036effectively using CR and LF as end of line: as required by the 6299.Qq canonical
6300format which is effectively using CR and LF as end of line: as required by the
6037.Em S/MIME 6301.Em S/MIME
6038specification. 6302specification.
6039When this option is present no translation occurs. 6303When this option is present no translation occurs.
@@ -6066,36 +6330,42 @@ must match one of the recipients of the message or an error occurs.
6066.It Fl inkey Ar file 6330.It Fl inkey Ar file
6067The private key to use when signing or decrypting. 6331The private key to use when signing or decrypting.
6068This must match the corresponding certificate. 6332This must match the corresponding certificate.
6069If this option is not specified then the private key must be included 6333If this option is not specified, then the private key must be included
6070in the certificate file specified with 6334in the certificate file specified with
6071the 6335the
6072.Fl recip 6336.Fl recip
6073or 6337or
6074.Fl signer 6338.Fl signer
6075file. 6339file.
6340.It Fl keyform Ar PEM | ENGINE
6341Input private key format.
6076.It Fl passin Ar arg 6342.It Fl passin Ar arg
6077The private key password source. 6343The private key password source.
6078For more information about the format of 6344For more information about the format of
6079.Ar arg 6345.Ar arg ,
6080see the 6346see the
6081.Sx PASS PHRASE ARGUMENTS 6347.Sx PASS PHRASE ARGUMENTS
6082section above. 6348section above.
6349.It Fl crl_check
6350Check revocation status of signer's certificate using CRLs.
6351.It Fl crl_check_all
6352Check revocation status of signer's certificate chain using CRLs.
6353.It Fl engine Ar id
6354Specifying an engine (by it's unique
6355.Ar id
6356string) will cause
6357.Nm smime
6358to attempt to obtain a functional reference to the specified engine,
6359thus initialising it if needed.
6360The engine will then be set as the default
6361for all available algorithms.
6083.It Fl rand Ar file ... 6362.It Fl rand Ar file ...
6084A 6363A file or files
6085.Ar file
6086or
6087.Ar file Ns Li s
6088containing random data used to seed the random number generator, 6364containing random data used to seed the random number generator,
6089or an EGD socket (see 6365or an EGD socket (see
6090.Xr RAND_egd 3 ) . 6366.Xr RAND_egd 3 ) .
6091Multiple files can be specified separated by an OS-dependent character. 6367Multiple files can be specified separated by a
6092The separator is 6368.Sq \&: .
6093.Cm \&;
6094for MS-Windows,
6095.Cm \&,
6096for OpenVMS, and
6097.Cm \&:
6098for all others.
6099.It Ar cert.pem ... 6369.It Ar cert.pem ...
6100One or more certificates of message recipients: used when encrypting 6370One or more certificates of message recipients: used when encrypting
6101a message. 6371a message.
@@ -6122,13 +6392,15 @@ necessary
6122.Em MIME 6392.Em MIME
6123headers or many 6393headers or many
6124.Em S/MIME 6394.Em S/MIME
6125clients won't display it properly (if at all). 6395clients won't display it properly
6396.Pq if at all .
6126You can use the 6397You can use the
6127.Fl text 6398.Fl text
6128option to automatically add plain text headers. 6399option to automatically add plain text headers.
6129.Pp 6400.Pp
6130A "signed and encrypted" message is one where a signed message is 6401A
6131then encrypted. 6402.Qq signed and encrypted
6403message is one where a signed message is then encrypted.
6132This can be produced by encrypting an already signed message: 6404This can be produced by encrypting an already signed message:
6133see the 6405see the
6134.Sx SMIME EXAMPLES 6406.Sx SMIME EXAMPLES
@@ -6139,8 +6411,9 @@ will verify multiple signers on received messages.
6139Some 6411Some
6140.Em S/MIME 6412.Em S/MIME
6141clients choke if a message contains multiple signers. 6413clients choke if a message contains multiple signers.
6142It is possible to sign messages "in parallel" by signing an already 6414It is possible to sign messages
6143signed message. 6415.Qq in parallel
6416by signing an already signed message.
6144.Pp 6417.Pp
6145The options 6418The options
6146.Fl encrypt 6419.Fl encrypt
@@ -6167,56 +6440,58 @@ message.
6167An error occurred decrypting or verifying the message. 6440An error occurred decrypting or verifying the message.
6168.It Ar 5 6441.It Ar 5
6169The message was verified correctly, but an error occurred writing out 6442The message was verified correctly, but an error occurred writing out
6170the signers certificates. 6443the signer's certificates.
6171.El 6444.El
6172.Sh SMIME EXAMPLES 6445.Sh SMIME EXAMPLES
6173Create a cleartext signed message: 6446Create a cleartext signed message:
6174.Bd -literal 6447.Bd -literal -offset indent
6175\& $ openssl smime -sign -in message.txt -text -out mail.msg \e 6448$ openssl smime -sign -in message.txt -text -out mail.msg \e
6176\& -signer mycert.pem 6449 -signer mycert.pem
6177.Ed 6450.Ed
6178.Pp 6451.Pp
6179Create an opaque signed message: 6452Create an opaque signed message:
6180.Bd -literal 6453.Bd -literal -offset indent
6181\& $ openssl smime -sign -in message.txt -text -out mail.msg -nodetach \e 6454$ openssl smime -sign -in message.txt -text -out mail.msg \e
6182\& -signer mycert.pem 6455 -nodetach -signer mycert.pem
6183.Ed 6456.Ed
6184.Pp 6457.Pp
6185Create a signed message, include some additional certificates and 6458Create a signed message, include some additional certificates and
6186read the private key from another file: 6459read the private key from another file:
6187.Bd -literal 6460.Bd -literal -offset indent
6188\& $ openssl smime -sign -in in.txt -text -out mail.msg \e 6461$ openssl smime -sign -in in.txt -text -out mail.msg \e
6189\& -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem 6462 -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem
6190.Ed 6463.Ed
6191.Pp 6464.Pp
6192Send a signed message under Unix directly to 6465Send a signed message under
6466.Ux
6467directly to
6193.Xr sendmail 8 , 6468.Xr sendmail 8 ,
6194including headers: 6469including headers:
6195.Bd -literal 6470.Bd -literal -offset indent
6196\& $ openssl smime -sign -in in.txt -text -signer mycert.pem \e 6471$ openssl smime -sign -in in.txt -text -signer mycert.pem \e
6197\& -from steve@openssl.org -to someone@somewhere \e 6472 -from steve@openssl.org -to someone@somewhere \e
6198\& -subject "Signed message" | sendmail someone@somewhere 6473 -subject "Signed message" | sendmail someone@somewhere
6199.Ed 6474.Ed
6200.Pp 6475.Pp
6201Verify a message and extract the signer's certificate if successful: 6476Verify a message and extract the signer's certificate if successful:
6202.Bd -literal 6477.Bd -literal -offset indent
6203\& $ openssl smime -verify -in mail.msg -signer user.pem \e 6478$ openssl smime -verify -in mail.msg -signer user.pem \e
6204\& -out signedtext.txt 6479 -out signedtext.txt
6205.Ed 6480.Ed
6206.Pp 6481.Pp
6207Send encrypted mail using triple DES: 6482Send encrypted mail using triple DES:
6208.Bd -literal 6483.Bd -literal -offset indent
6209\& $ openssl smime -encrypt -in in.txt -from steve@openssl.org \e 6484$ openssl smime -encrypt -in in.txt -from steve@openssl.org \e
6210\& -to someone@somewhere -subject "Encrypted message" \e 6485 -to someone@somewhere -subject "Encrypted message" \e
6211\& -des3 user.pem -out mail.msg 6486 -des3 user.pem -out mail.msg
6212.Ed 6487.Ed
6213.Pp 6488.Pp
6214Sign and encrypt mail: 6489Sign and encrypt mail:
6215.Bd -literal 6490.Bd -literal -offset indent
6216\& $ openssl smime -sign -in ml.txt -signer my.pem -text \e 6491$ openssl smime -sign -in ml.txt -signer my.pem -text | \e
6217\& | openssl smime -encrypt -out mail.msg \e 6492 openssl smime -encrypt -out mail.msg \e
6218\& -from steve@openssl.org -to someone@somewhere \e 6493 -from steve@openssl.org -to someone@somewhere \e
6219\& -subject "Signed and Encrypted message" -des3 user.pem 6494 -subject "Signed and Encrypted message" -des3 user.pem
6220.Ed 6495.Ed
6221.Pp 6496.Pp
6222.Sy Note : 6497.Sy Note :
@@ -6227,28 +6502,30 @@ option because the message being encrypted already has
6227headers. 6502headers.
6228.Pp 6503.Pp
6229Decrypt mail: 6504Decrypt mail:
6230.Pp 6505.Bd -literal -offset indent
6231\& $ openssl smime -decrypt -in mail.msg -recip mycert.pem -inkey key.pem 6506$ openssl smime -decrypt -in mail.msg -recip mycert.pem \e
6507 -inkey key.pem"
6508.Ed
6232.Pp 6509.Pp
6233The output from Netscape form signing is a PKCS#7 structure with the 6510The output from Netscape form signing is a PKCS#7 structure with the
6234detached signature format. 6511detached signature format.
6235You can use this program to verify the signature by line wrapping the 6512You can use this program to verify the signature by line wrapping the
6236base64 encoded structure and surrounding it with: 6513base64 encoded structure and surrounding it with:
6237.Bd -literal 6514.Bd -unfilled -offset indent
6238\& -----BEGIN PKCS7----- 6515-----BEGIN PKCS7-----
6239\& -----END PKCS7----- 6516-----END PKCS7-----
6240.Ed 6517.Ed
6241.Pp 6518.Pp
6242and using the command: 6519and using the command:
6243.Bd -literal 6520.Bd -literal -offset indent
6244\& $ openssl smime -verify -inform PEM -in signature.pem 6521$ openssl smime -verify -inform PEM -in signature.pem \e
6245\& -content content.txt 6522 -content content.txt
6246.Ed 6523.Ed
6247.Pp 6524.Pp
6248Alternatively, you can base64 decode the signature and use: 6525Alternatively, you can base64 decode the signature and use:
6249.Bd -literal 6526.Bd -literal -offset indent
6250\& $ openssl smime -verify -inform DER -in signature.der 6527$ openssl smime -verify -inform DER -in signature.der \e
6251\& -content content.txt 6528 -content content.txt
6252.Ed 6529.Ed
6253.Sh SMIME BUGS 6530.Sh SMIME BUGS
6254The 6531The
@@ -6262,7 +6539,7 @@ extracted.
6262There should be some heuristic that determines the correct encryption 6539There should be some heuristic that determines the correct encryption
6263certificate. 6540certificate.
6264.Pp 6541.Pp
6265Ideally a database should be maintained of a certificate for each email 6542Ideally, a database should be maintained of a certificate for each email
6266address. 6543address.
6267.Pp 6544.Pp
6268The code doesn't currently take note of the permitted symmetric encryption 6545The code doesn't currently take note of the permitted symmetric encryption
@@ -6276,7 +6553,7 @@ No revocation checking is done on the signer's certificate.
6276.Pp 6553.Pp
6277The current code can only handle 6554The current code can only handle
6278.Em S/MIME 6555.Em S/MIME
6279v2 messages, the more complex 6556v2 messages; the more complex
6280.Em S/MIME 6557.Em S/MIME
6281v3 structures may cause parsing errors. 6558v3 structures may cause parsing errors.
6282.\" 6559.\"
@@ -6284,37 +6561,63 @@ v3 structures may cause parsing errors.
6284.\" 6561.\"
6285.Sh SPEED 6562.Sh SPEED
6286.Nm openssl speed 6563.Nm openssl speed
6287.Op Fl engine Ar id 6564.Bk -words
6288.Op Cm md2 6565.Op Cm aes
6289.Op Cm mdc2 6566.Op Cm aes-128-cbc
6290.Op Cm md5 6567.Op Cm aes-192-cbc
6291.Op Cm hmac 6568.Op Cm aes-256-cbc
6292.Op Cm sha1 6569.Op Cm blowfish
6293.Op Cm rmd160
6294.Op Cm idea-cbc
6295.Op Cm rc2-cbc
6296.Op Cm rc5-cbc
6297.Op Cm bf-cbc 6570.Op Cm bf-cbc
6571.Op Cm des
6298.Op Cm des-cbc 6572.Op Cm des-cbc
6299.Op Cm des-ede3 6573.Op Cm des-ede3
6300.Op Cm rc4
6301.Op Cm rsa512
6302.Op Cm rsa1024
6303.Op Cm rsa2048
6304.Op Cm rsa4096
6305.Op Cm dsa512 6574.Op Cm dsa512
6306.Op Cm dsa1024 6575.Op Cm dsa1024
6307.Op Cm dsa2048 6576.Op Cm dsa2048
6308.Op Cm idea 6577.Op Cm hmac
6578.Op Cm md2
6579.Op Cm md4
6580.Op Cm md5
6309.Op Cm rc2 6581.Op Cm rc2
6310.Op Cm des 6582.Op Cm rc2-cbc
6583.Op Cm rc4
6584.Op Cm rmd160
6311.Op Cm rsa 6585.Op Cm rsa
6312.Op Cm blowfish 6586.Op Cm rsa512
6587.Op Cm rsa1024
6588.Op Cm rsa2048
6589.Op Cm rsa4096
6590.Op Cm sha1
6591.Op Fl elapsed
6592.Op Fl evp Ar e
6593.Op Fl decrypt
6594.Op Fl mr
6595.Op Fl multi Ar number
6596.Op Fl engine Ar id
6597.Ek
6313.Pp 6598.Pp
6314The 6599The
6315.Nm speed 6600.Nm speed
6316command is used to test the performance of cryptographic algorithms. 6601command is used to test the performance of cryptographic algorithms.
6317.Bl -tag -width "XXXX" 6602.Bl -tag -width "XXXX"
6603.It Cm [zero or more test algorithms]
6604If any options are given,
6605.Nm speed
6606tests those algorithms, otherwise all of the above are tested.
6607.It Fl elapsed
6608Measure time in real time instead of CPU user time.
6609.It Fl evp Ar e
6610Use EVP
6611.Ar e .
6612.It Fl decrypt
6613Time decryption instead of encryption
6614.Pq only EVP .
6615.It Fl mr
6616Produce machine readable ouput.
6617.It Fl multi Ar number
6618Run
6619.Ar number
6620benchmarks in parallel.
6318.It Fl engine Ar id 6621.It Fl engine Ar id
6319Specifying an engine (by it's unique 6622Specifying an engine (by it's unique
6320.Ar id 6623.Ar id
@@ -6324,10 +6627,6 @@ to attempt to obtain a functional reference to the specified engine,
6324thus initialising it if needed. 6627thus initialising it if needed.
6325The engine will then be set as the default 6628The engine will then be set as the default
6326for all available algorithms. 6629for all available algorithms.
6327.It Cm [zero or more test algorithms]
6328If any options are given,
6329.Nm speed
6330tests those algorithms, otherwise all of the above are tested.
6331.El 6630.El
6332.\" 6631.\"
6333.\" SPKAC 6632.\" SPKAC
@@ -6349,7 +6648,8 @@ tests those algorithms, otherwise all of the above are tested.
6349The 6648The
6350.Nm spkac 6649.Nm spkac
6351command processes Netscape signed public key and challenge 6650command processes Netscape signed public key and challenge
6352(SPKAC) files. 6651.Pq SPKAC
6652files.
6353It can print out their contents, verify the signature and 6653It can print out their contents, verify the signature and
6354produce its own SPKACs from a supplied private key. 6654produce its own SPKACs from a supplied private key.
6355.Pp 6655.Pp
@@ -6377,7 +6677,7 @@ options are ignored if present.
6377.It Fl passin Ar password 6677.It Fl passin Ar password
6378The input file password source. 6678The input file password source.
6379For more information about the format of 6679For more information about the format of
6380.Ar arg 6680.Ar arg ,
6381see the 6681see the
6382.Sx PASS PHRASE ARGUMENTS 6682.Sx PASS PHRASE ARGUMENTS
6383section above. 6683section above.
@@ -6393,18 +6693,18 @@ Allows an alternative name for the
6393containing the SPKAC. 6693containing the SPKAC.
6394The default is the default section. 6694The default is the default section.
6395.It Fl noout 6695.It Fl noout
6396Don't output the text version of the SPKAC (not used if an 6696Don't output the text version of the SPKAC
6397SPKAC is being created). 6697.Pq not used if an SPKAC is being created .
6398.It Fl pubkey 6698.It Fl pubkey
6399Output the public key of an SPKAC (not used if an SPKAC is 6699Output the public key of an SPKAC
6400being created). 6700.Pq not used if an SPKAC is being created .
6401.It Fl verify 6701.It Fl verify
6402Verifies the digital signature on the supplied SPKAC. 6702Verifies the digital signature on the supplied SPKAC.
6403.It Fl engine Ar id 6703.It Fl engine Ar id
6404Specifying an engine (by it's unique 6704Specifying an engine (by it's unique
6405.Ar id 6705.Ar id
6406string) will cause 6706string) will cause
6407.Nm req 6707.Nm spkac
6408to attempt to obtain a functional reference to the specified engine, 6708to attempt to obtain a functional reference to the specified engine,
6409thus initialising it if needed. 6709thus initialising it if needed.
6410The engine will then be set as the default for all available algorithms. 6710The engine will then be set as the default for all available algorithms.
@@ -6412,23 +6712,25 @@ The engine will then be set as the default for all available algorithms.
6412.Sh SPKAC EXAMPLES 6712.Sh SPKAC EXAMPLES
6413Print out the contents of an SPKAC: 6713Print out the contents of an SPKAC:
6414.Pp 6714.Pp
6415\& $ openssl spkac -in spkac.cnf 6715.Dl $ openssl spkac -in spkac.cnf
6416.Pp 6716.Pp
6417Verify the signature of an SPKAC: 6717Verify the signature of an SPKAC:
6418.Pp 6718.Pp
6419\& $ openssl spkac -in spkac.cnf -noout -verify 6719.Dl $ openssl spkac -in spkac.cnf -noout -verify
6420.Pp 6720.Pp
6421Create an SPKAC using the challenge string "hello": 6721Create an SPKAC using the challenge string
6722.Qq hello :
6422.Pp 6723.Pp
6423\& $ openssl spkac -key key.pem -challenge hello -out spkac.cnf 6724.Dl $ openssl spkac -key key.pem -challenge hello -out spkac.cnf
6424.Pp 6725.Pp
6425Example of an SPKAC, (long lines split up for clarity): 6726Example of an SPKAC,
6426.Bd -literal 6727.Pq long lines split up for clarity :
6427\& SPKAC=MIG5MGUwXDANBgkqhkiG9w0BAQEFAANLADBIAkEA1cCoq2Wa3Ixs47uI7F\e 6728.Bd -unfilled -offset indent
6428\& PVwHVIPDx5yso105Y6zpozam135a8R0CpoRvkkigIyXfcCjiVi5oWk+6FfPaD03u\e 6729SPKAC=MIG5MGUwXDANBgkqhkiG9w0BAQEFAANLADBIAkEA1cCoq2Wa3Ixs47uI7F\e
6429\& PFoQIDAQABFgVoZWxsbzANBgkqhkiG9w0BAQQFAANBAFpQtY/FojdwkJh1bEIYuc\e 6730PVwHVIPDx5yso105Y6zpozam135a8R0CpoRvkkigIyXfcCjiVi5oWk+6FfPaD03u\e
6430\& 2EeM2KHTWPEepWYeawvHD0gQ3DngSC75YCWnnDdq+NQ3F+X4deMx9AaEglZtULwV\e 6731PFoQIDAQABFgVoZWxsbzANBgkqhkiG9w0BAQQFAANBAFpQtY/FojdwkJh1bEIYuc\e
6431\& 4= 67322EeM2KHTWPEepWYeawvHD0gQ3DngSC75YCWnnDdq+NQ3F+X4deMx9AaEglZtULwV\e
67334=
6432.Ed 6734.Ed
6433.Sh SPKAC NOTES 6735.Sh SPKAC NOTES
6434A created SPKAC with suitable DN components appended can be fed into 6736A created SPKAC with suitable DN components appended can be fed into
@@ -6448,7 +6750,8 @@ string, some guarantee is given that the user knows the private key
6448corresponding to the public key being certified. 6750corresponding to the public key being certified.
6449This is important in some applications. 6751This is important in some applications.
6450Without this it is possible for a previous SPKAC 6752Without this it is possible for a previous SPKAC
6451to be used in a "replay attack". 6753to be used in a
6754.Qq replay attack .
6452.\" 6755.\"
6453.\" VERIFY 6756.\" VERIFY
6454.\" 6757.\"
@@ -6461,6 +6764,8 @@ to be used in a "replay attack".
6461.Op Fl help 6764.Op Fl help
6462.Op Fl issuer_checks 6765.Op Fl issuer_checks
6463.Op Fl verbose 6766.Op Fl verbose
6767.Op Fl crl_check
6768.Op Fl engine Ar id
6464.Op Fl 6769.Op Fl
6465.Op Ar certificates 6770.Op Ar certificates
6466.Pp 6771.Pp
@@ -6476,13 +6781,15 @@ A
6476of trusted certificates. 6781of trusted certificates.
6477The certificates should have names of the form 6782The certificates should have names of the form
6478.Em hash.0 , 6783.Em hash.0 ,
6479or have symbolic links to them of this form. 6784or have symbolic links to them of this form
6480("hash" is the hashed certificate subject name: see the 6785("hash" is the hashed certificate subject name: see the
6481.Fl hash 6786.Fl hash
6482option of the 6787option of the
6483.Nm x509 6788.Nm x509
6484utility). 6789utility).
6485Under Unix the 6790Under
6791.Ux ,
6792the
6486.Nm c_rehash 6793.Nm c_rehash
6487script will automatically create symbolic links to a directory of certificates. 6794script will automatically create symbolic links to a directory of certificates.
6488.It Fl CAfile Ar file 6795.It Fl CAfile Ar file
@@ -6523,16 +6830,26 @@ This shows why each candidate issuer certificate was rejected.
6523However the presence of rejection messages 6830However the presence of rejection messages
6524does not itself imply that anything is wrong: during the normal 6831does not itself imply that anything is wrong: during the normal
6525verify process several rejections may take place. 6832verify process several rejections may take place.
6833.It Fl crl_check
6834Check revocation status of signer's certificate using CRLs.
6835.It Fl engine Ar id
6836Specifying an engine (by it's unique
6837.Ar id
6838string) will cause
6839.Nm verify
6840to attempt to obtain a functional reference to the specified engine,
6841thus initialising it if needed.
6842The engine will then be set as the default for all available algorithms.
6526.It Fl 6843.It Fl
6527Marks the last option. 6844Marks the last option.
6528All arguments following this are assumed to be certificate files. 6845All arguments following this are assumed to be certificate files.
6529This is useful if the first certificate filename begins with a 6846This is useful if the first certificate filename begins with a
6530.Cm \&- . 6847.Sq - .
6531.It Ar certificates 6848.It Ar certificates
6532One or more 6849One or more
6533.Ar certificates 6850.Ar certificates
6534to verify. 6851to verify.
6535If no certificate filenames are included then an attempt is made to read 6852If no certificate filenames are included, then an attempt is made to read
6536a certificate from standard input. 6853a certificate from standard input.
6537They should all be in 6854They should all be in
6538.Em PEM 6855.Em PEM
@@ -6559,11 +6876,12 @@ and ending in the root CA.
6559It is an error if the whole chain cannot be built up. 6876It is an error if the whole chain cannot be built up.
6560The chain is built up by looking up the issuers certificate of the current 6877The chain is built up by looking up the issuers certificate of the current
6561certificate. 6878certificate.
6562If a certificate is found which is its own issuer it is assumed 6879If a certificate is found which is its own issuer, it is assumed
6563to be the root CA. 6880to be the root CA.
6564.Pp 6881.Pp
6565The process of 'looking up the issuers certificate' itself involves a number 6882The process of
6566of steps. 6883.Qq looking up the issuers certificate
6884itself involves a number of steps.
6567In versions of 6885In versions of
6568.Nm OpenSSL 6886.Nm OpenSSL
6569before 0.9.5a the first certificate whose subject name matched the issuer 6887before 0.9.5a the first certificate whose subject name matched the issuer
@@ -6573,10 +6891,14 @@ In
65730.9.6 and later all certificates whose subject name matches the issuer name 68910.9.6 and later all certificates whose subject name matches the issuer name
6574of the current certificate are subject to further tests. 6892of the current certificate are subject to further tests.
6575The relevant authority key identifier components of the current certificate 6893The relevant authority key identifier components of the current certificate
6576(if present) must match the subject key identifier (if present) 6894.Pq if present
6895must match the subject key identifier
6896.Pq if present
6577and issuer and serial number of the candidate issuer; in addition the 6897and issuer and serial number of the candidate issuer; in addition the
6578.Em keyUsage 6898.Em keyUsage
6579extension of the candidate issuer (if present) must permit certificate signing. 6899extension of the candidate issuer
6900.Pq if present
6901must permit certificate signing.
6580.Pp 6902.Pp
6581The lookup first looks in the list of untrusted certificates and if no match 6903The lookup first looks in the list of untrusted certificates and if no match
6582is found the remaining lookups are from the trusted certificates. 6904is found the remaining lookups are from the trusted certificates.
@@ -6589,9 +6911,10 @@ consistency with the supplied purpose.
6589If the 6911If the
6590.Fl purpose 6912.Fl purpose
6591option is not included, then no checks are done. 6913option is not included, then no checks are done.
6592The supplied or "leaf" certificate must have extensions compatible with the 6914The supplied or
6593supplied purpose and all other certificates must also be valid 6915.Qq leaf
6594CA certificates. 6916certificate must have extensions compatible with the supplied purpose
6917and all other certificates must also be valid CA certificates.
6595The precise extensions required are described in more detail in 6918The precise extensions required are described in more detail in
6596the 6919the
6597.Sx X509 CERTIFICATE EXTENSIONS 6920.Sx X509 CERTIFICATE EXTENSIONS
@@ -6620,15 +6943,15 @@ If any operation fails then the certificate is not valid.
6620.Sh VERIFY DIAGNOSTICS 6943.Sh VERIFY DIAGNOSTICS
6621When a verify operation fails, the output messages can be somewhat cryptic. 6944When a verify operation fails, the output messages can be somewhat cryptic.
6622The general form of the error message is: 6945The general form of the error message is:
6623.Bd -literal 6946.Bd -unfilled
6624\& server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) 6947\& server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024-bit)
6625\& error 24 at 1 depth lookup:invalid CA certificate 6948\& error 24 at 1 depth lookup:invalid CA certificate
6626.Ed 6949.Ed
6627.Pp 6950.Pp
6628The first line contains the name of the certificate being verified followed by 6951The first line contains the name of the certificate being verified, followed by
6629the subject name of the certificate. 6952the subject name of the certificate.
6630The second line contains the error number and the depth. 6953The second line contains the error number and the depth.
6631The depth is number of the certificate being verified when a 6954The depth is the number of the certificate being verified when a
6632problem was detected starting with zero for the certificate being verified 6955problem was detected starting with zero for the certificate being verified
6633itself, then 1 for the CA that signed the certificate and so on. 6956itself, then 1 for the CA that signed the certificate and so on.
6634Finally a text version of the error number is presented. 6957Finally a text version of the error number is presented.
@@ -6637,7 +6960,8 @@ An exhaustive list of the error codes and messages is shown below; this also
6637includes the name of the error code as defined in the header file 6960includes the name of the error code as defined in the header file
6638.Aq Pa x509_vfy.h . 6961.Aq Pa x509_vfy.h .
6639Some of the error codes are defined but never returned: these are described 6962Some of the error codes are defined but never returned: these are described
6640as "unused". 6963as
6964.Qq unused .
6641.Bl -tag -width "XXXX" 6965.Bl -tag -width "XXXX"
6642.It Ar "0 X509_V_OK: ok" 6966.It Ar "0 X509_V_OK: ok"
6643The operation was successful. 6967The operation was successful.
@@ -6782,12 +7106,7 @@ mishandled them.
6782.\" 7106.\"
6783.Sh VERSION 7107.Sh VERSION
6784.Nm openssl version 7108.Nm openssl version
6785.Op Fl a 7109.Op Fl abdfopv
6786.Op Fl v
6787.Op Fl b
6788.Op Fl o
6789.Op Fl f
6790.Op Fl p
6791.Pp 7110.Pp
6792The 7111The
6793.Nm version 7112.Nm version
@@ -6798,23 +7117,23 @@ The options are as follows:
6798.Bl -tag -width "XXXX" 7117.Bl -tag -width "XXXX"
6799.It Fl a 7118.It Fl a
6800All information: this is the same as setting all the other flags. 7119All information: this is the same as setting all the other flags.
6801.It Fl v
6802The current
6803.Nm OpenSSL
6804version.
6805.It Fl b 7120.It Fl b
6806The date the current version of 7121The date the current version of
6807.Nm OpenSSL 7122.Nm OpenSSL
6808was built. 7123was built.
7124.It Fl d
7125.Ev OPENSSLDIR
7126setting.
7127.It Fl f
7128Compilation flags.
6809.It Fl o 7129.It Fl o
6810Option information: various options set when the library was built. 7130Option information: various options set when the library was built.
6811.It Fl c
6812Compilation flags.
6813.It Fl p 7131.It Fl p
6814Platform setting. 7132Platform setting.
6815.It Fl d 7133.It Fl v
6816.Em OPENSSLDIR 7134The current
6817setting. 7135.Nm OpenSSL
7136version.
6818.El 7137.El
6819.Sh VERSION NOTES 7138.Sh VERSION NOTES
6820The output of 7139The output of
@@ -6832,13 +7151,14 @@ option was added in
6832.Sh X509 7151.Sh X509
6833.Nm openssl x509 7152.Nm openssl x509
6834.Bk -words 7153.Bk -words
6835.Op Fl inform Ar DER|PEM|NET 7154.Op Fl inform Ar DER | PEM | NET
6836.Op Fl outform Ar DER|PEM|NET 7155.Op Fl outform Ar DER | PEM | NET
6837.Op Fl keyform Ar DER|PEM 7156.Op Fl keyform Ar DER | PEM
6838.Op Fl CAform Ar DER|PEM 7157.Op Fl CAform Ar DER | PEM
6839.Op Fl CAkeyform Ar DER|PEM 7158.Op Fl CAkeyform Ar DER | PEM
6840.Op Fl in Ar filename 7159.Op Fl in Ar filename
6841.Op Fl out Ar filename 7160.Op Fl out Ar filename
7161.Op Fl passin Ar arg
6842.Op Fl serial 7162.Op Fl serial
6843.Op Fl hash 7163.Op Fl hash
6844.Op Fl subject 7164.Op Fl subject
@@ -6850,9 +7170,11 @@ option was added in
6850.Op Fl purpose 7170.Op Fl purpose
6851.Op Fl dates 7171.Op Fl dates
6852.Op Fl modulus 7172.Op Fl modulus
7173.Op Fl pubkey
6853.Op Fl fingerprint 7174.Op Fl fingerprint
6854.Op Fl alias 7175.Op Fl alias
6855.Op Fl noout 7176.Op Fl noout
7177.Op Fl ocspid
6856.Op Fl trustout 7178.Op Fl trustout
6857.Op Fl clrtrust 7179.Op Fl clrtrust
6858.Op Fl clrreject 7180.Op Fl clrreject
@@ -6860,6 +7182,7 @@ option was added in
6860.Op Fl addreject Ar arg 7182.Op Fl addreject Ar arg
6861.Op Fl setalias Ar arg 7183.Op Fl setalias Ar arg
6862.Op Fl days Ar arg 7184.Op Fl days Ar arg
7185.Op Fl checkend Ar arg
6863.Op Fl set_serial Ar n 7186.Op Fl set_serial Ar n
6864.Op Fl signkey Ar filename 7187.Op Fl signkey Ar filename
6865.Op Fl x509toreq 7188.Op Fl x509toreq
@@ -6870,7 +7193,7 @@ option was added in
6870.Op Fl CAserial Ar filename 7193.Op Fl CAserial Ar filename
6871.Op Fl text 7194.Op Fl text
6872.Op Fl C 7195.Op Fl C
6873.Op Cm -md2|-md5|-sha1|-mdc2 7196.Op Fl md2 | md5 | sha1
6874.Op Fl clrext 7197.Op Fl clrext
6875.Op Fl extfile Ar filename 7198.Op Fl extfile Ar filename
6876.Op Fl extensions Ar section 7199.Op Fl extensions Ar section
@@ -6881,16 +7204,17 @@ The
6881.Nm x509 7204.Nm x509
6882command is a multi-purpose certificate utility. 7205command is a multi-purpose certificate utility.
6883It can be used to display certificate information, convert certificates to 7206It can be used to display certificate information, convert certificates to
6884various forms, sign certificate requests like a "mini CA" or edit 7207various forms, sign certificate requests like a
6885certificate trust settings. 7208.Qq mini CA ,
7209or edit certificate trust settings.
6886.Pp 7210.Pp
6887Since there are a large number of options, they are split up into 7211Since there are a large number of options, they are split up into
6888various sections. 7212various sections.
6889.Sh X509 INPUT, OUTPUT AND GENERAL PURPOSE OPTIONS 7213.Sh X509 INPUT, OUTPUT, AND GENERAL PURPOSE OPTIONS
6890.Bl -tag -width "XXXX" 7214.Bl -tag -width "XXXX"
6891.It Fl inform Ar DER|PEM|NET 7215.It Fl inform Ar DER | PEM | NET
6892This specifies the input format. 7216This specifies the input format.
6893Normally the command will expect an X509 certificate, 7217Normally, the command will expect an X509 certificate,
6894but this can change if other options such as 7218but this can change if other options such as
6895.Fl req 7219.Fl req
6896are present. 7220are present.
@@ -6903,9 +7227,8 @@ The
6903.Ar NET 7227.Ar NET
6904option is an obscure Netscape server format that is now 7228option is an obscure Netscape server format that is now
6905obsolete. 7229obsolete.
6906.It Fl outform Ar DER|PEM|NET 7230.It Fl outform Ar DER | PEM | NET
6907This specifies the output format; 7231This specifies the output format; the options have the same meaning as the
6908the options have the same meaning as the
6909.Fl inform 7232.Fl inform
6910option. 7233option.
6911.It Fl in Ar filename 7234.It Fl in Ar filename
@@ -6916,22 +7239,29 @@ to read a certificate from or standard input if this option is not specified.
6916This specifies the output 7239This specifies the output
6917.Ar filename 7240.Ar filename
6918to write to or standard output by default. 7241to write to or standard output by default.
6919.It Fl md2|-md5|-sha1|-mdc2 7242.It Fl passin Ar arg
7243The key password source.
7244For more information about the format of
7245.Ar arg ,
7246see the
7247.Sx PASS PHRASE ARGUMENTS
7248section above.
7249.It Fl md2 | md5 | sha1
6920The digest to use. 7250The digest to use.
6921This affects any signing or display option that uses a message digest, 7251This affects any signing or display option that uses a message digest,
6922such as the 7252such as the
6923.Fl fingerprint , signkey 7253.Fl fingerprint , signkey ,
6924and 7254and
6925.Fl CA 7255.Fl CA
6926options. 7256options.
6927If not specified then MD5 is used. 7257If not specified, then MD5 is used.
6928If the key being used to sign with is a DSA key then 7258If the key being used to sign with is a DSA key, then
6929this option has no effect: SHA1 is always used with DSA keys. 7259this option has no effect: SHA1 is always used with DSA keys.
6930.It Fl engine Ar id 7260.It Fl engine Ar id
6931Specifying an engine (by it's unique 7261Specifying an engine (by it's unique
6932.Ar id 7262.Ar id
6933string) will cause 7263string) will cause
6934.Nm req 7264.Nm x509
6935to attempt to obtain a functional reference to the specified engine, 7265to attempt to obtain a functional reference to the specified engine,
6936thus initialising it if needed. 7266thus initialising it if needed.
6937The engine will then be set as the default for all available algorithms. 7267The engine will then be set as the default for all available algorithms.
@@ -6959,19 +7289,25 @@ The
6959argument can be a single option or multiple options separated by commas. 7289argument can be a single option or multiple options separated by commas.
6960The 7290The
6961.Fl certopt 7291.Fl certopt
6962switch may be also be used more than once to set multiple options. 7292switch may also be used more than once to set multiple options.
6963See the 7293See the
6964.Sx X509 TEXT OPTIONS 7294.Sx X509 TEXT OPTIONS
6965section for more information. 7295section for more information.
6966.It Fl noout 7296.It Fl noout
6967This option prevents output of the encoded version of the request. 7297This option prevents output of the encoded version of the request.
7298.It Fl ocspid
7299Print OCSP hash values for the subject name and public key.
6968.It Fl modulus 7300.It Fl modulus
6969This option prints out the value of the modulus of the public key 7301This option prints out the value of the modulus of the public key
6970contained in the certificate. 7302contained in the certificate.
7303.It Fl pubkey
7304Ouput the public key.
6971.It Fl serial 7305.It Fl serial
6972Outputs the certificate serial number. 7306Outputs the certificate serial number.
6973.It Fl hash 7307.It Fl hash
6974Outputs the "hash" of the certificate subject name. 7308Outputs the
7309.Qq hash
7310of the certificate subject name.
6975This is used in 7311This is used in
6976.Nm OpenSSL 7312.Nm OpenSSL
6977to form an index to allow certificates in a directory to be looked up 7313to form an index to allow certificates in a directory to be looked up
@@ -7017,11 +7353,13 @@ A
7017.Em trusted certificate 7353.Em trusted certificate
7018is an ordinary certificate which has several 7354is an ordinary certificate which has several
7019additional pieces of information attached to it such as the permitted 7355additional pieces of information attached to it such as the permitted
7020and prohibited uses of the certificate and an "alias". 7356and prohibited uses of the certificate and an
7357.Qq alias .
7021.Pp 7358.Pp
7022Normally when a certificate is being verified at least one certificate 7359Normally, when a certificate is being verified at least one certificate
7023must be "trusted". 7360must be
7024By default a trusted certificate must be stored 7361.Qq trusted .
7362By default, a trusted certificate must be stored
7025locally and must be a root CA: any certificate chain ending in this CA 7363locally and must be a root CA: any certificate chain ending in this CA
7026is then usable for any purpose. 7364is then usable for any purpose.
7027.Pp 7365.Pp
@@ -7053,7 +7391,8 @@ are modified.
7053.It Fl setalias Ar arg 7391.It Fl setalias Ar arg
7054Sets the alias of the certificate. 7392Sets the alias of the certificate.
7055This will allow the certificate to be referred to using a nickname, 7393This will allow the certificate to be referred to using a nickname,
7056for example "Steve's Certificate". 7394for example
7395.Qq Steve's Certificate .
7057.It Fl alias 7396.It Fl alias
7058Outputs the certificate alias, if any. 7397Outputs the certificate alias, if any.
7059.It Fl clrtrust 7398.It Fl clrtrust
@@ -7064,18 +7403,12 @@ Clears all the prohibited or rejected uses of the certificate.
7064Adds a trusted certificate use. 7403Adds a trusted certificate use.
7065Any object name can be used here, but currently only 7404Any object name can be used here, but currently only
7066.Ar clientAuth 7405.Ar clientAuth
7067.Po Em SSL 7406.Pq SSL client use ,
7068 client use
7069.Pc ,
7070.Ar serverAuth 7407.Ar serverAuth
7071.Po Em SSL 7408.Pq SSL server use ,
7072 server use
7073.Pc
7074and 7409and
7075.Ar emailProtection 7410.Ar emailProtection
7076.Po Em S/MIME 7411.Pq S/MIME email
7077 email
7078.Pc
7079are used. 7412are used.
7080Other 7413Other
7081.Nm OpenSSL 7414.Nm OpenSSL
@@ -7088,7 +7421,7 @@ option.
7088.It Fl purpose 7421.It Fl purpose
7089This option performs tests on the certificate extensions and outputs 7422This option performs tests on the certificate extensions and outputs
7090the results. 7423the results.
7091For a more complete description see the 7424For a more complete description, see the
7092.Sx X509 CERTIFICATE EXTENSIONS 7425.Sx X509 CERTIFICATE EXTENSIONS
7093section. 7426section.
7094.El 7427.El
@@ -7096,15 +7429,18 @@ section.
7096The 7429The
7097.Nm x509 7430.Nm x509
7098utility can be used to sign certificates and requests: it 7431utility can be used to sign certificates and requests: it
7099can thus behave like a "mini CA". 7432can thus behave like a
7433.Qq mini CA .
7100.Bl -tag -width "XXXX" 7434.Bl -tag -width "XXXX"
7101.It Fl signkey Ar filename 7435.It Fl signkey Ar filename
7102This option causes the input file to be self-signed using the supplied 7436This option causes the input file to be self-signed using the supplied
7103private key. 7437private key.
7104.Pp 7438.Pp
7105If the input file is a certificate, it sets the issuer name to the 7439If the input file is a certificate, it sets the issuer name to the
7106subject name (i.e. makes it self-signed), changes the public key to the 7440subject name
7107supplied value and changes the start and end dates. 7441.Pq i.e. makes it self-signed ,
7442changes the public key to the supplied value
7443and changes the start and end dates.
7108The start date is set to the current time and the end date is set to 7444The start date is set to the current time and the end date is set to
7109a value determined by the 7445a value determined by the
7110.Fl days 7446.Fl days
@@ -7124,26 +7460,29 @@ certificate (for example with the
7124or the 7460or the
7125.Fl CA 7461.Fl CA
7126options). 7462options).
7127Normally all extensions are retained. 7463Normally, all extensions are retained.
7128.It Fl keyform Ar PEM|DER 7464.It Fl keyform Ar DER | PEM
7129Specifies the format 7465Specifies the format
7130.Po Em DER 7466.Pq DER or PEM
7131 or
7132.Em PEM
7133.Pc
7134of the private key file used in the 7467of the private key file used in the
7135.Fl signkey 7468.Fl signkey
7136option. 7469option.
7137.It Fl days Ar arg 7470.It Fl days Ar arg
7138Specifies the number of days to make a certificate valid for. 7471Specifies the number of days to make a certificate valid for.
7139The default is 30 days. 7472The default is 30 days.
7473.It Fl checkend Ar arg
7474Check whether the certificate expires in the next
7475.Ar arg
7476seconds.
7477If so, exit with return value 1;
7478otherwise exit with return value 0.
7140.It Fl x509toreq 7479.It Fl x509toreq
7141Converts a certificate into a certificate request. 7480Converts a certificate into a certificate request.
7142The 7481The
7143.Fl signkey 7482.Fl signkey
7144option is used to pass the required private key. 7483option is used to pass the required private key.
7145.It Fl req 7484.It Fl req
7146By default a certificate is expected on input. 7485By default, a certificate is expected on input.
7147With this option a certificate request is expected instead. 7486With this option a certificate request is expected instead.
7148.It Fl set_serial Ar n 7487.It Fl set_serial Ar n
7149Specifies the serial number to use. 7488Specifies the serial number to use.
@@ -7161,16 +7500,17 @@ or
7161options) is not used. 7500options) is not used.
7162.Pp 7501.Pp
7163The serial number can be decimal or hex (if preceded by 7502The serial number can be decimal or hex (if preceded by
7164.Em 0x ) . 7503.Sq 0x ) .
7165Negative serial numbers can also be specified but their use is not recommended. 7504Negative serial numbers can also be specified but their use is not recommended.
7166.It Fl CA Ar filename 7505.It Fl CA Ar filename
7167Specifies the CA certificate to be used for signing. 7506Specifies the CA certificate to be used for signing.
7168When this option is present 7507When this option is present,
7169.Nm x509 7508.Nm x509
7170behaves like a "mini CA". 7509behaves like a
7510.Qq mini CA .
7171The input file is signed by the CA using this option; 7511The input file is signed by the CA using this option;
7172that is, its issuer name is set to the subject name of the CA and it is 7512that is, its issuer name is set to the subject name of the CA and it is
7173digitally signed using the CAs private key. 7513digitally signed using the CA's private key.
7174.Pp 7514.Pp
7175This option is normally combined with the 7515This option is normally combined with the
7176.Fl req 7516.Fl req
@@ -7180,7 +7520,7 @@ Without the
7180option, the input is a certificate which must be self-signed. 7520option, the input is a certificate which must be self-signed.
7181.It Fl CAkey Ar filename 7521.It Fl CAkey Ar filename
7182Sets the CA private key to sign a certificate with. 7522Sets the CA private key to sign a certificate with.
7183If this option is not specified then it is assumed that the CA private key 7523If this option is not specified, then it is assumed that the CA private key
7184is present in the CA certificate file. 7524is present in the CA certificate file.
7185.It Fl CAserial Ar filename 7525.It Fl CAserial Ar filename
7186Sets the CA serial number file to use. 7526Sets the CA serial number file to use.
@@ -7197,25 +7537,31 @@ to the file again.
7197The default filename consists of the CA certificate file base name with 7537The default filename consists of the CA certificate file base name with
7198.Pa .srl 7538.Pa .srl
7199appended. 7539appended.
7200For example if the CA certificate file is called 7540For example, if the CA certificate file is called
7201.Pa mycacert.pem , 7541.Pa mycacert.pem ,
7202it expects to find a serial number file called 7542it expects to find a serial number file called
7203.Pa mycacert.srl . 7543.Pa mycacert.srl .
7204.It Fl CAcreateserial 7544.It Fl CAcreateserial
7205With this option the CA serial number file is created if it does not exist: 7545With this option the CA serial number file is created if it does not exist:
7206it will contain the serial number "02" and the certificate being signed will 7546it will contain the serial number
7207have 1 as its serial number. 7547.Sq 02
7208Normally if the 7548and the certificate being signed will have
7549.Sq 1
7550as its serial number.
7551Normally, if the
7209.Fl CA 7552.Fl CA
7210option is specified and the serial number file does not exist it is an error. 7553option is specified and the serial number file does not exist, it is an error.
7211.It Fl extfile Ar filename 7554.It Fl extfile Ar filename
7212File containing certificate extensions to use. 7555File containing certificate extensions to use.
7213If not specified, then no extensions are added to the certificate. 7556If not specified, then no extensions are added to the certificate.
7214.It Fl extensions Ar section 7557.It Fl extensions Ar section
7215The section to add certificate extensions from. 7558The section to add certificate extensions from.
7216If this option is not specified then the extensions should either be 7559If this option is not specified, then the extensions should either be
7217contained in the unnamed (default) section or the default section should 7560contained in the unnamed
7218contain a variable called "extensions" which contains the section to use. 7561.Pq default
7562section or the default section should contain a variable called
7563.Qq extensions
7564which contains the section to use.
7219.El 7565.El
7220.Sh X509 NAME OPTIONS 7566.Sh X509 NAME OPTIONS
7221The 7567The
@@ -7224,12 +7570,12 @@ command line switch determines how the subject and issuer
7224names are displayed. 7570names are displayed.
7225If no 7571If no
7226.Fl nameopt 7572.Fl nameopt
7227switch is present, the default "oneline" 7573switch is present, the default
7574.Qq oneline
7228format is used which is compatible with previous versions of 7575format is used which is compatible with previous versions of
7229.Nm OpenSSL . 7576.Nm OpenSSL .
7230Each option is described in detail below, all options can be preceded by 7577Each option is described in detail below; all options can be preceded by a
7231a 7578.Sq -
7232.Cm \&-
7233to turn the option off. 7579to turn the option off.
7234Only the first four will normally be used. 7580Only the first four will normally be used.
7235.Bl -tag -width "XXXX" 7581.Bl -tag -width "XXXX"
@@ -7258,37 +7604,44 @@ It is equivalent to
7258and 7604and
7259.Ar align . 7605.Ar align .
7260.It Ar esc_2253 7606.It Ar esc_2253
7261Escape the "special" characters required by RFC 2253 in a field that is 7607Escape the
7262.Cm \& ,+"<>; . 7608.Qq special
7609characters required by RFC 2253 in a field that is
7610.Dq \& ,+"<>; .
7263Additionally, 7611Additionally,
7264.Cm \&# 7612.Sq #
7265is escaped at the beginning of a string 7613is escaped at the beginning of a string
7266and a space character at the beginning or end of a string. 7614and a space character at the beginning or end of a string.
7267.It Ar esc_ctrl 7615.It Ar esc_ctrl
7268Escape control characters. 7616Escape control characters.
7269That is, those with ASCII values less than 7617That is, those with ASCII values less than 0x20
72700x20 (space) and the delete (0x7f) character. 7618.Pq space
7271They are escaped using the RFC2253 \eXX notation (where XX are two hex 7619and the delete
7620.Pq 0x7f
7621character.
7622They are escaped using the RFC 2253 \eXX notation (where XX are two hex
7272digits representing the character value). 7623digits representing the character value).
7273.It Ar esc_msb 7624.It Ar esc_msb
7274Escape characters with the MSB set; that is, with ASCII values larger than 7625Escape characters with the MSB set; that is, with ASCII values larger than
7275127. 7626127.
7276.It Ar use_quote 7627.It Ar use_quote
7277Escapes some characters by surrounding the whole string with 7628Escapes some characters by surrounding the whole string with
7278.Cm \&" 7629.Sq \&"
7279characters. 7630characters.
7280Without the option, all escaping is done with the 7631Without the option, all escaping is done with the
7281.Cm \&\e 7632.Sq \e
7282character. 7633character.
7283.It Ar utf8 7634.It Ar utf8
7284Convert all strings to UTF8 format first. 7635Convert all strings to UTF8 format first.
7285This is required by RFC 2253. 7636This is required by RFC 2253.
7286If you are lucky enough to have a UTF8 compatible terminal then the use 7637If you are lucky enough to have a UTF8 compatible terminal, then the use
7287of this option (and 7638of this option (and
7288.Em not 7639.Em not
7289setting 7640setting
7290.Ar esc_msb ) 7641.Ar esc_msb )
7291may result in the correct display of multibyte (international) characters. 7642may result in the correct display of multibyte
7643.Pq international
7644characters.
7292If this option is not present, then multibyte characters larger than 0xff 7645If this option is not present, then multibyte characters larger than 0xff
7293will be represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX 7646will be represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX
7294for 32 bits. 7647for 32 bits.
@@ -7304,15 +7657,17 @@ looking output.
7304.It Ar show_type 7657.It Ar show_type
7305Show the type of the ASN1 character string. 7658Show the type of the ASN1 character string.
7306The type precedes the field contents. 7659The type precedes the field contents.
7307For example "BMPSTRING: Hello World". 7660For example
7661.Qq BMPSTRING: Hello World .
7308.It Ar dump_der 7662.It Ar dump_der
7309When this option is set, any fields that need to be hexdumped will 7663When this option is set, any fields that need to be hexdumped will
7310be dumped using the DER encoding of the field. 7664be dumped using the DER encoding of the field.
7311Otherwise just the content octets will be displayed. 7665Otherwise just the content octets will be displayed.
7312Both options use the RFC2253 #XXXX... format. 7666Both options use the RFC 2253 #XXXX... format.
7313.It Ar dump_nostr 7667.It Ar dump_nostr
7314Dump non-character string types (for example OCTET STRING); if this 7668Dump non-character string types
7315option is not set then non-character string types will be displayed 7669.Pq for example OCTET STRING ;
7670if this option is not set, then non-character string types will be displayed
7316as though each content octet represents a single character. 7671as though each content octet represents a single character.
7317.It Ar dump_all 7672.It Ar dump_all
7318Dump all fields. 7673Dump all fields.
@@ -7326,12 +7681,13 @@ Dump any field whose OID is not recognised by
7326These options determine the field separators. 7681These options determine the field separators.
7327The first character is between RDNs and the second between multiple AVAs 7682The first character is between RDNs and the second between multiple AVAs
7328(multiple AVAs are very rare and their use is discouraged). 7683(multiple AVAs are very rare and their use is discouraged).
7329The options ending in "space" additionally place a space after the 7684The options ending in
7330separator to make it more readable. 7685.Qq space
7686additionally place a space after the separator to make it more readable.
7331The 7687The
7332.Ar sep_multiline 7688.Ar sep_multiline
7333uses a linefeed character for the RDN separator and a spaced 7689uses a linefeed character for the RDN separator and a spaced
7334.Cm \&+ 7690.Sq +
7335for the AVA separator. 7691for the AVA separator.
7336It also indents the fields by four characters. 7692It also indents the fields by four characters.
7337.It Ar dn_rev 7693.It Ar dn_rev
@@ -7344,7 +7700,9 @@ These options alter how the field name is displayed.
7344.Ar nofname 7700.Ar nofname
7345does not display the field at all. 7701does not display the field at all.
7346.Ar sname 7702.Ar sname
7347uses the "short name" form (CN for 7703uses the
7704.Qq short name
7705form (CN for
7348.Ar commonName , 7706.Ar commonName ,
7349for example). 7707for example).
7350.Ar lname 7708.Ar lname
@@ -7357,7 +7715,7 @@ Only usable with
7357.Ar sep_multiline . 7715.Ar sep_multiline .
7358.It Ar spc_eq 7716.It Ar spc_eq
7359Places spaces round the 7717Places spaces round the
7360.Cm \&= 7718.Sq =
7361character which follows the field name. 7719character which follows the field name.
7362.El 7720.El
7363.Sh X509 TEXT OPTIONS 7721.Sh X509 TEXT OPTIONS
@@ -7373,8 +7731,10 @@ The default behaviour is to print all fields.
7373Use the old format. 7731Use the old format.
7374This is equivalent to specifying no output options at all. 7732This is equivalent to specifying no output options at all.
7375.It Ar no_header 7733.It Ar no_header
7376Don't print header information: that is, the lines saying "Certificate" 7734Don't print header information: that is, the lines saying
7377and "Data". 7735.Qq Certificate
7736and
7737.Qq Data .
7378.It Ar no_version 7738.It Ar no_version
7379Don't print out the version number. 7739Don't print out the version number.
7380.It Ar no_serial 7740.It Ar no_serial
@@ -7419,37 +7779,40 @@ and
7419.El 7779.El
7420.Sh X509 EXAMPLES 7780.Sh X509 EXAMPLES
7421.Sy Note : 7781.Sy Note :
7422In these examples the '\e' means the example should be all on one 7782In these examples the
7423line. 7783.Sq \e
7784means the example should be all on one line.
7424.Pp 7785.Pp
7425Display the contents of a certificate: 7786Display the contents of a certificate:
7426.Pp 7787.Pp
7427\& $ openssl x509 -in cert.pem -noout -text 7788.Dl $ openssl x509 -in cert.pem -noout -text
7428.Pp 7789.Pp
7429Display the certificate serial number: 7790Display the certificate serial number:
7430.Pp 7791.Pp
7431\& $ openssl x509 -in cert.pem -noout -serial 7792.Dl $ openssl x509 -in cert.pem -noout -serial
7432.Pp 7793.Pp
7433Display the certificate subject name: 7794Display the certificate subject name:
7434.Pp 7795.Pp
7435\& $ openssl x509 -in cert.pem -noout -subject 7796.Dl $ openssl x509 -in cert.pem -noout -subject
7436.Pp 7797.Pp
7437Display the certificate subject name in RFC2253 form: 7798Display the certificate subject name in RFC 2253 form:
7438.Pp 7799.Pp
7439\& $ openssl x509 -in cert.pem -noout -subject -nameopt RFC2253 7800.Dl $ openssl x509 -in cert.pem -noout -subject -nameopt RFC2253
7440.Pp 7801.Pp
7441Display the certificate subject name in oneline form on a terminal 7802Display the certificate subject name in oneline form on a terminal
7442supporting UTF8: 7803supporting UTF8:
7443.Pp 7804.Bd -literal -offset indent
7444\& $ openssl x509 -in cert.pem -noout -subject -nameopt oneline,-escmsb 7805$ openssl x509 -in cert.pem -noout -subject \e
7806 -nameopt oneline,-escmsb
7807.Ed
7445.Pp 7808.Pp
7446Display the certificate MD5 fingerprint: 7809Display the certificate MD5 fingerprint:
7447.Pp 7810.Pp
7448\& $ openssl x509 -in cert.pem -noout -fingerprint 7811.Dl $ openssl x509 -in cert.pem -noout -fingerprint
7449.Pp 7812.Pp
7450Display the certificate SHA1 fingerprint: 7813Display the certificate SHA1 fingerprint:
7451.Pp 7814.Pp
7452\& $ openssl x509 -sha1 -in cert.pem -noout -fingerprint 7815.Dl $ openssl x509 -sha1 -in cert.pem -noout -fingerprint
7453.Pp 7816.Pp
7454Convert a certificate from 7817Convert a certificate from
7455.Em PEM 7818.Em PEM
@@ -7457,51 +7820,54 @@ to
7457.Em DER 7820.Em DER
7458format: 7821format:
7459.Pp 7822.Pp
7460\& $ openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER 7823.Dl "$ openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER"
7461.Pp 7824.Pp
7462Convert a certificate to a certificate request: 7825Convert a certificate to a certificate request:
7463.Pp 7826.Bd -literal -offset indent
7464\& $ openssl x509 -x509toreq -in cert.pem -out req.pem -signkey key.pem 7827$ openssl x509 -x509toreq -in cert.pem -out req.pem \e
7828 -signkey key.pem
7829.Ed
7465.Pp 7830.Pp
7466Convert a certificate request into a self-signed certificate using 7831Convert a certificate request into a self-signed certificate using
7467extensions for a CA: 7832extensions for a CA:
7468.Bd -literal 7833.Bd -literal -offset indent
7469\& $ openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions \e 7834$ openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions \e
7470\& v3_ca -signkey key.pem -out cacert.pem 7835 v3_ca -signkey key.pem -out cacert.pem
7471.Ed 7836.Ed
7472.Pp 7837.Pp
7473Sign a certificate request using the CA certificate above and add user 7838Sign a certificate request using the CA certificate above and add user
7474certificate extensions: 7839certificate extensions:
7475.Bd -literal 7840.Bd -literal -offset indent
7476\& $ openssl x509 -req -in req.pem -extfile openssl.cnf -extensions \e 7841$ openssl x509 -req -in req.pem -extfile openssl.cnf -extensions \e
7477 v3_usr -CA cacert.pem -CAkey key.pem -CAcreateserial 7842 v3_usr -CA cacert.pem -CAkey key.pem -CAcreateserial
7478.Ed 7843.Ed
7479.Pp 7844.Pp
7480Set a certificate to be trusted for SSL 7845Set a certificate to be trusted for SSL
7481client use and set its alias to "Steve's Class 1 CA": 7846client use and set its alias to
7482.Bd -literal 7847.Qq Steve's Class 1 CA :
7483\& $ openssl x509 -in cert.pem -addtrust clientAuth \e 7848.Bd -literal -offset indent
7484\& -setalias "Steve's Class 1 CA" -out trust.pem 7849$ openssl x509 -in cert.pem -addtrust clientAuth \e
7850 -setalias "Steve's Class 1 CA" -out trust.pem
7485.Ed 7851.Ed
7486.Sh X509 NOTES 7852.Sh X509 NOTES
7487The 7853The
7488.Em PEM 7854.Em PEM
7489format uses the header and footer lines: 7855format uses the header and footer lines:
7490.Bd -literal 7856.Bd -unfilled -offset indent
7491\& -----BEGIN CERTIFICATE----- 7857-----BEGIN CERTIFICATE-----
7492\& -----END CERTIFICATE----- 7858-----END CERTIFICATE-----
7493.Ed 7859.Ed
7494.Pp 7860.Pp
7495It will also handle files containing: 7861It will also handle files containing:
7496.Bd -literal 7862.Bd -unfilled -offset indent
7497\& -----BEGIN X509 CERTIFICATE----- 7863-----BEGIN X509 CERTIFICATE-----
7498\& -----END X509 CERTIFICATE----- 7864-----END X509 CERTIFICATE-----
7499.Ed 7865.Ed
7500.Pp 7866.Pp
7501Trusted certificates have the lines: 7867Trusted certificates have the lines:
7502.Bd -literal 7868.Bd -unfilled -offset indent
7503\& -----BEGIN TRUSTED CERTIFICATE----- 7869-----BEGIN TRUSTED CERTIFICATE-----
7504\& -----END TRUSTED CERTIFICATE----- 7870-----END TRUSTED CERTIFICATE-----
7505.Ed 7871.Ed
7506.Pp 7872.Pp
7507The conversion to UTF8 format used with the name options assumes that 7873The conversion to UTF8 format used with the name options assumes that
@@ -7513,7 +7879,8 @@ it is more likely to display the majority of certificates correctly.
7513The 7879The
7514.Fl fingerprint 7880.Fl fingerprint
7515option takes the digest of the DER encoded certificate. 7881option takes the digest of the DER encoded certificate.
7516This is commonly called a "fingerprint". 7882This is commonly called a
7883.Qq fingerprint .
7517Because of the nature of message digests, the fingerprint of a certificate 7884Because of the nature of message digests, the fingerprint of a certificate
7518is unique to that certificate and two certificates with the same fingerprint 7885is unique to that certificate and two certificates with the same fingerprint
7519can be considered to be the same. 7886can be considered to be the same.
@@ -7542,22 +7909,24 @@ The
7542.Em basicConstraints 7909.Em basicConstraints
7543extension CA flag is used to determine whether the 7910extension CA flag is used to determine whether the
7544certificate can be used as a CA. 7911certificate can be used as a CA.
7545If the CA flag is true then it is a CA, 7912If the CA flag is true, then it is a CA;
7546if the CA flag is false then it is not a CA. 7913if the CA flag is false, then it is not a CA.
7547.Em All 7914.Em All
7548CAs should have the CA flag set to true. 7915CAs should have the CA flag set to true.
7549.Pp 7916.Pp
7550If the 7917If the
7551.Em basicConstraints 7918.Em basicConstraints
7552extension is absent then the certificate is 7919extension is absent, then the certificate is
7553considered to be a "possible CA"; other extensions are checked according 7920considered to be a
7554to the intended use of the certificate. 7921.Qq possible CA ;
7922other extensions are checked according to the intended use of the certificate.
7555A warning is given in this case because the certificate should really not 7923A warning is given in this case because the certificate should really not
7556be regarded as a CA: however, 7924be regarded as a CA: however,
7557it is allowed to be a CA to work around some broken software. 7925it is allowed to be a CA to work around some broken software.
7558.Pp 7926.Pp
7559If the certificate is a V1 certificate (and thus has no extensions) and 7927If the certificate is a V1 certificate
7560it is self-signed, it is also assumed to be a CA but a warning is again 7928.Pq and thus has no extensions
7929and it is self-signed, it is also assumed to be a CA but a warning is again
7561given: this is to work around the problem of Verisign roots which are V1 7930given: this is to work around the problem of Verisign roots which are V1
7562self-signed certificates. 7931self-signed certificates.
7563.Pp 7932.Pp
@@ -7575,7 +7944,8 @@ extension is present.
7575.Pp 7944.Pp
7576The extended key usage extension places additional restrictions on the 7945The extended key usage extension places additional restrictions on the
7577certificate uses. 7946certificate uses.
7578If this extension is present (whether critical or not) 7947If this extension is present
7948.Pq whether critical or not ,
7579the key can only be used for the purposes specified. 7949the key can only be used for the purposes specified.
7580.Pp 7950.Pp
7581A complete description of each test is given below. 7951A complete description of each test is given below.
@@ -7589,7 +7959,8 @@ CA certificates.
7589.Bl -tag -width "XXXX" 7959.Bl -tag -width "XXXX"
7590.It Ar SSL Client 7960.It Ar SSL Client
7591The extended key usage extension must be absent or include the 7961The extended key usage extension must be absent or include the
7592"web client authentication" OID. 7962.Qq web client authentication
7963OID.
7593.Ar keyUsage 7964.Ar keyUsage
7594must be absent or it must have the 7965must be absent or it must have the
7595.Em digitalSignature 7966.Em digitalSignature
@@ -7598,14 +7969,16 @@ Netscape certificate type must be absent or it must have the SSL
7598client bit set. 7969client bit set.
7599.It Ar SSL Client CA 7970.It Ar SSL Client CA
7600The extended key usage extension must be absent or include the 7971The extended key usage extension must be absent or include the
7601"web client authentication" OID. 7972.Qq web client authentication
7973OID.
7602Netscape certificate type must be absent or it must have the SSL CA 7974Netscape certificate type must be absent or it must have the SSL CA
7603bit set: this is used as a work around if the 7975bit set: this is used as a work around if the
7604.Em basicConstraints 7976.Em basicConstraints
7605extension is absent. 7977extension is absent.
7606.It Ar SSL Server 7978.It Ar SSL Server
7607The extended key usage extension must be absent or include the 7979The extended key usage extension must be absent or include the
7608"web server authentication" and/or one of the SGC OIDs. 7980.Qq web server authentication
7981and/or one of the SGC OIDs.
7609.Em keyUsage 7982.Em keyUsage
7610must be absent or it must have the 7983must be absent or it must have the
7611.Em digitalSignature 7984.Em digitalSignature
@@ -7615,7 +7988,8 @@ set, or both bits set.
7615Netscape certificate type must be absent or have the SSL server bit set. 7988Netscape certificate type must be absent or have the SSL server bit set.
7616.It Ar SSL Server CA 7989.It Ar SSL Server CA
7617The extended key usage extension must be absent or include the 7990The extended key usage extension must be absent or include the
7618"web server authentication" and/or one of the SGC OIDs. 7991.Qq web server authentication
7992and/or one of the SGC OIDs.
7619Netscape certificate type must be absent or the SSL CA 7993Netscape certificate type must be absent or the SSL CA
7620bit must be set: this is used as a work around if the 7994bit must be set: this is used as a work around if the
7621.Em basicConstraints 7995.Em basicConstraints
@@ -7631,13 +8005,14 @@ digital signing.
7631Otherwise it is the same as a normal SSL server. 8005Otherwise it is the same as a normal SSL server.
7632.It Ar Common S/MIME Client Tests 8006.It Ar Common S/MIME Client Tests
7633The extended key usage extension must be absent or include the 8007The extended key usage extension must be absent or include the
7634"email protection" OID. 8008.Qq email protection
8009OID.
7635Netscape certificate type must be absent or should have the 8010Netscape certificate type must be absent or should have the
7636.Em S/MIME 8011.Em S/MIME
7637bit set. 8012bit set.
7638If the 8013If the
7639.Em S/MIME 8014.Em S/MIME
7640bit is not set in netscape certificate type, then the SSL 8015bit is not set in Netscape certificate type, then the SSL
7641client bit is tolerated as an alternative but a warning is shown: 8016client bit is tolerated as an alternative but a warning is shown:
7642this is because some Verisign certificates don't set the 8017this is because some Verisign certificates don't set the
7643.Em S/MIME 8018.Em S/MIME
@@ -7660,7 +8035,8 @@ bit must be set if the
7660extension is present. 8035extension is present.
7661.It Ar S/MIME CA 8036.It Ar S/MIME CA
7662The extended key usage extension must be absent or include the 8037The extended key usage extension must be absent or include the
7663"email protection" OID. 8038.Qq email protection
8039OID.
7664Netscape certificate type must be absent or must have the 8040Netscape certificate type must be absent or must have the
7665.Em S/MIME CA 8041.Em S/MIME CA
7666bit set: this is used as a work around if the 8042bit set: this is used as a work around if the