diff options
author | jmc <> | 2016-09-22 13:30:49 +0000 |
---|---|---|
committer | jmc <> | 2016-09-22 13:30:49 +0000 |
commit | be17cc7cacfb36c99f77da01fcf67e8e4232242c (patch) | |
tree | 4cf4dd06e94614be61c11c49a59b2d11bde6de59 /src | |
parent | 3d3ba707c5ca80bd90ebaa79e16157797d4e4b68 (diff) | |
download | openbsd-be17cc7cacfb36c99f77da01fcf67e8e4232242c.tar.gz openbsd-be17cc7cacfb36c99f77da01fcf67e8e4232242c.tar.bz2 openbsd-be17cc7cacfb36c99f77da01fcf67e8e4232242c.zip |
shorten x509;
Diffstat (limited to 'src')
-rw-r--r-- | src/usr.bin/openssl/openssl.1 | 1169 |
1 files changed, 414 insertions, 755 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1 index 6945eadfc1..2fa7a70b69 100644 --- a/src/usr.bin/openssl/openssl.1 +++ b/src/usr.bin/openssl/openssl.1 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: openssl.1,v 1.79 2016/09/20 16:45:38 jmc Exp $ | 1 | .\" $OpenBSD: openssl.1,v 1.80 2016/09/22 13:30:49 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 | .\" |
@@ -112,7 +112,7 @@ | |||
112 | .\" | 112 | .\" |
113 | .\" OPENSSL | 113 | .\" OPENSSL |
114 | .\" | 114 | .\" |
115 | .Dd $Mdocdate: September 20 2016 $ | 115 | .Dd $Mdocdate: September 22 2016 $ |
116 | .Dt OPENSSL 1 | 116 | .Dt OPENSSL 1 |
117 | .Os | 117 | .Os |
118 | .Sh NAME | 118 | .Sh NAME |
@@ -1956,12 +1956,6 @@ and prints out the certificates contained in it, | |||
1956 | or takes a file of certificates | 1956 | or takes a file of certificates |
1957 | and converts it into a Netscape certificate sequence. | 1957 | and converts it into a Netscape certificate sequence. |
1958 | .Pp | 1958 | .Pp |
1959 | The PEM-encoded form uses the same headers and footers as a certificate: | ||
1960 | .Bd -unfilled -offset indent | ||
1961 | -----BEGIN CERTIFICATE----- | ||
1962 | -----END CERTIFICATE----- | ||
1963 | .Ed | ||
1964 | .Pp | ||
1965 | The options are as follows: | 1959 | The options are as follows: |
1966 | .Bl -tag -width Ds | 1960 | .Bl -tag -width Ds |
1967 | .It Fl in Ar file | 1961 | .It Fl in Ar file |
@@ -2452,19 +2446,6 @@ The default encryption is only 56 bits; | |||
2452 | keys encrypted using PKCS#5 v2.0 algorithms and high iteration counts | 2446 | keys encrypted using PKCS#5 v2.0 algorithms and high iteration counts |
2453 | are more secure. | 2447 | are more secure. |
2454 | .Pp | 2448 | .Pp |
2455 | The encrypted form of a PEM-encoded PKCS#8 file uses the following | ||
2456 | headers and footers: | ||
2457 | .Bd -unfilled -offset indent | ||
2458 | -----BEGIN ENCRYPTED PRIVATE KEY----- | ||
2459 | -----END ENCRYPTED PRIVATE KEY----- | ||
2460 | .Ed | ||
2461 | .Pp | ||
2462 | The unencrypted form uses: | ||
2463 | .Bd -unfilled -offset indent | ||
2464 | -----BEGIN PRIVATE KEY----- | ||
2465 | -----END PRIVATE KEY----- | ||
2466 | .Ed | ||
2467 | .Pp | ||
2468 | The options are as follows: | 2449 | The options are as follows: |
2469 | .Bl -tag -width Ds | 2450 | .Bl -tag -width Ds |
2470 | .It Fl embed | 2451 | .It Fl embed |
@@ -5347,22 +5328,18 @@ The current | |||
5347 | .Nm openssl | 5328 | .Nm openssl |
5348 | version. | 5329 | version. |
5349 | .El | 5330 | .El |
5350 | .\" | ||
5351 | .\" X509 | ||
5352 | .\" | ||
5353 | .Sh X509 | 5331 | .Sh X509 |
5354 | .nr nS 1 | 5332 | .nr nS 1 |
5355 | .Nm "openssl x509" | 5333 | .Nm "openssl x509" |
5356 | .Bk -words | ||
5357 | .Op Fl C | 5334 | .Op Fl C |
5358 | .Op Fl addreject Ar arg | 5335 | .Op Fl addreject Ar arg |
5359 | .Op Fl addtrust Ar arg | 5336 | .Op Fl addtrust Ar arg |
5360 | .Op Fl alias | 5337 | .Op Fl alias |
5361 | .Op Fl CA Ar file | 5338 | .Op Fl CA Ar file |
5362 | .Op Fl CAcreateserial | 5339 | .Op Fl CAcreateserial |
5363 | .Op Fl CAform Ar DER | PEM | 5340 | .Op Fl CAform Cm der | pem |
5364 | .Op Fl CAkey Ar file | 5341 | .Op Fl CAkey Ar file |
5365 | .Op Fl CAkeyform Ar DER | PEM | 5342 | .Op Fl CAkeyform Cm der | pem |
5366 | .Op Fl CAserial Ar file | 5343 | .Op Fl CAserial Ar file |
5367 | .Op Fl certopt Ar option | 5344 | .Op Fl certopt Ar option |
5368 | .Op Fl checkend Ar arg | 5345 | .Op Fl checkend Ar arg |
@@ -5378,11 +5355,11 @@ version. | |||
5378 | .Op Fl fingerprint | 5355 | .Op Fl fingerprint |
5379 | .Op Fl hash | 5356 | .Op Fl hash |
5380 | .Op Fl in Ar file | 5357 | .Op Fl in Ar file |
5381 | .Op Fl inform Ar DER | NET | PEM | 5358 | .Op Fl inform Cm der | net | pem |
5382 | .Op Fl issuer | 5359 | .Op Fl issuer |
5383 | .Op Fl issuer_hash | 5360 | .Op Fl issuer_hash |
5384 | .Op Fl issuer_hash_old | 5361 | .Op Fl issuer_hash_old |
5385 | .Op Fl keyform Ar DER | PEM | 5362 | .Op Fl keyform Cm der | pem |
5386 | .Op Fl md5 | sha1 | 5363 | .Op Fl md5 | sha1 |
5387 | .Op Fl modulus | 5364 | .Op Fl modulus |
5388 | .Op Fl nameopt Ar option | 5365 | .Op Fl nameopt Ar option |
@@ -5390,7 +5367,7 @@ version. | |||
5390 | .Op Fl ocsp_uri | 5367 | .Op Fl ocsp_uri |
5391 | .Op Fl ocspid | 5368 | .Op Fl ocspid |
5392 | .Op Fl out Ar file | 5369 | .Op Fl out Ar file |
5393 | .Op Fl outform Ar DER | NET | PEM | 5370 | .Op Fl outform Cm der | net | pem |
5394 | .Op Fl passin Ar arg | 5371 | .Op Fl passin Ar arg |
5395 | .Op Fl pubkey | 5372 | .Op Fl pubkey |
5396 | .Op Fl purpose | 5373 | .Op Fl purpose |
@@ -5406,7 +5383,6 @@ version. | |||
5406 | .Op Fl text | 5383 | .Op Fl text |
5407 | .Op Fl trustout | 5384 | .Op Fl trustout |
5408 | .Op Fl x509toreq | 5385 | .Op Fl x509toreq |
5409 | .Ek | ||
5410 | .nr nS 0 | 5386 | .nr nS 0 |
5411 | .Pp | 5387 | .Pp |
5412 | The | 5388 | The |
@@ -5417,29 +5393,17 @@ various forms, sign certificate requests like a | |||
5417 | .Qq mini CA , | 5393 | .Qq mini CA , |
5418 | or edit certificate trust settings. | 5394 | or edit certificate trust settings. |
5419 | .Pp | 5395 | .Pp |
5420 | Since there are a large number of options, they are split up into | 5396 | The following are x509 input, output, and general purpose options: |
5421 | various sections. | ||
5422 | .Sh X509 INPUT, OUTPUT, AND GENERAL PURPOSE OPTIONS | ||
5423 | .Bl -tag -width "XXXX" | 5397 | .Bl -tag -width "XXXX" |
5424 | .It Fl in Ar file | 5398 | .It Fl in Ar file |
5425 | This specifies the input | 5399 | The input file to read from, |
5426 | .Ar file | 5400 | or standard input if not specified. |
5427 | to read a certificate from, or standard input if this option is not specified. | 5401 | .It Fl inform Cm der | net | pem |
5428 | .It Fl inform Ar DER | NET | PEM | 5402 | The input format. |
5429 | This specifies the input format. | ||
5430 | Normally, the command will expect an X.509 certificate, | 5403 | Normally, the command will expect an X.509 certificate, |
5431 | but this can change if other options such as | 5404 | but this can change if other options such as |
5432 | .Fl req | 5405 | .Fl req |
5433 | are present. | 5406 | are present. |
5434 | The | ||
5435 | .Ar DER | ||
5436 | format is the DER encoding of the certificate and | ||
5437 | .Ar PEM | ||
5438 | is the base64 encoding of the DER encoding with header and footer lines added. | ||
5439 | The | ||
5440 | .Ar NET | ||
5441 | option is an obscure Netscape server format that is now | ||
5442 | obsolete. | ||
5443 | .It Fl md5 | sha1 | 5407 | .It Fl md5 | sha1 |
5444 | The digest to use. | 5408 | The digest to use. |
5445 | This affects any signing or display option that uses a message digest, | 5409 | This affects any signing or display option that uses a message digest, |
@@ -5449,215 +5413,447 @@ and | |||
5449 | .Fl CA | 5413 | .Fl CA |
5450 | options. | 5414 | options. |
5451 | If not specified, MD5 is used. | 5415 | If not specified, MD5 is used. |
5452 | If the key being used to sign with is a DSA key, | 5416 | SHA1 is always used with DSA keys. |
5453 | this option has no effect: SHA1 is always used with DSA keys. | ||
5454 | .It Fl out Ar file | 5417 | .It Fl out Ar file |
5455 | This specifies the output | 5418 | The output file to write to, |
5456 | .Ar file | 5419 | or standard output if none is specified. |
5457 | to write to, or standard output by default. | 5420 | .It Fl outform Cm der | net | pem |
5458 | .It Fl outform Ar DER | NET | PEM | 5421 | The output format. |
5459 | This specifies the output format; the options have the same meaning as the | ||
5460 | .Fl inform | ||
5461 | option. | ||
5462 | .It Fl passin Ar arg | 5422 | .It Fl passin Ar arg |
5463 | The key password source. | 5423 | The key password source. |
5464 | .El | 5424 | .El |
5465 | .Sh X509 DISPLAY OPTIONS | 5425 | .Pp |
5466 | .Sy Note : | 5426 | The following are x509 display options: |
5467 | The | ||
5468 | .Fl alias | ||
5469 | and | ||
5470 | .Fl purpose | ||
5471 | options are also display options but are described in the | ||
5472 | .Sx X509 TRUST SETTINGS | ||
5473 | section. | ||
5474 | .Bl -tag -width "XXXX" | 5427 | .Bl -tag -width "XXXX" |
5475 | .It Fl C | 5428 | .It Fl C |
5476 | This outputs the certificate in the form of a C source file. | 5429 | Output the certificate in the form of a C source file. |
5477 | .It Fl certopt Ar option | 5430 | .It Fl certopt Ar option |
5478 | Customise the output format used with | 5431 | Customise the output format used with |
5479 | .Fl text . | 5432 | .Fl text , |
5480 | The | 5433 | either using a list of comma-separated options or by specifying |
5481 | .Ar option | ||
5482 | argument can be a single option or multiple options separated by commas. | ||
5483 | The | ||
5484 | .Fl certopt | 5434 | .Fl certopt |
5485 | switch may also be used more than once to set multiple options. | 5435 | multiple times. |
5486 | See the | 5436 | The default behaviour is to print all fields. |
5487 | .Sx X509 TEXT OPTIONS | 5437 | The options are as follows: |
5488 | section for more information. | 5438 | .Pp |
5439 | .Bl -tag -width "no_extensions" -offset indent -compact | ||
5440 | .It Cm ca_default | ||
5441 | Equivalent to | ||
5442 | .Cm no_issuer , no_pubkey , no_header , | ||
5443 | .Cm no_version , no_sigdump , | ||
5444 | and | ||
5445 | .Cm no_signame . | ||
5446 | .It Cm compatible | ||
5447 | Equivalent to no output options at all. | ||
5448 | .It Cm ext_default | ||
5449 | Print unsupported certificate extensions. | ||
5450 | .It Cm ext_dump | ||
5451 | Hex dump unsupported extensions. | ||
5452 | .It Cm ext_error | ||
5453 | Print an error message for unsupported certificate extensions. | ||
5454 | .It Cm ext_parse | ||
5455 | ASN1 parse unsupported extensions. | ||
5456 | .It Cm no_aux | ||
5457 | Do not print certificate trust information. | ||
5458 | .It Cm no_extensions | ||
5459 | Do not print X509V3 extensions. | ||
5460 | .It Cm no_header | ||
5461 | Do not print header (Certificate and Data) information. | ||
5462 | .It Cm no_issuer | ||
5463 | Do not print the issuer name. | ||
5464 | .It Cm no_pubkey | ||
5465 | Do not print the public key. | ||
5466 | .It Cm no_serial | ||
5467 | Do not print the serial number. | ||
5468 | .It Cm no_sigdump | ||
5469 | Do not give a hexadecimal dump of the certificate signature. | ||
5470 | .It Cm no_signame | ||
5471 | Do not print the signature algorithm used. | ||
5472 | .It Cm no_subject | ||
5473 | Do not print the subject name. | ||
5474 | .It Cm no_validity | ||
5475 | Do not print the | ||
5476 | .Cm notBefore | ||
5477 | and | ||
5478 | .Cm notAfter | ||
5479 | (validity) fields. | ||
5480 | .It Cm no_version | ||
5481 | Do not print the version number. | ||
5482 | .El | ||
5489 | .It Fl dates | 5483 | .It Fl dates |
5490 | Prints out the start and expiry dates of a certificate. | 5484 | Print the start and expiry date of a certificate. |
5491 | .It Fl email | 5485 | .It Fl email |
5492 | Outputs the email address(es), if any. | 5486 | Output the email addresses, if any. |
5493 | .It Fl enddate | 5487 | .It Fl enddate |
5494 | Prints out the expiry date of the certificate; that is, the | 5488 | Print the expiry date of the certificate; that is, the |
5495 | .Em notAfter | 5489 | .Cm notAfter |
5496 | date. | 5490 | date. |
5497 | .It Fl fingerprint | 5491 | .It Fl fingerprint |
5498 | Prints out the digest of the DER-encoded version of the whole certificate | 5492 | Print the digest of the DER-encoded version of the whole certificate. |
5499 | (see | ||
5500 | .Sx DIGEST OPTIONS ) . | ||
5501 | .It Fl hash | 5493 | .It Fl hash |
5502 | A synonym for | 5494 | A synonym for |
5503 | .Fl subject_hash , | 5495 | .Fl subject_hash . |
5504 | for backwards compatibility. | ||
5505 | .It Fl issuer | 5496 | .It Fl issuer |
5506 | Outputs the issuer name. | 5497 | Print the issuer name. |
5507 | .It Fl issuer_hash | 5498 | .It Fl issuer_hash |
5508 | Outputs the | 5499 | Print the hash of the certificate issuer name. |
5509 | .Qq hash | ||
5510 | of the certificate issuer name. | ||
5511 | .It Fl issuer_hash_old | 5500 | .It Fl issuer_hash_old |
5512 | Outputs the | 5501 | Print the hash of the certificate issuer name |
5513 | .Qq hash | 5502 | using the older algorithm as used by |
5514 | of the certificate issuer name using the older algorithm | 5503 | .Nm openssl |
5515 | as used by | ||
5516 | .Nm OpenSSL | ||
5517 | versions before 1.0.0. | 5504 | versions before 1.0.0. |
5518 | .It Fl modulus | 5505 | .It Fl modulus |
5519 | This option prints out the value of the modulus of the public key | 5506 | Print the value of the modulus of the public key contained in the certificate. |
5520 | contained in the certificate. | ||
5521 | .It Fl nameopt Ar option | 5507 | .It Fl nameopt Ar option |
5522 | Option which determines how the subject or issuer names are displayed. | 5508 | Customise how the subject or issuer names are displayed, |
5523 | The | 5509 | either using a list of comma-separated options or by specifying |
5524 | .Ar option | ||
5525 | argument can be a single option or multiple options separated by commas. | ||
5526 | Alternatively, the | ||
5527 | .Fl nameopt | 5510 | .Fl nameopt |
5528 | switch may be used more than once to set multiple options. | 5511 | multiple times. |
5529 | See the | 5512 | The default behaviour is to use the |
5530 | .Sx X509 NAME OPTIONS | 5513 | .Cm oneline |
5531 | section for more information. | 5514 | format. |
5515 | The options, | ||
5516 | which can be preceded by a dash to turn them off, | ||
5517 | are as follows: | ||
5518 | .Bl -tag -width "XXXX" | ||
5519 | .It Cm align | ||
5520 | Align field values for a more readable output. | ||
5521 | Only usable with | ||
5522 | .Ar sep_multiline . | ||
5523 | .It Cm compat | ||
5524 | Use the old format, | ||
5525 | equivalent to specifying no options at all. | ||
5526 | .It Cm dn_rev | ||
5527 | Reverse the fields of the DN, as required by RFC 2253. | ||
5528 | As a side effect, this also reverses the order of multiple AVAs. | ||
5529 | .It Cm dump_all | ||
5530 | Dump all fields. | ||
5531 | When used with | ||
5532 | .Ar dump_der , | ||
5533 | it allows the DER encoding of the structure to be unambiguously determined. | ||
5534 | .It Cm dump_der | ||
5535 | Any fields that need to be hexdumped are | ||
5536 | dumped using the DER encoding of the field. | ||
5537 | Otherwise just the content octets will be displayed. | ||
5538 | Both options use the RFC 2253 #XXXX... format. | ||
5539 | .It Cm dump_nostr | ||
5540 | Dump non-character string types | ||
5541 | (for example OCTET STRING); | ||
5542 | usually, non-character string types are displayed | ||
5543 | as though each content octet represents a single character. | ||
5544 | .It Cm dump_unknown | ||
5545 | Dump any field whose OID is not recognised by | ||
5546 | .Nm openssl . | ||
5547 | .It Cm esc_2253 | ||
5548 | Escape the | ||
5549 | .Qq special | ||
5550 | characters required by RFC 2253 in a field that is | ||
5551 | .Dq \& ,+"<>; . | ||
5552 | Additionally, | ||
5553 | .Sq # | ||
5554 | is escaped at the beginning of a string | ||
5555 | and a space character at the beginning or end of a string. | ||
5556 | .It Cm esc_ctrl | ||
5557 | Escape control characters. | ||
5558 | That is, those with ASCII values less than 0x20 (space) | ||
5559 | and the delete (0x7f) character. | ||
5560 | They are escaped using the RFC 2253 \eXX notation (where XX are two hex | ||
5561 | digits representing the character value). | ||
5562 | .It Cm esc_msb | ||
5563 | Escape characters with the MSB set; that is, with ASCII values larger than | ||
5564 | 127. | ||
5565 | .It Cm multiline | ||
5566 | A multiline format. | ||
5567 | Equivalent to | ||
5568 | .Cm esc_ctrl , esc_msb , sep_multiline , | ||
5569 | .Cm space_eq , lname , | ||
5570 | and | ||
5571 | .Cm align . | ||
5572 | .It Cm no_type | ||
5573 | Do not attempt to interpret multibyte characters. | ||
5574 | That is, content octets are merely dumped as though one octet | ||
5575 | represents each character. | ||
5576 | This is useful for diagnostic purposes | ||
5577 | but results in rather odd looking output. | ||
5578 | .It Cm nofname , sname , lname , oid | ||
5579 | Alter how the field name is displayed: | ||
5580 | .Cm nofname | ||
5581 | does not display the field at all; | ||
5582 | .Cm sname | ||
5583 | uses the short name form (CN for | ||
5584 | .Cm commonName , | ||
5585 | for example); | ||
5586 | .Cm lname | ||
5587 | uses the long form. | ||
5588 | .Cm oid | ||
5589 | represents the OID in numerical form and is useful for diagnostic purpose. | ||
5590 | .It Cm oneline | ||
5591 | A one line format which is more readable than | ||
5592 | .Cm RFC2253 . | ||
5593 | Equivalent to | ||
5594 | .Cm esc_2253 , esc_ctrl , esc_msb , utf8 , | ||
5595 | .Cm dump_nostr , dump_der , use_quote , sep_comma_plus_spc , | ||
5596 | .Cm space_eq , | ||
5597 | and | ||
5598 | .Cm sname . | ||
5599 | .It Cm RFC2253 | ||
5600 | Displays names compatible with RFC 2253. | ||
5601 | Equivalent to | ||
5602 | .Cm esc_2253 , esc_ctrl , | ||
5603 | .Cm esc_msb , utf8 , dump_nostr , dump_unknown , | ||
5604 | .Cm dump_der , sep_comma_plus , dn_rev , | ||
5605 | and | ||
5606 | .Cm sname . | ||
5607 | .It Cm sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline | ||
5608 | Determine the field separators: | ||
5609 | the first character is between RDNs and the second between multiple AVAs | ||
5610 | (multiple AVAs are very rare and their use is discouraged). | ||
5611 | The options ending in | ||
5612 | .Qq space | ||
5613 | additionally place a space after the separator to make it more readable. | ||
5614 | .Cm sep_multiline | ||
5615 | uses a linefeed character for the RDN separator and a spaced | ||
5616 | .Sq + | ||
5617 | for the AVA separator, | ||
5618 | as well as indenting the fields by four characters. | ||
5619 | .It Cm show_type | ||
5620 | Show the type of the ASN1 character string. | ||
5621 | The type precedes the field contents. | ||
5622 | For example | ||
5623 | .Qq BMPSTRING: Hello World . | ||
5624 | .It Cm space_eq | ||
5625 | Place spaces round the | ||
5626 | .Sq = | ||
5627 | character which follows the field name. | ||
5628 | .It Cm use_quote | ||
5629 | Escape some characters by surrounding the whole string with | ||
5630 | .Sq \&" | ||
5631 | characters. | ||
5632 | Without the option, all escaping is done with the | ||
5633 | .Sq \e | ||
5634 | character. | ||
5635 | .It Cm utf8 | ||
5636 | Convert all strings to UTF8 format first, as required by RFC 2253. | ||
5637 | On a UTF8 compatible terminal, | ||
5638 | the use of this option (and not setting | ||
5639 | .Cm esc_msb ) | ||
5640 | may result in the correct display of multibyte characters. | ||
5641 | Usually, multibyte characters larger than 0xff | ||
5642 | are represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX | ||
5643 | for 32 bits, | ||
5644 | and any UTF8Strings are converted to their character form first. | ||
5645 | .El | ||
5532 | .It Fl noout | 5646 | .It Fl noout |
5533 | This option prevents output of the encoded version of the request. | 5647 | Do not output the encoded version of the request. |
5534 | .It Fl ocsp_uri | 5648 | .It Fl ocsp_uri |
5535 | Outputs the OCSP responder addresses, if any. | 5649 | Print the OCSP responder addresses, if any. |
5536 | .It Fl ocspid | 5650 | .It Fl ocspid |
5537 | Print OCSP hash values for the subject name and public key. | 5651 | Print OCSP hash values for the subject name and public key. |
5538 | .It Fl pubkey | 5652 | .It Fl pubkey |
5539 | Output the public key. | 5653 | Print the public key. |
5540 | .It Fl serial | 5654 | .It Fl serial |
5541 | Outputs the certificate serial number. | 5655 | Print the certificate serial number. |
5542 | .It Fl startdate | 5656 | .It Fl startdate |
5543 | Prints out the start date of the certificate; that is, the | 5657 | Print the start date of the certificate; that is, the |
5544 | .Em notBefore | 5658 | .Cm notBefore |
5545 | date. | 5659 | date. |
5546 | .It Fl subject | 5660 | .It Fl subject |
5547 | Outputs the subject name. | 5661 | Print the subject name. |
5548 | .It Fl subject_hash | 5662 | .It Fl subject_hash |
5549 | Outputs the | 5663 | Print the hash of the certificate subject name. |
5550 | .Qq hash | ||
5551 | of the certificate subject name. | ||
5552 | This is used in | 5664 | This is used in |
5553 | .Nm OpenSSL | 5665 | .Nm openssl |
5554 | to form an index to allow certificates in a directory to be looked up | 5666 | to form an index to allow certificates in a directory to be looked up |
5555 | by subject name. | 5667 | by subject name. |
5556 | .It Fl subject_hash_old | 5668 | .It Fl subject_hash_old |
5557 | Outputs the | 5669 | Print the hash of the certificate subject name |
5558 | .Qq hash | 5670 | using the older algorithm as used by |
5559 | of the certificate subject name using the older algorithm | 5671 | .Nm openssl |
5560 | as used by | ||
5561 | .Nm OpenSSL | ||
5562 | versions before 1.0.0. | 5672 | versions before 1.0.0. |
5563 | .It Fl text | 5673 | .It Fl text |
5564 | Prints out the certificate in text form. | 5674 | Print the full certificate in text form. |
5565 | Full details are output including the public key, signature algorithms, | ||
5566 | issuer and subject names, serial number, any extensions present, | ||
5567 | and any trust settings. | ||
5568 | .El | 5675 | .El |
5569 | .Sh X509 TRUST SETTINGS | ||
5570 | Please note these options are currently experimental and may well change. | ||
5571 | .Pp | 5676 | .Pp |
5572 | A | 5677 | A trusted certificate is a certificate which has several |
5573 | .Em trusted certificate | ||
5574 | is an ordinary certificate which has several | ||
5575 | additional pieces of information attached to it such as the permitted | 5678 | additional pieces of information attached to it such as the permitted |
5576 | and prohibited uses of the certificate and an | 5679 | and prohibited uses of the certificate and an alias. |
5577 | .Qq alias . | 5680 | When a certificate is being verified at least one certificate must be trusted. |
5578 | .Pp | 5681 | By default, a trusted certificate must be stored locally and be a root CA. |
5579 | Normally, when a certificate is being verified at least one certificate | 5682 | The following are x509 trust settings options: |
5580 | must be | ||
5581 | .Qq trusted . | ||
5582 | By default, a trusted certificate must be stored | ||
5583 | locally and must be a root CA: any certificate chain ending in this CA | ||
5584 | is then usable for any purpose. | ||
5585 | .Pp | ||
5586 | Trust settings currently are only used with a root CA. | ||
5587 | They allow a finer control over the purposes the root CA can be used for. | ||
5588 | For example, a CA may be trusted for an SSL client but not for | ||
5589 | SSL server use. | ||
5590 | .Pp | ||
5591 | See the description of the | ||
5592 | .Nm verify | ||
5593 | utility for more information on the meaning of trust settings. | ||
5594 | .Pp | ||
5595 | Future versions of | ||
5596 | .Nm OpenSSL | ||
5597 | will recognize trust settings on any certificate: not just root CAs. | ||
5598 | .Bl -tag -width "XXXX" | 5683 | .Bl -tag -width "XXXX" |
5599 | .It Fl addreject Ar arg | 5684 | .It Fl addreject Ar arg |
5600 | Adds a prohibited use. | 5685 | Add a prohibited use. |
5601 | It accepts the same values as the | 5686 | Accepts the same values as the |
5602 | .Fl addtrust | 5687 | .Fl addtrust |
5603 | option. | 5688 | option. |
5604 | .It Fl addtrust Ar arg | 5689 | .It Fl addtrust Ar arg |
5605 | Adds a trusted certificate use. | 5690 | Add a trusted certificate use. |
5606 | Any object name can be used here, but currently only | 5691 | Any object name can be used here, but currently only |
5607 | .Ar clientAuth | 5692 | .Cm clientAuth |
5608 | .Pq SSL client use , | 5693 | (SSL client use), |
5609 | .Ar serverAuth | 5694 | .Cm serverAuth |
5610 | .Pq SSL server use , | 5695 | (SSL server use), |
5611 | and | 5696 | and |
5612 | .Ar emailProtection | 5697 | .Cm emailProtection |
5613 | .Pq S/MIME email | 5698 | (S/MIME email) are used. |
5614 | are used. | ||
5615 | Other | ||
5616 | .Nm OpenSSL | ||
5617 | applications may define additional uses. | ||
5618 | .It Fl alias | 5699 | .It Fl alias |
5619 | Outputs the certificate alias, if any. | 5700 | Output the certificate alias. |
5620 | .It Fl clrreject | 5701 | .It Fl clrreject |
5621 | Clears all the prohibited or rejected uses of the certificate. | 5702 | Clear all the prohibited or rejected uses of the certificate. |
5622 | .It Fl clrtrust | 5703 | .It Fl clrtrust |
5623 | Clears all the permitted or trusted uses of the certificate. | 5704 | Clear all the permitted or trusted uses of the certificate. |
5624 | .It Fl purpose | 5705 | .It Fl purpose |
5625 | This option performs tests on the certificate extensions and outputs | 5706 | Perform tests on the certificate extensions. |
5626 | the results. | 5707 | The same code is used when verifying untrusted certificates in chains, |
5627 | For a more complete description, see the | 5708 | so this section is useful if a chain is rejected by the verify code. |
5628 | .Sx X.509 CERTIFICATE EXTENSIONS | 5709 | .Pp |
5629 | section. | 5710 | The |
5711 | .Cm basicConstraints | ||
5712 | extension CA flag is used to determine whether the | ||
5713 | certificate can be used as a CA. | ||
5714 | If the CA flag is true, it is a CA; | ||
5715 | if the CA flag is false, it is not a CA. | ||
5716 | All CAs should have the CA flag set to true. | ||
5717 | .Pp | ||
5718 | If the | ||
5719 | .Cm basicConstraints | ||
5720 | extension is absent, then the certificate is | ||
5721 | considered to be a possible CA; | ||
5722 | other extensions are checked according to the intended use of the certificate. | ||
5723 | A warning is given in this case because the certificate should really not | ||
5724 | be regarded as a CA. | ||
5725 | However it is allowed to be a CA to work around some broken software. | ||
5726 | .Pp | ||
5727 | If the certificate is a V1 certificate | ||
5728 | (and thus has no extensions) and it is self-signed, | ||
5729 | it is also assumed to be a CA but a warning is again given. | ||
5730 | This is to work around the problem of Verisign roots | ||
5731 | which are V1 self-signed certificates. | ||
5732 | .Pp | ||
5733 | If the | ||
5734 | .Cm keyUsage | ||
5735 | extension is present, then additional restraints are | ||
5736 | made on the uses of the certificate. | ||
5737 | A CA certificate must have the | ||
5738 | .Cm keyCertSign | ||
5739 | bit set if the | ||
5740 | .Cm keyUsage | ||
5741 | extension is present. | ||
5742 | .Pp | ||
5743 | The extended key usage extension places additional restrictions on the | ||
5744 | certificate uses. | ||
5745 | If this extension is present, whether critical or not, | ||
5746 | the key can only be used for the purposes specified. | ||
5747 | .Pp | ||
5748 | A complete description of each test is given below. | ||
5749 | The comments about | ||
5750 | .Cm basicConstraints | ||
5751 | and | ||
5752 | .Cm keyUsage | ||
5753 | and V1 certificates above apply to all CA certificates. | ||
5754 | .Bl -tag -width "XXXX" | ||
5755 | .It SSL Client | ||
5756 | The extended key usage extension must be absent or include the | ||
5757 | web client authentication OID. | ||
5758 | .Cm keyUsage | ||
5759 | must be absent or it must have the | ||
5760 | .Cm digitalSignature | ||
5761 | bit set. | ||
5762 | The Netscape certificate type must be absent | ||
5763 | or it must have the SSL client bit set. | ||
5764 | .It SSL Client CA | ||
5765 | The extended key usage extension must be absent or include the | ||
5766 | web client authentication OID. | ||
5767 | The Netscape certificate type must be absent | ||
5768 | or it must have the SSL CA bit set: | ||
5769 | this is used as a workaround if the | ||
5770 | .Cm basicConstraints | ||
5771 | extension is absent. | ||
5772 | .It SSL Server | ||
5773 | The extended key usage extension must be absent or include the | ||
5774 | web server authentication and/or one of the SGC OIDs. | ||
5775 | .Cm keyUsage | ||
5776 | must be absent or it must have the | ||
5777 | .Cm digitalSignature | ||
5778 | set, the | ||
5779 | .Cm keyEncipherment | ||
5780 | set, or both bits set. | ||
5781 | The Netscape certificate type must be absent or have the SSL server bit set. | ||
5782 | .It SSL Server CA | ||
5783 | The extended key usage extension must be absent or include the | ||
5784 | web server authentication and/or one of the SGC OIDs. | ||
5785 | The Netscape certificate type must be absent or the SSL CA bit must be set: | ||
5786 | this is used as a workaround if the | ||
5787 | .Cm basicConstraints | ||
5788 | extension is absent. | ||
5789 | .It Netscape SSL Server | ||
5790 | For Netscape SSL clients to connect to an SSL server; it must have the | ||
5791 | .Cm keyEncipherment | ||
5792 | bit set if the | ||
5793 | .Cm keyUsage | ||
5794 | extension is present. | ||
5795 | This isn't always valid because some cipher suites use the key for | ||
5796 | digital signing. | ||
5797 | Otherwise it is the same as a normal SSL server. | ||
5798 | .It Common S/MIME Client Tests | ||
5799 | The extended key usage extension must be absent or include the | ||
5800 | email protection OID. | ||
5801 | The Netscape certificate type must be absent or should have the S/MIME bit set. | ||
5802 | If the S/MIME bit is not set in Netscape certificate type, then the SSL | ||
5803 | client bit is tolerated as an alternative but a warning is shown: | ||
5804 | this is because some Verisign certificates don't set the S/MIME bit. | ||
5805 | .It S/MIME Signing | ||
5806 | In addition to the common S/MIME client tests, the | ||
5807 | .Cm digitalSignature | ||
5808 | bit must be set if the | ||
5809 | .Cm keyUsage | ||
5810 | extension is present. | ||
5811 | .It S/MIME Encryption | ||
5812 | In addition to the common S/MIME tests, the | ||
5813 | .Cm keyEncipherment | ||
5814 | bit must be set if the | ||
5815 | .Cm keyUsage | ||
5816 | extension is present. | ||
5817 | .It S/MIME CA | ||
5818 | The extended key usage extension must be absent or include the | ||
5819 | email protection OID. | ||
5820 | The Netscape certificate type must be absent | ||
5821 | or must have the S/MIME CA bit set: | ||
5822 | this is used as a workaround if the | ||
5823 | .Cm basicConstraints | ||
5824 | extension is absent. | ||
5825 | .It CRL Signing | ||
5826 | The | ||
5827 | .Cm keyUsage | ||
5828 | extension must be absent or it must have the CRL signing bit set. | ||
5829 | .It CRL Signing CA | ||
5830 | The normal CA tests apply, except the | ||
5831 | .Cm basicConstraints | ||
5832 | extension must be present. | ||
5833 | .El | ||
5630 | .It Fl setalias Ar arg | 5834 | .It Fl setalias Ar arg |
5631 | Sets the alias of the certificate. | 5835 | Set the alias of the certificate, |
5632 | This will allow the certificate to be referred to using a nickname, | 5836 | allowing the certificate to be referred to using a nickname, |
5633 | for example | 5837 | such as |
5634 | .Qq Steve's Certificate . | 5838 | .Qq Steve's Certificate . |
5635 | .It Fl trustout | 5839 | .It Fl trustout |
5636 | This causes | 5840 | Output a trusted certificate |
5637 | .Nm x509 | 5841 | (the default if any trust settings are modified). |
5638 | to output a | ||
5639 | .Em trusted certificate . | ||
5640 | An ordinary or trusted certificate can be input, but by default an ordinary | 5842 | An ordinary or trusted certificate can be input, but by default an ordinary |
5641 | certificate is output and any trust settings are discarded. | 5843 | certificate is output and any trust settings are discarded. |
5642 | With the | ||
5643 | .Fl trustout | ||
5644 | option a trusted certificate is output. | ||
5645 | A trusted certificate is automatically output if any trust settings | ||
5646 | are modified. | ||
5647 | .El | 5844 | .El |
5648 | .Sh X509 SIGNING OPTIONS | 5845 | .Pp |
5649 | The | 5846 | The |
5650 | .Nm x509 | 5847 | .Nm x509 |
5651 | utility can be used to sign certificates and requests: it | 5848 | utility can be used to sign certificates and requests: |
5652 | can thus behave like a | 5849 | it can thus behave like a mini CA. |
5653 | .Qq mini CA . | 5850 | The following are x509 signing options: |
5654 | .Bl -tag -width "XXXX" | 5851 | .Bl -tag -width "XXXX" |
5655 | .It Fl CA Ar file | 5852 | .It Fl CA Ar file |
5656 | Specifies the CA certificate to be used for signing. | 5853 | The CA certificate to be used for signing. |
5657 | When this option is present, | 5854 | When this option is present, |
5658 | .Nm x509 | 5855 | .Nm x509 |
5659 | behaves like a | 5856 | behaves like a mini CA. |
5660 | .Qq mini CA . | ||
5661 | The input file is signed by the CA using this option; | 5857 | The input file is signed by the CA using this option; |
5662 | that is, its issuer name is set to the subject name of the CA and it is | 5858 | that is, its issuer name is set to the subject name of the CA and it is |
5663 | digitally signed using the CA's private key. | 5859 | digitally signed using the CA's private key. |
@@ -5669,35 +5865,30 @@ Without the | |||
5669 | .Fl req | 5865 | .Fl req |
5670 | option, the input is a certificate which must be self-signed. | 5866 | option, the input is a certificate which must be self-signed. |
5671 | .It Fl CAcreateserial | 5867 | .It Fl CAcreateserial |
5672 | With this option the CA serial number file is created if it does not exist: | 5868 | Create the CA serial number file if it does not exist |
5673 | it will contain the serial number | 5869 | instead of generating an error. |
5870 | The file will contain the serial number | ||
5674 | .Sq 02 | 5871 | .Sq 02 |
5675 | and the certificate being signed will have | 5872 | and the certificate being signed will have |
5676 | .Sq 1 | 5873 | .Sq 1 |
5677 | as its serial number. | 5874 | as its serial number. |
5678 | Normally, if the | 5875 | .It Fl CAform Cm der | pem |
5679 | .Fl CA | ||
5680 | option is specified and the serial number file does not exist, it is an error. | ||
5681 | .It Fl CAform Ar DER | PEM | ||
5682 | The format of the CA certificate file. | 5876 | The format of the CA certificate file. |
5683 | The default is | 5877 | The default is |
5684 | .Ar PEM . | 5878 | .Cm pem . |
5685 | .It Fl CAkey Ar file | 5879 | .It Fl CAkey Ar file |
5686 | Sets the CA private key to sign a certificate with. | 5880 | Set the CA private key to sign a certificate with. |
5687 | If this option is not specified, it is assumed that the CA private key | 5881 | Otherwise it is assumed that the CA private key is present |
5688 | is present in the CA certificate file. | 5882 | in the CA certificate file. |
5689 | .It Fl CAkeyform Ar DER | PEM | 5883 | .It Fl CAkeyform Cm der | pem |
5690 | The format of the CA private key. | 5884 | The format of the CA private key. |
5691 | The default is | 5885 | The default is |
5692 | .Ar PEM . | 5886 | .Cm pem . |
5693 | .It Fl CAserial Ar file | 5887 | .It Fl CAserial Ar file |
5694 | Sets the CA serial number file to use. | 5888 | Use the serial number in |
5695 | .Pp | 5889 | .Ar file |
5696 | When the | 5890 | to sign a certificate. |
5697 | .Fl CA | 5891 | The file should consist of one line containing an even number of hex digits |
5698 | option is used to sign a certificate, | ||
5699 | it uses a serial number specified in a file. | ||
5700 | This file consists of one line containing an even number of hex digits | ||
5701 | with the serial number to use. | 5892 | with the serial number to use. |
5702 | After each use the serial number is incremented and written out | 5893 | After each use the serial number is incremented and written out |
5703 | to the file again. | 5894 | to the file again. |
@@ -5725,30 +5916,26 @@ or the | |||
5725 | options). | 5916 | options). |
5726 | Normally, all extensions are retained. | 5917 | Normally, all extensions are retained. |
5727 | .It Fl days Ar arg | 5918 | .It Fl days Ar arg |
5728 | Specifies the number of days to make a certificate valid for. | 5919 | The number of days to make a certificate valid for. |
5729 | The default is 30 days. | 5920 | The default is 30 days. |
5730 | .It Fl extensions Ar section | 5921 | .It Fl extensions Ar section |
5731 | The section to add certificate extensions from. | 5922 | The section to add certificate extensions from. |
5732 | If this option is not specified, the extensions should either be | 5923 | If this option is not specified, the extensions should either be |
5733 | contained in the unnamed | 5924 | contained in the unnamed (default) section |
5734 | .Pq default | 5925 | or the default section should contain a variable called |
5735 | section or the default section should contain a variable called | ||
5736 | .Qq extensions | 5926 | .Qq extensions |
5737 | which contains the section to use. | 5927 | which contains the section to use. |
5738 | .It Fl extfile Ar file | 5928 | .It Fl extfile Ar file |
5739 | File containing certificate extensions to use. | 5929 | File containing certificate extensions to use. |
5740 | If not specified, no extensions are added to the certificate. | 5930 | If not specified, no extensions are added to the certificate. |
5741 | .It Fl keyform Ar DER | PEM | 5931 | .It Fl keyform Cm der | pem |
5742 | Specifies the format | 5932 | The format of the private key file used in the |
5743 | .Pq DER or PEM | ||
5744 | of the private key file used in the | ||
5745 | .Fl signkey | 5933 | .Fl signkey |
5746 | option. | 5934 | option. |
5747 | .It Fl req | 5935 | .It Fl req |
5748 | By default, a certificate is expected on input. | 5936 | Expect a certificate request on input instead of a certificate. |
5749 | With this option a certificate request is expected instead. | ||
5750 | .It Fl set_serial Ar n | 5937 | .It Fl set_serial Ar n |
5751 | Specifies the serial number to use. | 5938 | The serial number to use. |
5752 | This option can be used with either the | 5939 | This option can be used with either the |
5753 | .Fl signkey | 5940 | .Fl signkey |
5754 | or | 5941 | or |
@@ -5766,12 +5953,12 @@ The serial number can be decimal or hex (if preceded by | |||
5766 | .Sq 0x ) . | 5953 | .Sq 0x ) . |
5767 | Negative serial numbers can also be specified but their use is not recommended. | 5954 | Negative serial numbers can also be specified but their use is not recommended. |
5768 | .It Fl signkey Ar file | 5955 | .It Fl signkey Ar file |
5769 | This option causes the input file to be self-signed using the supplied | 5956 | Self-sign |
5770 | private key. | 5957 | .Ar file |
5958 | using the supplied private key. | ||
5771 | .Pp | 5959 | .Pp |
5772 | If the input file is a certificate, it sets the issuer name to the | 5960 | If the input file is a certificate, it sets the issuer name to the |
5773 | subject name | 5961 | subject name (i.e. makes it self-signed), |
5774 | .Pq i.e. makes it self-signed , | ||
5775 | changes the public key to the supplied value, | 5962 | changes the public key to the supplied value, |
5776 | and changes the start and end dates. | 5963 | and changes the start and end dates. |
5777 | The start date is set to the current time and the end date is set to | 5964 | The start date is set to the current time and the end date is set to |
@@ -5786,539 +5973,11 @@ If the input is a certificate request, a self-signed certificate | |||
5786 | is created using the supplied private key using the subject name in | 5973 | is created using the supplied private key using the subject name in |
5787 | the request. | 5974 | the request. |
5788 | .It Fl x509toreq | 5975 | .It Fl x509toreq |
5789 | Converts a certificate into a certificate request. | 5976 | Convert a certificate into a certificate request. |
5790 | The | 5977 | The |
5791 | .Fl signkey | 5978 | .Fl signkey |
5792 | option is used to pass the required private key. | 5979 | option is used to pass the required private key. |
5793 | .El | 5980 | .El |
5794 | .Sh X509 NAME OPTIONS | ||
5795 | The | ||
5796 | .Fl nameopt | ||
5797 | command line switch determines how the subject and issuer | ||
5798 | names are displayed. | ||
5799 | If no | ||
5800 | .Fl nameopt | ||
5801 | switch is present, the default | ||
5802 | .Qq oneline | ||
5803 | format is used which is compatible with previous versions of | ||
5804 | .Nm OpenSSL . | ||
5805 | Each option is described in detail below; all options can be preceded by a | ||
5806 | .Sq - | ||
5807 | to turn the option off. | ||
5808 | Only | ||
5809 | .Ar compat , | ||
5810 | .Ar RFC2253 , | ||
5811 | .Ar oneline , | ||
5812 | and | ||
5813 | .Ar multiline | ||
5814 | will normally be used. | ||
5815 | .Bl -tag -width "XXXX" | ||
5816 | .It Ar align | ||
5817 | Align field values for a more readable output. | ||
5818 | Only usable with | ||
5819 | .Ar sep_multiline . | ||
5820 | .It Ar compat | ||
5821 | Use the old format. | ||
5822 | This is equivalent to specifying no name options at all. | ||
5823 | .It Ar dn_rev | ||
5824 | Reverse the fields of the DN. | ||
5825 | This is required by RFC 2253. | ||
5826 | As a side effect, this also reverses the order of multiple AVAs but this is | ||
5827 | permissible. | ||
5828 | .It Ar dump_all | ||
5829 | Dump all fields. | ||
5830 | This option, when used with | ||
5831 | .Ar dump_der , | ||
5832 | allows the DER encoding of the structure to be unambiguously determined. | ||
5833 | .It Ar dump_der | ||
5834 | When this option is set, any fields that need to be hexdumped will | ||
5835 | be dumped using the DER encoding of the field. | ||
5836 | Otherwise just the content octets will be displayed. | ||
5837 | Both options use the RFC 2253 #XXXX... format. | ||
5838 | .It Ar dump_nostr | ||
5839 | Dump non-character string types | ||
5840 | .Pq for example OCTET STRING ; | ||
5841 | if this option is not set, non-character string types will be displayed | ||
5842 | as though each content octet represents a single character. | ||
5843 | .It Ar dump_unknown | ||
5844 | Dump any field whose OID is not recognised by | ||
5845 | .Nm OpenSSL . | ||
5846 | .It Ar esc_2253 | ||
5847 | Escape the | ||
5848 | .Qq special | ||
5849 | characters required by RFC 2253 in a field that is | ||
5850 | .Dq \& ,+"\*(Lt\*(Gt; . | ||
5851 | Additionally, | ||
5852 | .Sq # | ||
5853 | is escaped at the beginning of a string | ||
5854 | and a space character at the beginning or end of a string. | ||
5855 | .It Ar esc_ctrl | ||
5856 | Escape control characters. | ||
5857 | That is, those with ASCII values less than 0x20 | ||
5858 | .Pq space | ||
5859 | and the delete | ||
5860 | .Pq 0x7f | ||
5861 | character. | ||
5862 | They are escaped using the RFC 2253 \eXX notation (where XX are two hex | ||
5863 | digits representing the character value). | ||
5864 | .It Ar esc_msb | ||
5865 | Escape characters with the MSB set; that is, with ASCII values larger than | ||
5866 | 127. | ||
5867 | .It Ar multiline | ||
5868 | A multiline format. | ||
5869 | It is equivalent to | ||
5870 | .Ar esc_ctrl , esc_msb , sep_multiline , | ||
5871 | .Ar space_eq , lname , | ||
5872 | and | ||
5873 | .Ar align . | ||
5874 | .It Ar no_type | ||
5875 | This option does not attempt to interpret multibyte characters in any | ||
5876 | way. | ||
5877 | That is, their content octets are merely dumped as though one octet | ||
5878 | represents each character. | ||
5879 | This is useful for diagnostic purposes but will result in rather odd | ||
5880 | looking output. | ||
5881 | .It Ar nofname , sname , lname , oid | ||
5882 | These options alter how the field name is displayed. | ||
5883 | .Ar nofname | ||
5884 | does not display the field at all. | ||
5885 | .Ar sname | ||
5886 | uses the | ||
5887 | .Qq short name | ||
5888 | form (CN for | ||
5889 | .Ar commonName , | ||
5890 | for example). | ||
5891 | .Ar lname | ||
5892 | uses the long form. | ||
5893 | .Ar oid | ||
5894 | represents the OID in numerical form and is useful for diagnostic purpose. | ||
5895 | .It Ar oneline | ||
5896 | A oneline format which is more readable than | ||
5897 | .Ar RFC2253 . | ||
5898 | It is equivalent to specifying the | ||
5899 | .Ar esc_2253 , esc_ctrl , esc_msb , utf8 , | ||
5900 | .Ar dump_nostr , dump_der , use_quote , sep_comma_plus_spc , | ||
5901 | .Ar space_eq , | ||
5902 | and | ||
5903 | .Ar sname | ||
5904 | options. | ||
5905 | .It Ar RFC2253 | ||
5906 | Displays names compatible with RFC 2253; equivalent to | ||
5907 | .Ar esc_2253 , esc_ctrl , | ||
5908 | .Ar esc_msb , utf8 , dump_nostr , dump_unknown , | ||
5909 | .Ar dump_der , sep_comma_plus , dn_rev , | ||
5910 | and | ||
5911 | .Ar sname . | ||
5912 | .It Ar sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline | ||
5913 | These options determine the field separators. | ||
5914 | The first character is between RDNs and the second between multiple AVAs | ||
5915 | (multiple AVAs are very rare and their use is discouraged). | ||
5916 | The options ending in | ||
5917 | .Qq space | ||
5918 | additionally place a space after the separator to make it more readable. | ||
5919 | The | ||
5920 | .Ar sep_multiline | ||
5921 | uses a linefeed character for the RDN separator and a spaced | ||
5922 | .Sq + | ||
5923 | for the AVA separator. | ||
5924 | It also indents the fields by four characters. | ||
5925 | .It Ar show_type | ||
5926 | Show the type of the ASN1 character string. | ||
5927 | The type precedes the field contents. | ||
5928 | For example | ||
5929 | .Qq BMPSTRING: Hello World . | ||
5930 | .It Ar space_eq | ||
5931 | Places spaces round the | ||
5932 | .Sq = | ||
5933 | character which follows the field name. | ||
5934 | .It Ar use_quote | ||
5935 | Escapes some characters by surrounding the whole string with | ||
5936 | .Sq \&" | ||
5937 | characters. | ||
5938 | Without the option, all escaping is done with the | ||
5939 | .Sq \e | ||
5940 | character. | ||
5941 | .It Ar utf8 | ||
5942 | Convert all strings to UTF8 format first. | ||
5943 | This is required by RFC 2253. | ||
5944 | If you are lucky enough to have a UTF8 compatible terminal, | ||
5945 | the use of this option (and | ||
5946 | .Em not | ||
5947 | setting | ||
5948 | .Ar esc_msb ) | ||
5949 | may result in the correct display of multibyte | ||
5950 | .Pq international | ||
5951 | characters. | ||
5952 | If this option is not present, multibyte characters larger than 0xff | ||
5953 | will be represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX | ||
5954 | for 32 bits. | ||
5955 | Also, if this option is off, any UTF8Strings will be converted to their | ||
5956 | character form first. | ||
5957 | .El | ||
5958 | .Sh X509 TEXT OPTIONS | ||
5959 | As well as customising the name output format, it is also possible to | ||
5960 | customise the actual fields printed using the | ||
5961 | .Fl certopt | ||
5962 | options when the | ||
5963 | .Fl text | ||
5964 | option is present. | ||
5965 | The default behaviour is to print all fields. | ||
5966 | .Bl -tag -width "XXXX" | ||
5967 | .It Ar ca_default | ||
5968 | The value used by the | ||
5969 | .Nm ca | ||
5970 | utility; equivalent to | ||
5971 | .Ar no_issuer , no_pubkey , no_header , | ||
5972 | .Ar no_version , no_sigdump , | ||
5973 | and | ||
5974 | .Ar no_signame . | ||
5975 | .It Ar compatible | ||
5976 | Use the old format. | ||
5977 | This is equivalent to specifying no output options at all. | ||
5978 | .It Ar ext_default | ||
5979 | Retain default extension behaviour: attempt to print out unsupported | ||
5980 | certificate extensions. | ||
5981 | .It Ar ext_dump | ||
5982 | Hex dump unsupported extensions. | ||
5983 | .It Ar ext_error | ||
5984 | Print an error message for unsupported certificate extensions. | ||
5985 | .It Ar ext_parse | ||
5986 | ASN1 parse unsupported extensions. | ||
5987 | .It Ar no_aux | ||
5988 | Don't print out certificate trust information. | ||
5989 | .It Ar no_extensions | ||
5990 | Don't print out any X509V3 extensions. | ||
5991 | .It Ar no_header | ||
5992 | Don't print header information: that is, the lines saying | ||
5993 | .Qq Certificate | ||
5994 | and | ||
5995 | .Qq Data . | ||
5996 | .It Ar no_issuer | ||
5997 | Don't print out the issuer name. | ||
5998 | .It Ar no_pubkey | ||
5999 | Don't print out the public key. | ||
6000 | .It Ar no_serial | ||
6001 | Don't print out the serial number. | ||
6002 | .It Ar no_sigdump | ||
6003 | Don't give a hexadecimal dump of the certificate signature. | ||
6004 | .It Ar no_signame | ||
6005 | Don't print out the signature algorithm used. | ||
6006 | .It Ar no_subject | ||
6007 | Don't print out the subject name. | ||
6008 | .It Ar no_validity | ||
6009 | Don't print the validity; that is, the | ||
6010 | .Em notBefore | ||
6011 | and | ||
6012 | .Em notAfter | ||
6013 | fields. | ||
6014 | .It Ar no_version | ||
6015 | Don't print out the version number. | ||
6016 | .El | ||
6017 | .Sh X509 EXAMPLES | ||
6018 | Display the contents of a certificate: | ||
6019 | .Pp | ||
6020 | .Dl $ openssl x509 -in cert.pem -noout -text | ||
6021 | .Pp | ||
6022 | Display the certificate serial number: | ||
6023 | .Pp | ||
6024 | .Dl $ openssl x509 -in cert.pem -noout -serial | ||
6025 | .Pp | ||
6026 | Display the certificate subject name: | ||
6027 | .Pp | ||
6028 | .Dl $ openssl x509 -in cert.pem -noout -subject | ||
6029 | .Pp | ||
6030 | Display the certificate subject name in RFC 2253 form: | ||
6031 | .Pp | ||
6032 | .Dl $ openssl x509 -in cert.pem -noout -subject -nameopt RFC2253 | ||
6033 | .Pp | ||
6034 | Display the certificate subject name in oneline form on a terminal | ||
6035 | supporting UTF8: | ||
6036 | .Bd -literal -offset indent | ||
6037 | $ openssl x509 -in cert.pem -noout -subject \e | ||
6038 | -nameopt oneline,-esc_msb | ||
6039 | .Ed | ||
6040 | .Pp | ||
6041 | Display the certificate MD5 fingerprint: | ||
6042 | .Pp | ||
6043 | .Dl $ openssl x509 -in cert.pem -noout -fingerprint | ||
6044 | .Pp | ||
6045 | Display the certificate SHA1 fingerprint: | ||
6046 | .Pp | ||
6047 | .Dl $ openssl x509 -sha1 -in cert.pem -noout -fingerprint | ||
6048 | .Pp | ||
6049 | Convert a certificate from PEM to DER format: | ||
6050 | .Pp | ||
6051 | .Dl "$ openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER" | ||
6052 | .Pp | ||
6053 | Convert a certificate to a certificate request: | ||
6054 | .Bd -literal -offset indent | ||
6055 | $ openssl x509 -x509toreq -in cert.pem -out req.pem \e | ||
6056 | -signkey key.pem | ||
6057 | .Ed | ||
6058 | .Pp | ||
6059 | Convert a certificate request into a self-signed certificate using | ||
6060 | extensions for a CA: | ||
6061 | .Bd -literal -offset indent | ||
6062 | $ openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions \e | ||
6063 | v3_ca -signkey key.pem -out cacert.pem | ||
6064 | .Ed | ||
6065 | .Pp | ||
6066 | Sign a certificate request using the CA certificate above and add user | ||
6067 | certificate extensions: | ||
6068 | .Bd -literal -offset indent | ||
6069 | $ openssl x509 -req -in req.pem -extfile openssl.cnf -extensions \e | ||
6070 | v3_usr -CA cacert.pem -CAkey key.pem -CAcreateserial | ||
6071 | .Ed | ||
6072 | .Pp | ||
6073 | Set a certificate to be trusted for SSL | ||
6074 | client use and set its alias to | ||
6075 | .Qq Steve's Class 1 CA : | ||
6076 | .Bd -literal -offset indent | ||
6077 | $ openssl x509 -in cert.pem -addtrust clientAuth \e | ||
6078 | -setalias "Steve's Class 1 CA" -out trust.pem | ||
6079 | .Ed | ||
6080 | .Sh X509 NOTES | ||
6081 | The PEM format uses the header and footer lines: | ||
6082 | .Bd -unfilled -offset indent | ||
6083 | -----BEGIN CERTIFICATE----- | ||
6084 | -----END CERTIFICATE----- | ||
6085 | .Ed | ||
6086 | .Pp | ||
6087 | It will also handle files containing: | ||
6088 | .Bd -unfilled -offset indent | ||
6089 | -----BEGIN X509 CERTIFICATE----- | ||
6090 | -----END X509 CERTIFICATE----- | ||
6091 | .Ed | ||
6092 | .Pp | ||
6093 | Trusted certificates have the lines: | ||
6094 | .Bd -unfilled -offset indent | ||
6095 | -----BEGIN TRUSTED CERTIFICATE----- | ||
6096 | -----END TRUSTED CERTIFICATE----- | ||
6097 | .Ed | ||
6098 | .Pp | ||
6099 | The conversion to UTF8 format used with the name options assumes that | ||
6100 | T61Strings use the ISO 8859-1 character set. | ||
6101 | This is wrong, but Netscape and MSIE do this, as do many certificates. | ||
6102 | So although this is incorrect | ||
6103 | it is more likely to display the majority of certificates correctly. | ||
6104 | .Pp | ||
6105 | The | ||
6106 | .Fl fingerprint | ||
6107 | option takes the digest of the DER-encoded certificate. | ||
6108 | This is commonly called a | ||
6109 | .Qq fingerprint . | ||
6110 | Because of the nature of message digests, the fingerprint of a certificate | ||
6111 | is unique to that certificate and two certificates with the same fingerprint | ||
6112 | can be considered to be the same. | ||
6113 | .Pp | ||
6114 | The Netscape fingerprint uses MD5, whereas MSIE uses SHA1. | ||
6115 | .Pp | ||
6116 | The | ||
6117 | .Fl email | ||
6118 | option searches the subject name and the subject alternative | ||
6119 | name extension. | ||
6120 | Only unique email addresses will be printed out: it will | ||
6121 | not print the same address more than once. | ||
6122 | .Sh X.509 CERTIFICATE EXTENSIONS | ||
6123 | The | ||
6124 | .Fl purpose | ||
6125 | option checks the certificate extensions and determines | ||
6126 | what the certificate can be used for. | ||
6127 | The actual checks done are rather | ||
6128 | complex and include various hacks and workarounds to handle broken | ||
6129 | certificates and software. | ||
6130 | .Pp | ||
6131 | The same code is used when verifying untrusted certificates in chains, | ||
6132 | so this section is useful if a chain is rejected by the verify code. | ||
6133 | .Pp | ||
6134 | The | ||
6135 | .Em basicConstraints | ||
6136 | extension CA flag is used to determine whether the | ||
6137 | certificate can be used as a CA. | ||
6138 | If the CA flag is true, it is a CA; | ||
6139 | if the CA flag is false, it is not a CA. | ||
6140 | .Em All | ||
6141 | CAs should have the CA flag set to true. | ||
6142 | .Pp | ||
6143 | If the | ||
6144 | .Em basicConstraints | ||
6145 | extension is absent, then the certificate is | ||
6146 | considered to be a | ||
6147 | .Qq possible CA ; | ||
6148 | other extensions are checked according to the intended use of the certificate. | ||
6149 | A warning is given in this case because the certificate should really not | ||
6150 | be regarded as a CA: however, | ||
6151 | it is allowed to be a CA to work around some broken software. | ||
6152 | .Pp | ||
6153 | If the certificate is a V1 certificate | ||
6154 | .Pq and thus has no extensions | ||
6155 | and it is self-signed, it is also assumed to be a CA but a warning is again | ||
6156 | given: this is to work around the problem of Verisign roots which are V1 | ||
6157 | self-signed certificates. | ||
6158 | .Pp | ||
6159 | If the | ||
6160 | .Em keyUsage | ||
6161 | extension is present, then additional restraints are | ||
6162 | made on the uses of the certificate. | ||
6163 | A CA certificate | ||
6164 | .Em must | ||
6165 | have the | ||
6166 | .Em keyCertSign | ||
6167 | bit set if the | ||
6168 | .Em keyUsage | ||
6169 | extension is present. | ||
6170 | .Pp | ||
6171 | The extended key usage extension places additional restrictions on the | ||
6172 | certificate uses. | ||
6173 | If this extension is present | ||
6174 | .Pq whether critical or not , | ||
6175 | the key can only be used for the purposes specified. | ||
6176 | .Pp | ||
6177 | A complete description of each test is given below. | ||
6178 | The comments about | ||
6179 | .Em basicConstraints | ||
6180 | and | ||
6181 | .Em keyUsage | ||
6182 | and V1 certificates above apply to | ||
6183 | .Em all | ||
6184 | CA certificates. | ||
6185 | .Bl -tag -width "XXXX" | ||
6186 | .It Ar SSL Client | ||
6187 | The extended key usage extension must be absent or include the | ||
6188 | .Qq web client authentication | ||
6189 | OID. | ||
6190 | .Ar keyUsage | ||
6191 | must be absent or it must have the | ||
6192 | .Em digitalSignature | ||
6193 | bit set. | ||
6194 | Netscape certificate type must be absent or it must have the SSL | ||
6195 | client bit set. | ||
6196 | .It Ar SSL Client CA | ||
6197 | The extended key usage extension must be absent or include the | ||
6198 | .Qq web client authentication | ||
6199 | OID. | ||
6200 | Netscape certificate type must be absent or it must have the SSL CA | ||
6201 | bit set: this is used as a work around if the | ||
6202 | .Em basicConstraints | ||
6203 | extension is absent. | ||
6204 | .It Ar SSL Server | ||
6205 | The extended key usage extension must be absent or include the | ||
6206 | .Qq web server authentication | ||
6207 | and/or one of the SGC OIDs. | ||
6208 | .Em keyUsage | ||
6209 | must be absent or it must have the | ||
6210 | .Em digitalSignature | ||
6211 | set, the | ||
6212 | .Em keyEncipherment | ||
6213 | set, or both bits set. | ||
6214 | Netscape certificate type must be absent or have the SSL server bit set. | ||
6215 | .It Ar SSL Server CA | ||
6216 | The extended key usage extension must be absent or include the | ||
6217 | .Qq web server authentication | ||
6218 | and/or one of the SGC OIDs. | ||
6219 | Netscape certificate type must be absent or the SSL CA | ||
6220 | bit must be set: this is used as a work around if the | ||
6221 | .Em basicConstraints | ||
6222 | extension is absent. | ||
6223 | .It Ar Netscape SSL Server | ||
6224 | For Netscape SSL clients to connect to an SSL server; it must have the | ||
6225 | .Em keyEncipherment | ||
6226 | bit set if the | ||
6227 | .Em keyUsage | ||
6228 | extension is present. | ||
6229 | This isn't always valid because some cipher suites use the key for | ||
6230 | digital signing. | ||
6231 | Otherwise it is the same as a normal SSL server. | ||
6232 | .It Ar Common S/MIME Client Tests | ||
6233 | The extended key usage extension must be absent or include the | ||
6234 | .Qq email protection | ||
6235 | OID. | ||
6236 | Netscape certificate type must be absent or should have the | ||
6237 | .Em S/MIME | ||
6238 | bit set. | ||
6239 | If the | ||
6240 | .Em S/MIME | ||
6241 | bit is not set in Netscape certificate type, then the SSL | ||
6242 | client bit is tolerated as an alternative but a warning is shown: | ||
6243 | this is because some Verisign certificates don't set the | ||
6244 | .Em S/MIME | ||
6245 | bit. | ||
6246 | .It Ar S/MIME Signing | ||
6247 | In addition to the common | ||
6248 | .Em S/MIME | ||
6249 | client tests, the | ||
6250 | .Em digitalSignature | ||
6251 | bit must be set if the | ||
6252 | .Em keyUsage | ||
6253 | extension is present. | ||
6254 | .It Ar S/MIME Encryption | ||
6255 | In addition to the common | ||
6256 | .Em S/MIME | ||
6257 | tests, the | ||
6258 | .Em keyEncipherment | ||
6259 | bit must be set if the | ||
6260 | .Em keyUsage | ||
6261 | extension is present. | ||
6262 | .It Ar S/MIME CA | ||
6263 | The extended key usage extension must be absent or include the | ||
6264 | .Qq email protection | ||
6265 | OID. | ||
6266 | Netscape certificate type must be absent or must have the | ||
6267 | .Em S/MIME CA | ||
6268 | bit set: this is used as a work around if the | ||
6269 | .Em basicConstraints | ||
6270 | extension is absent. | ||
6271 | .It Ar CRL Signing | ||
6272 | The | ||
6273 | .Em keyUsage | ||
6274 | extension must be absent or it must have the | ||
6275 | .Em CRL | ||
6276 | signing bit set. | ||
6277 | .It Ar CRL Signing CA | ||
6278 | The normal CA tests apply. | ||
6279 | Except in this case the | ||
6280 | .Em basicConstraints | ||
6281 | extension must be present. | ||
6282 | .El | ||
6283 | .Sh X509 BUGS | ||
6284 | Extensions in certificates are not transferred to certificate requests and | ||
6285 | vice versa. | ||
6286 | .Pp | ||
6287 | It is possible to produce invalid certificates or requests by specifying the | ||
6288 | wrong private key or using inconsistent options in some cases: these should | ||
6289 | be checked. | ||
6290 | .Pp | ||
6291 | There should be options to explicitly set such things as start and end dates, | ||
6292 | rather than an offset from the current time. | ||
6293 | .Pp | ||
6294 | The code to implement the verify behaviour described in the | ||
6295 | .Sx X509 TRUST SETTINGS | ||
6296 | is currently being developed. | ||
6297 | It thus describes the intended behaviour rather than the current behaviour. | ||
6298 | It is hoped that it will represent reality in | ||
6299 | .Nm OpenSSL | ||
6300 | 0.9.5 and later. | ||
6301 | .Sh X509 HISTORY | ||
6302 | Before | ||
6303 | .Nm OpenSSL | ||
6304 | 0.9.8, | ||
6305 | the default digest for RSA keys was MD5. | ||
6306 | .Pp | ||
6307 | The hash algorithm used in the | ||
6308 | .Fl subject_hash | ||
6309 | and | ||
6310 | .Fl issuer_hash | ||
6311 | options before | ||
6312 | .Nm OpenSSL | ||
6313 | 1.0.0 was based on the deprecated MD5 algorithm and the encoding | ||
6314 | of the distinguished name. | ||
6315 | In | ||
6316 | .Nm OpenSSL | ||
6317 | 1.0.0 and later it is based on a canonical version of the DN using SHA1. | ||
6318 | This means that any directories using the old form | ||
6319 | must have their links rebuilt using | ||
6320 | .Ar c_rehash | ||
6321 | or similar. | ||
6322 | .Sh COMMON NOTATION | 5981 | .Sh COMMON NOTATION |
6323 | Several commands share a common syntax, | 5982 | Several commands share a common syntax, |
6324 | as detailed below. | 5983 | as detailed below. |