diff options
author | jmc <> | 2004-12-03 01:41:17 +0000 |
---|---|---|
committer | jmc <> | 2004-12-03 01:41:17 +0000 |
commit | d215df80389dbae81d8b3a3e210e6a1be96479ca (patch) | |
tree | 1a02ab47c451087324e0ac593b990048dbb6b345 | |
parent | 0763d6b5127f254e776c4d39ecbeca9d455f1399 (diff) | |
download | openbsd-d215df80389dbae81d8b3a3e210e6a1be96479ca.tar.gz openbsd-d215df80389dbae81d8b3a3e210e6a1be96479ca.tar.bz2 openbsd-d215df80389dbae81d8b3a3e210e6a1be96479ca.zip |
various fixes for openssl x509;
-rw-r--r-- | src/usr.sbin/openssl/openssl.1 | 685 |
1 files changed, 349 insertions, 336 deletions
diff --git a/src/usr.sbin/openssl/openssl.1 b/src/usr.sbin/openssl/openssl.1 index 0d76a4d158..cd76d416ab 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.49 2004/09/28 21:16:12 jmc Exp $ | 1 | .\" $OpenBSD: openssl.1,v 1.50 2004/12/03 01:41:17 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 | .\" |
@@ -7337,53 +7337,54 @@ option was added in | |||
7337 | .Sh X509 | 7337 | .Sh X509 |
7338 | .Nm openssl x509 | 7338 | .Nm openssl x509 |
7339 | .Bk -words | 7339 | .Bk -words |
7340 | .Op Fl inform Ar DER | NET | PEM | 7340 | .Op Fl alias |
7341 | .Op Fl outform Ar DER | NET | PEM | 7341 | .Op Fl C |
7342 | .Op Fl keyform Ar DER | PEM | 7342 | .Op Fl CAcreateserial |
7343 | .Op Fl CAform Ar DER | PEM | 7343 | .Op Fl clrext |
7344 | .Op Fl CAkeyform Ar DER | PEM | 7344 | .Op Fl clrreject |
7345 | .Op Fl in Ar file | 7345 | .Op Fl clrtrust |
7346 | .Op Fl out Ar file | 7346 | .Op Fl dates |
7347 | .Op Fl passin Ar arg | ||
7348 | .Op Fl serial | ||
7349 | .Op Fl hash | ||
7350 | .Op Fl subject | ||
7351 | .Op Fl issuer | ||
7352 | .Op Fl nameopt Ar option | ||
7353 | .Op Fl email | 7347 | .Op Fl email |
7354 | .Op Fl startdate | ||
7355 | .Op Fl enddate | 7348 | .Op Fl enddate |
7356 | .Op Fl purpose | ||
7357 | .Op Fl dates | ||
7358 | .Op Fl modulus | ||
7359 | .Op Fl pubkey | ||
7360 | .Op Fl fingerprint | 7349 | .Op Fl fingerprint |
7361 | .Op Fl alias | 7350 | .Op Fl hash |
7351 | .Op Fl issuer | ||
7352 | .Op Fl md2 | md5 | sha1 | ||
7353 | .Op Fl modulus | ||
7362 | .Op Fl noout | 7354 | .Op Fl noout |
7363 | .Op Fl ocspid | 7355 | .Op Fl ocspid |
7356 | .Op Fl pubkey | ||
7357 | .Op Fl purpose | ||
7358 | .Op Fl req | ||
7359 | .Op Fl serial | ||
7360 | .Op Fl startdate | ||
7361 | .Op Fl subject | ||
7362 | .Op Fl text | ||
7364 | .Op Fl trustout | 7363 | .Op Fl trustout |
7365 | .Op Fl clrtrust | ||
7366 | .Op Fl clrreject | ||
7367 | .Op Fl addtrust Ar arg | ||
7368 | .Op Fl addreject Ar arg | ||
7369 | .Op Fl setalias Ar arg | ||
7370 | .Op Fl days Ar arg | ||
7371 | .Op Fl checkend Ar arg | ||
7372 | .Op Fl set_serial Ar n | ||
7373 | .Op Fl signkey Ar file | ||
7374 | .Op Fl x509toreq | 7364 | .Op Fl x509toreq |
7375 | .Op Fl req | 7365 | .Op Fl addreject Ar arg |
7366 | .Op Fl addtrust Ar arg | ||
7376 | .Op Fl CA Ar file | 7367 | .Op Fl CA Ar file |
7368 | .Op Fl CAform Ar DER | PEM | ||
7377 | .Op Fl CAkey Ar file | 7369 | .Op Fl CAkey Ar file |
7378 | .Op Fl CAcreateserial | 7370 | .Op Fl CAkeyform Ar DER | PEM |
7379 | .Op Fl CAserial Ar file | 7371 | .Op Fl CAserial Ar file |
7380 | .Op Fl text | 7372 | .Op Fl certopt Ar option |
7381 | .Op Fl C | 7373 | .Op Fl checkend Ar arg |
7382 | .Op Fl md2 | md5 | sha1 | 7374 | .Op Fl days Ar arg |
7383 | .Op Fl clrext | ||
7384 | .Op Fl extfile Ar file | ||
7385 | .Op Fl extensions Ar section | ||
7386 | .Op Fl engine Ar id | 7375 | .Op Fl engine Ar id |
7376 | .Op Fl extensions Ar section | ||
7377 | .Op Fl extfile Ar file | ||
7378 | .Op Fl in Ar file | ||
7379 | .Op Fl inform Ar DER | NET | PEM | ||
7380 | .Op Fl keyform Ar DER | PEM | ||
7381 | .Op Fl nameopt Ar option | ||
7382 | .Op Fl out Ar file | ||
7383 | .Op Fl outform Ar DER | NET | PEM | ||
7384 | .Op Fl passin Ar arg | ||
7385 | .Op Fl set_serial Ar n | ||
7386 | .Op Fl setalias Ar arg | ||
7387 | .Op Fl signkey Ar file | ||
7387 | .Ek | 7388 | .Ek |
7388 | .Pp | 7389 | .Pp |
7389 | The | 7390 | The |
@@ -7398,6 +7399,18 @@ Since there are a large number of options, they are split up into | |||
7398 | various sections. | 7399 | various sections. |
7399 | .Sh X509 INPUT, OUTPUT, AND GENERAL PURPOSE OPTIONS | 7400 | .Sh X509 INPUT, OUTPUT, AND GENERAL PURPOSE OPTIONS |
7400 | .Bl -tag -width "XXXX" | 7401 | .Bl -tag -width "XXXX" |
7402 | .It Fl engine Ar id | ||
7403 | Specifying an engine (by it's unique | ||
7404 | .Ar id | ||
7405 | string) will cause | ||
7406 | .Nm x509 | ||
7407 | to attempt to obtain a functional reference to the specified engine, | ||
7408 | thus initialising it if needed. | ||
7409 | The engine will then be set as the default for all available algorithms. | ||
7410 | .It Fl in Ar file | ||
7411 | This specifies the input | ||
7412 | .Ar file | ||
7413 | to read a certificate from, or standard input if this option is not specified. | ||
7401 | .It Fl inform Ar DER | NET | PEM | 7414 | .It Fl inform Ar DER | NET | PEM |
7402 | This specifies the input format. | 7415 | This specifies the input format. |
7403 | Normally, the command will expect an X509 certificate, | 7416 | Normally, the command will expect an X509 certificate, |
@@ -7413,25 +7426,6 @@ The | |||
7413 | .Ar NET | 7426 | .Ar NET |
7414 | option is an obscure Netscape server format that is now | 7427 | option is an obscure Netscape server format that is now |
7415 | obsolete. | 7428 | obsolete. |
7416 | .It Fl outform Ar DER | NET | PEM | ||
7417 | This specifies the output format; the options have the same meaning as the | ||
7418 | .Fl inform | ||
7419 | option. | ||
7420 | .It Fl in Ar file | ||
7421 | This specifies the input | ||
7422 | .Ar file | ||
7423 | to read a certificate from, or standard input if this option is not specified. | ||
7424 | .It Fl out Ar file | ||
7425 | This specifies the output | ||
7426 | .Ar file | ||
7427 | to write to, or standard output by default. | ||
7428 | .It Fl passin Ar arg | ||
7429 | The key password source. | ||
7430 | For more information about the format of | ||
7431 | .Ar arg , | ||
7432 | see the | ||
7433 | .Sx PASS PHRASE ARGUMENTS | ||
7434 | section above. | ||
7435 | .It Fl md2 | md5 | sha1 | 7429 | .It Fl md2 | md5 | sha1 |
7436 | The digest to use. | 7430 | The digest to use. |
7437 | This affects any signing or display option that uses a message digest, | 7431 | This affects any signing or display option that uses a message digest, |
@@ -7443,14 +7437,21 @@ options. | |||
7443 | If not specified, MD5 is used. | 7437 | If not specified, MD5 is used. |
7444 | If the key being used to sign with is a DSA key, | 7438 | If the key being used to sign with is a DSA key, |
7445 | this option has no effect: SHA1 is always used with DSA keys. | 7439 | this option has no effect: SHA1 is always used with DSA keys. |
7446 | .It Fl engine Ar id | 7440 | .It Fl out Ar file |
7447 | Specifying an engine (by it's unique | 7441 | This specifies the output |
7448 | .Ar id | 7442 | .Ar file |
7449 | string) will cause | 7443 | to write to, or standard output by default. |
7450 | .Nm x509 | 7444 | .It Fl outform Ar DER | NET | PEM |
7451 | to attempt to obtain a functional reference to the specified engine, | 7445 | This specifies the output format; the options have the same meaning as the |
7452 | thus initialising it if needed. | 7446 | .Fl inform |
7453 | The engine will then be set as the default for all available algorithms. | 7447 | option. |
7448 | .It Fl passin Ar arg | ||
7449 | The key password source. | ||
7450 | For more information about the format of | ||
7451 | .Ar arg , | ||
7452 | see the | ||
7453 | .Sx PASS PHRASE ARGUMENTS | ||
7454 | section above. | ||
7454 | .El | 7455 | .El |
7455 | .Sh X509 DISPLAY OPTIONS | 7456 | .Sh X509 DISPLAY OPTIONS |
7456 | .Sy Note : | 7457 | .Sy Note : |
@@ -7462,11 +7463,8 @@ options are also display options but are described in the | |||
7462 | .Sx X509 TRUST SETTINGS | 7463 | .Sx X509 TRUST SETTINGS |
7463 | section. | 7464 | section. |
7464 | .Bl -tag -width "XXXX" | 7465 | .Bl -tag -width "XXXX" |
7465 | .It Fl text | 7466 | .It Fl C |
7466 | Prints out the certificate in text form. | 7467 | This outputs the certificate in the form of a C source file. |
7467 | Full details are output including the public key, signature algorithms, | ||
7468 | issuer and subject names, serial number, any extensions present and any | ||
7469 | trust settings. | ||
7470 | .It Fl certopt Ar option | 7468 | .It Fl certopt Ar option |
7471 | Customise the output format used with | 7469 | Customise the output format used with |
7472 | .Fl text . | 7470 | .Fl text . |
@@ -7479,17 +7477,18 @@ switch may also be used more than once to set multiple options. | |||
7479 | See the | 7477 | See the |
7480 | .Sx X509 TEXT OPTIONS | 7478 | .Sx X509 TEXT OPTIONS |
7481 | section for more information. | 7479 | section for more information. |
7482 | .It Fl noout | 7480 | .It Fl dates |
7483 | This option prevents output of the encoded version of the request. | 7481 | Prints out the start and expiry dates of a certificate. |
7484 | .It Fl ocspid | 7482 | .It Fl email |
7485 | Print OCSP hash values for the subject name and public key. | 7483 | Outputs the email address(es), if any. |
7486 | .It Fl modulus | 7484 | .It Fl enddate |
7487 | This option prints out the value of the modulus of the public key | 7485 | Prints out the expiry date of the certificate; that is, the |
7488 | contained in the certificate. | 7486 | .Em notAfter |
7489 | .It Fl pubkey | 7487 | date. |
7490 | Output the public key. | 7488 | .It Fl fingerprint |
7491 | .It Fl serial | 7489 | Prints out the digest of the DER-encoded version of the whole certificate |
7492 | Outputs the certificate serial number. | 7490 | (see |
7491 | .Sx DIGEST OPTIONS ) . | ||
7493 | .It Fl hash | 7492 | .It Fl hash |
7494 | Outputs the | 7493 | Outputs the |
7495 | .Qq hash | 7494 | .Qq hash |
@@ -7498,10 +7497,11 @@ This is used in | |||
7498 | .Nm OpenSSL | 7497 | .Nm OpenSSL |
7499 | to form an index to allow certificates in a directory to be looked up | 7498 | to form an index to allow certificates in a directory to be looked up |
7500 | by subject name. | 7499 | by subject name. |
7501 | .It Fl subject | ||
7502 | Outputs the subject name. | ||
7503 | .It Fl issuer | 7500 | .It Fl issuer |
7504 | Outputs the issuer name. | 7501 | Outputs the issuer name. |
7502 | .It Fl modulus | ||
7503 | This option prints out the value of the modulus of the public key | ||
7504 | contained in the certificate. | ||
7505 | .It Fl nameopt Ar option | 7505 | .It Fl nameopt Ar option |
7506 | Option which determines how the subject or issuer names are displayed. | 7506 | Option which determines how the subject or issuer names are displayed. |
7507 | The | 7507 | The |
@@ -7513,24 +7513,25 @@ switch may be used more than once to set multiple options. | |||
7513 | See the | 7513 | See the |
7514 | .Sx X509 NAME OPTIONS | 7514 | .Sx X509 NAME OPTIONS |
7515 | section for more information. | 7515 | section for more information. |
7516 | .It Fl email | 7516 | .It Fl noout |
7517 | Outputs the email address(es) if any. | 7517 | This option prevents output of the encoded version of the request. |
7518 | .It Fl ocspid | ||
7519 | Print OCSP hash values for the subject name and public key. | ||
7520 | .It Fl pubkey | ||
7521 | Output the public key. | ||
7522 | .It Fl serial | ||
7523 | Outputs the certificate serial number. | ||
7518 | .It Fl startdate | 7524 | .It Fl startdate |
7519 | Prints out the start date of the certificate; that is, the | 7525 | Prints out the start date of the certificate; that is, the |
7520 | .Em notBefore | 7526 | .Em notBefore |
7521 | date. | 7527 | date. |
7522 | .It Fl enddate | 7528 | .It Fl subject |
7523 | Prints out the expiry date of the certificate; that is, the | 7529 | Outputs the subject name. |
7524 | .Em notAfter | 7530 | .It Fl text |
7525 | date. | 7531 | Prints out the certificate in text form. |
7526 | .It Fl dates | 7532 | Full details are output including the public key, signature algorithms, |
7527 | Prints out the start and expiry dates of a certificate. | 7533 | issuer and subject names, serial number, any extensions present, |
7528 | .It Fl fingerprint | 7534 | and any trust settings. |
7529 | Prints out the digest of the DER-encoded version of the whole certificate | ||
7530 | (see | ||
7531 | .Sx DIGEST OPTIONS ) . | ||
7532 | .It Fl C | ||
7533 | This outputs the certificate in the form of a C source file. | ||
7534 | .El | 7535 | .El |
7535 | .Sh X509 TRUST SETTINGS | 7536 | .Sh X509 TRUST SETTINGS |
7536 | Please note these options are currently experimental and may well change. | 7537 | Please note these options are currently experimental and may well change. |
@@ -7562,29 +7563,11 @@ Future versions of | |||
7562 | .Nm OpenSSL | 7563 | .Nm OpenSSL |
7563 | will recognize trust settings on any certificate: not just root CAs. | 7564 | will recognize trust settings on any certificate: not just root CAs. |
7564 | .Bl -tag -width "XXXX" | 7565 | .Bl -tag -width "XXXX" |
7565 | .It Fl trustout | 7566 | .It Fl addreject Ar arg |
7566 | This causes | 7567 | Adds a prohibited use. |
7567 | .Nm x509 | 7568 | It accepts the same values as the |
7568 | to output a | 7569 | .Fl addtrust |
7569 | .Em trusted certificate . | 7570 | option. |
7570 | An ordinary or trusted certificate can be input, but by default an ordinary | ||
7571 | certificate is output and any trust settings are discarded. | ||
7572 | With the | ||
7573 | .Fl trustout | ||
7574 | option a trusted certificate is output. | ||
7575 | A trusted certificate is automatically output if any trust settings | ||
7576 | are modified. | ||
7577 | .It Fl setalias Ar arg | ||
7578 | Sets the alias of the certificate. | ||
7579 | This will allow the certificate to be referred to using a nickname, | ||
7580 | for example | ||
7581 | .Qq Steve's Certificate . | ||
7582 | .It Fl alias | ||
7583 | Outputs the certificate alias, if any. | ||
7584 | .It Fl clrtrust | ||
7585 | Clears all the permitted or trusted uses of the certificate. | ||
7586 | .It Fl clrreject | ||
7587 | Clears all the prohibited or rejected uses of the certificate. | ||
7588 | .It Fl addtrust Ar arg | 7571 | .It Fl addtrust Ar arg |
7589 | Adds a trusted certificate use. | 7572 | Adds a trusted certificate use. |
7590 | Any object name can be used here, but currently only | 7573 | Any object name can be used here, but currently only |
@@ -7599,17 +7582,35 @@ are used. | |||
7599 | Other | 7582 | Other |
7600 | .Nm OpenSSL | 7583 | .Nm OpenSSL |
7601 | applications may define additional uses. | 7584 | applications may define additional uses. |
7602 | .It Fl addreject Ar arg | 7585 | .It Fl alias |
7603 | Adds a prohibited use. | 7586 | Outputs the certificate alias, if any. |
7604 | It accepts the same values as the | 7587 | .It Fl clrreject |
7605 | .Fl addtrust | 7588 | Clears all the prohibited or rejected uses of the certificate. |
7606 | option. | 7589 | .It Fl clrtrust |
7590 | Clears all the permitted or trusted uses of the certificate. | ||
7607 | .It Fl purpose | 7591 | .It Fl purpose |
7608 | This option performs tests on the certificate extensions and outputs | 7592 | This option performs tests on the certificate extensions and outputs |
7609 | the results. | 7593 | the results. |
7610 | For a more complete description, see the | 7594 | For a more complete description, see the |
7611 | .Sx X509 CERTIFICATE EXTENSIONS | 7595 | .Sx X509 CERTIFICATE EXTENSIONS |
7612 | section. | 7596 | section. |
7597 | .It Fl setalias Ar arg | ||
7598 | Sets the alias of the certificate. | ||
7599 | This will allow the certificate to be referred to using a nickname, | ||
7600 | for example | ||
7601 | .Qq Steve's Certificate . | ||
7602 | .It Fl trustout | ||
7603 | This causes | ||
7604 | .Nm x509 | ||
7605 | to output a | ||
7606 | .Em trusted certificate . | ||
7607 | An ordinary or trusted certificate can be input, but by default an ordinary | ||
7608 | certificate is output and any trust settings are discarded. | ||
7609 | With the | ||
7610 | .Fl trustout | ||
7611 | option a trusted certificate is output. | ||
7612 | A trusted certificate is automatically output if any trust settings | ||
7613 | are modified. | ||
7613 | .El | 7614 | .El |
7614 | .Sh X509 SIGNING OPTIONS | 7615 | .Sh X509 SIGNING OPTIONS |
7615 | The | 7616 | The |
@@ -7618,76 +7619,6 @@ utility can be used to sign certificates and requests: it | |||
7618 | can thus behave like a | 7619 | can thus behave like a |
7619 | .Qq mini CA . | 7620 | .Qq mini CA . |
7620 | .Bl -tag -width "XXXX" | 7621 | .Bl -tag -width "XXXX" |
7621 | .It Fl signkey Ar file | ||
7622 | This option causes the input file to be self-signed using the supplied | ||
7623 | private key. | ||
7624 | .Pp | ||
7625 | If the input file is a certificate, it sets the issuer name to the | ||
7626 | subject name | ||
7627 | .Pq i.e. makes it self-signed , | ||
7628 | changes the public key to the supplied value | ||
7629 | and changes the start and end dates. | ||
7630 | The start date is set to the current time and the end date is set to | ||
7631 | a value determined by the | ||
7632 | .Fl days | ||
7633 | option. | ||
7634 | Any certificate extensions are retained unless the | ||
7635 | .Fl clrext | ||
7636 | option is supplied. | ||
7637 | .Pp | ||
7638 | If the input is a certificate request, a self-signed certificate | ||
7639 | is created using the supplied private key using the subject name in | ||
7640 | the request. | ||
7641 | .It Fl clrext | ||
7642 | Delete any extensions from a certificate. | ||
7643 | This option is used when a certificate is being created from another | ||
7644 | certificate (for example with the | ||
7645 | .Fl signkey | ||
7646 | or the | ||
7647 | .Fl CA | ||
7648 | options). | ||
7649 | Normally, all extensions are retained. | ||
7650 | .It Fl keyform Ar DER | PEM | ||
7651 | Specifies the format | ||
7652 | .Pq DER or PEM | ||
7653 | of the private key file used in the | ||
7654 | .Fl signkey | ||
7655 | option. | ||
7656 | .It Fl days Ar arg | ||
7657 | Specifies the number of days to make a certificate valid for. | ||
7658 | The default is 30 days. | ||
7659 | .It Fl checkend Ar arg | ||
7660 | Check whether the certificate expires in the next | ||
7661 | .Ar arg | ||
7662 | seconds. | ||
7663 | If so, exit with return value 1; | ||
7664 | otherwise exit with return value 0. | ||
7665 | .It Fl x509toreq | ||
7666 | Converts a certificate into a certificate request. | ||
7667 | The | ||
7668 | .Fl signkey | ||
7669 | option is used to pass the required private key. | ||
7670 | .It Fl req | ||
7671 | By default, a certificate is expected on input. | ||
7672 | With this option a certificate request is expected instead. | ||
7673 | .It Fl set_serial Ar n | ||
7674 | Specifies the serial number to use. | ||
7675 | This option can be used with either the | ||
7676 | .Fl signkey | ||
7677 | or | ||
7678 | .Fl CA | ||
7679 | options. | ||
7680 | If used in conjunction with the | ||
7681 | .Fl CA | ||
7682 | option, the serial number file (as specified by the | ||
7683 | .Fl CAserial | ||
7684 | or | ||
7685 | .Fl CAcreateserial | ||
7686 | options) is not used. | ||
7687 | .Pp | ||
7688 | The serial number can be decimal or hex (if preceded by | ||
7689 | .Sq 0x ) . | ||
7690 | Negative serial numbers can also be specified but their use is not recommended. | ||
7691 | .It Fl CA Ar file | 7622 | .It Fl CA Ar file |
7692 | Specifies the CA certificate to be used for signing. | 7623 | Specifies the CA certificate to be used for signing. |
7693 | When this option is present, | 7624 | When this option is present, |
@@ -7704,18 +7635,36 @@ option. | |||
7704 | Without the | 7635 | Without the |
7705 | .Fl req | 7636 | .Fl req |
7706 | option, the input is a certificate which must be self-signed. | 7637 | option, the input is a certificate which must be self-signed. |
7638 | .It Fl CAcreateserial | ||
7639 | With this option the CA serial number file is created if it does not exist: | ||
7640 | it will contain the serial number | ||
7641 | .Sq 02 | ||
7642 | and the certificate being signed will have | ||
7643 | .Sq 1 | ||
7644 | as its serial number. | ||
7645 | Normally, if the | ||
7646 | .Fl CA | ||
7647 | option is specified and the serial number file does not exist, it is an error. | ||
7648 | .It Fl CAform Ar DER | PEM | ||
7649 | The format of the CA certificate file. | ||
7650 | The default is | ||
7651 | .Ar PEM . | ||
7707 | .It Fl CAkey Ar file | 7652 | .It Fl CAkey Ar file |
7708 | Sets the CA private key to sign a certificate with. | 7653 | Sets the CA private key to sign a certificate with. |
7709 | If this option is not specified, it is assumed that the CA private key | 7654 | If this option is not specified, it is assumed that the CA private key |
7710 | is present in the CA certificate file. | 7655 | is present in the CA certificate file. |
7656 | .It Fl CAkeyform Ar DER | PEM | ||
7657 | The format of the CA private key. | ||
7658 | The default is | ||
7659 | .Ar PEM . | ||
7711 | .It Fl CAserial Ar file | 7660 | .It Fl CAserial Ar file |
7712 | Sets the CA serial number file to use. | 7661 | Sets the CA serial number file to use. |
7713 | .Pp | 7662 | .Pp |
7714 | When the | 7663 | When the |
7715 | .Fl CA | 7664 | .Fl CA |
7716 | option is used to sign a certificate it uses a serial | 7665 | option is used to sign a certificate, |
7717 | number specified in a file. | 7666 | it uses a serial number specified in a file. |
7718 | This file consist of one line containing an even number of hex digits | 7667 | This file consists of one line containing an even number of hex digits |
7719 | with the serial number to use. | 7668 | with the serial number to use. |
7720 | After each use the serial number is incremented and written out | 7669 | After each use the serial number is incremented and written out |
7721 | to the file again. | 7670 | to the file again. |
@@ -7727,19 +7676,24 @@ For example, if the CA certificate file is called | |||
7727 | .Pa mycacert.pem , | 7676 | .Pa mycacert.pem , |
7728 | it expects to find a serial number file called | 7677 | it expects to find a serial number file called |
7729 | .Pa mycacert.srl . | 7678 | .Pa mycacert.srl . |
7730 | .It Fl CAcreateserial | 7679 | .It Fl checkend Ar arg |
7731 | With this option the CA serial number file is created if it does not exist: | 7680 | Check whether the certificate expires in the next |
7732 | it will contain the serial number | 7681 | .Ar arg |
7733 | .Sq 02 | 7682 | seconds. |
7734 | and the certificate being signed will have | 7683 | If so, exit with return value 1; |
7735 | .Sq 1 | 7684 | otherwise exit with return value 0. |
7736 | as its serial number. | 7685 | .It Fl clrext |
7737 | Normally, if the | 7686 | Delete any extensions from a certificate. |
7687 | This option is used when a certificate is being created from another | ||
7688 | certificate (for example with the | ||
7689 | .Fl signkey | ||
7690 | or the | ||
7738 | .Fl CA | 7691 | .Fl CA |
7739 | option is specified and the serial number file does not exist, it is an error. | 7692 | options). |
7740 | .It Fl extfile Ar file | 7693 | Normally, all extensions are retained. |
7741 | File containing certificate extensions to use. | 7694 | .It Fl days Ar arg |
7742 | If not specified, no extensions are added to the certificate. | 7695 | Specifies the number of days to make a certificate valid for. |
7696 | The default is 30 days. | ||
7743 | .It Fl extensions Ar section | 7697 | .It Fl extensions Ar section |
7744 | The section to add certificate extensions from. | 7698 | The section to add certificate extensions from. |
7745 | If this option is not specified, the extensions should either be | 7699 | If this option is not specified, the extensions should either be |
@@ -7748,6 +7702,61 @@ contained in the unnamed | |||
7748 | section or the default section should contain a variable called | 7702 | section or the default section should contain a variable called |
7749 | .Qq extensions | 7703 | .Qq extensions |
7750 | which contains the section to use. | 7704 | which contains the section to use. |
7705 | .It Fl extfile Ar file | ||
7706 | File containing certificate extensions to use. | ||
7707 | If not specified, no extensions are added to the certificate. | ||
7708 | .It Fl keyform Ar DER | PEM | ||
7709 | Specifies the format | ||
7710 | .Pq DER or PEM | ||
7711 | of the private key file used in the | ||
7712 | .Fl signkey | ||
7713 | option. | ||
7714 | .It Fl req | ||
7715 | By default, a certificate is expected on input. | ||
7716 | With this option a certificate request is expected instead. | ||
7717 | .It Fl set_serial Ar n | ||
7718 | Specifies the serial number to use. | ||
7719 | This option can be used with either the | ||
7720 | .Fl signkey | ||
7721 | or | ||
7722 | .Fl CA | ||
7723 | options. | ||
7724 | If used in conjunction with the | ||
7725 | .Fl CA | ||
7726 | option, the serial number file (as specified by the | ||
7727 | .Fl CAserial | ||
7728 | or | ||
7729 | .Fl CAcreateserial | ||
7730 | options) is not used. | ||
7731 | .Pp | ||
7732 | The serial number can be decimal or hex (if preceded by | ||
7733 | .Sq 0x ) . | ||
7734 | Negative serial numbers can also be specified but their use is not recommended. | ||
7735 | .It Fl signkey Ar file | ||
7736 | This option causes the input file to be self-signed using the supplied | ||
7737 | private key. | ||
7738 | .Pp | ||
7739 | If the input file is a certificate, it sets the issuer name to the | ||
7740 | subject name | ||
7741 | .Pq i.e. makes it self-signed , | ||
7742 | changes the public key to the supplied value, | ||
7743 | and changes the start and end dates. | ||
7744 | The start date is set to the current time and the end date is set to | ||
7745 | a value determined by the | ||
7746 | .Fl days | ||
7747 | option. | ||
7748 | Any certificate extensions are retained unless the | ||
7749 | .Fl clrext | ||
7750 | option is supplied. | ||
7751 | .Pp | ||
7752 | If the input is a certificate request, a self-signed certificate | ||
7753 | is created using the supplied private key using the subject name in | ||
7754 | the request. | ||
7755 | .It Fl x509toreq | ||
7756 | Converts a certificate into a certificate request. | ||
7757 | The | ||
7758 | .Fl signkey | ||
7759 | option is used to pass the required private key. | ||
7751 | .El | 7760 | .El |
7752 | .Sh X509 NAME OPTIONS | 7761 | .Sh X509 NAME OPTIONS |
7753 | The | 7762 | The |
@@ -7763,32 +7772,44 @@ format is used which is compatible with previous versions of | |||
7763 | Each option is described in detail below; all options can be preceded by a | 7772 | Each option is described in detail below; all options can be preceded by a |
7764 | .Sq - | 7773 | .Sq - |
7765 | to turn the option off. | 7774 | to turn the option off. |
7766 | Only the first four will normally be used. | 7775 | Only |
7776 | .Ar compat , | ||
7777 | .Ar RFC2253 , | ||
7778 | .Ar oneline , | ||
7779 | and | ||
7780 | .Ar multiline | ||
7781 | will normally be used. | ||
7767 | .Bl -tag -width "XXXX" | 7782 | .Bl -tag -width "XXXX" |
7783 | .It Ar align | ||
7784 | Align field values for a more readable output. | ||
7785 | Only usable with | ||
7786 | .Ar sep_multiline . | ||
7768 | .It Ar compat | 7787 | .It Ar compat |
7769 | Use the old format. | 7788 | Use the old format. |
7770 | This is equivalent to specifying no name options at all. | 7789 | This is equivalent to specifying no name options at all. |
7771 | .It Ar RFC2253 | 7790 | .It Ar dn_rev |
7772 | Displays names compatible with RFC 2253; equivalent to | 7791 | Reverse the fields of the DN. |
7773 | .Ar esc_2253 , esc_ctrl , | 7792 | This is required by RFC 2253. |
7774 | .Ar esc_msb , utf8 , dump_nostr , dump_unknown , | 7793 | As a side effect, this also reverses the order of multiple AVAs but this is |
7775 | .Ar dump_der , sep_comma_plus , dn_rev and sname . | 7794 | permissible. |
7776 | .It Ar oneline | 7795 | .It Ar dump_all |
7777 | A oneline format which is more readable than RFC2253. | 7796 | Dump all fields. |
7778 | It is equivalent to specifying the | 7797 | This option, when used with |
7779 | .Ar esc_2253 , esc_ctrl , esc_msb , utf8 , | 7798 | .Ar dump_der , |
7780 | .Ar dump_nostr , dump_der , use_quote , sep_comma_plus_spc , | 7799 | allows the DER encoding of the structure to be unambiguously determined. |
7781 | .Ar spc_eq | 7800 | .It Ar dump_der |
7782 | and | 7801 | When this option is set, any fields that need to be hexdumped will |
7783 | .Ar sname | 7802 | be dumped using the DER encoding of the field. |
7784 | options. | 7803 | Otherwise just the content octets will be displayed. |
7785 | .It Ar multiline | 7804 | Both options use the RFC 2253 #XXXX... format. |
7786 | A multiline format. | 7805 | .It Ar dump_nostr |
7787 | It is equivalent to | 7806 | Dump non-character string types |
7788 | .Ar esc_ctrl , esc_msb , sep_multiline , | 7807 | .Pq for example OCTET STRING ; |
7789 | .Ar spc_eq , lname | 7808 | if this option is not set, non-character string types will be displayed |
7790 | and | 7809 | as though each content octet represents a single character. |
7791 | .Ar align . | 7810 | .It Ar dump_unknown |
7811 | Dump any field whose OID is not recognised by | ||
7812 | .Nm OpenSSL . | ||
7792 | .It Ar esc_2253 | 7813 | .It Ar esc_2253 |
7793 | Escape the | 7814 | Escape the |
7794 | .Qq special | 7815 | .Qq special |
@@ -7810,29 +7831,13 @@ digits representing the character value). | |||
7810 | .It Ar esc_msb | 7831 | .It Ar esc_msb |
7811 | Escape characters with the MSB set; that is, with ASCII values larger than | 7832 | Escape characters with the MSB set; that is, with ASCII values larger than |
7812 | 127. | 7833 | 127. |
7813 | .It Ar use_quote | 7834 | .It Ar multiline |
7814 | Escapes some characters by surrounding the whole string with | 7835 | A multiline format. |
7815 | .Sq \&" | 7836 | It is equivalent to |
7816 | characters. | 7837 | .Ar esc_ctrl , esc_msb , sep_multiline , |
7817 | Without the option, all escaping is done with the | 7838 | .Ar spc_eq , lname , |
7818 | .Sq \e | 7839 | and |
7819 | character. | 7840 | .Ar align . |
7820 | .It Ar utf8 | ||
7821 | Convert all strings to UTF8 format first. | ||
7822 | This is required by RFC 2253. | ||
7823 | If you are lucky enough to have a UTF8 compatible terminal, | ||
7824 | the use of this option (and | ||
7825 | .Em not | ||
7826 | setting | ||
7827 | .Ar esc_msb ) | ||
7828 | may result in the correct display of multibyte | ||
7829 | .Pq international | ||
7830 | characters. | ||
7831 | If this option is not present, multibyte characters larger than 0xff | ||
7832 | will be represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX | ||
7833 | for 32 bits. | ||
7834 | Also, if this option is off, any UTF8Strings will be converted to their | ||
7835 | character form first. | ||
7836 | .It Ar no_type | 7841 | .It Ar no_type |
7837 | This option does not attempt to interpret multibyte characters in any | 7842 | This option does not attempt to interpret multibyte characters in any |
7838 | way. | 7843 | way. |
@@ -7840,47 +7845,6 @@ That is, their content octets are merely dumped as though one octet | |||
7840 | represents each character. | 7845 | represents each character. |
7841 | This is useful for diagnostic purposes but will result in rather odd | 7846 | This is useful for diagnostic purposes but will result in rather odd |
7842 | looking output. | 7847 | looking output. |
7843 | .It Ar show_type | ||
7844 | Show the type of the ASN1 character string. | ||
7845 | The type precedes the field contents. | ||
7846 | For example | ||
7847 | .Qq BMPSTRING: Hello World . | ||
7848 | .It Ar dump_der | ||
7849 | When this option is set, any fields that need to be hexdumped will | ||
7850 | be dumped using the DER encoding of the field. | ||
7851 | Otherwise just the content octets will be displayed. | ||
7852 | Both options use the RFC 2253 #XXXX... format. | ||
7853 | .It Ar dump_nostr | ||
7854 | Dump non-character string types | ||
7855 | .Pq for example OCTET STRING ; | ||
7856 | if this option is not set, non-character string types will be displayed | ||
7857 | as though each content octet represents a single character. | ||
7858 | .It Ar dump_all | ||
7859 | Dump all fields. | ||
7860 | This option, when used with | ||
7861 | .Ar dump_der , | ||
7862 | allows the DER encoding of the structure to be unambiguously determined. | ||
7863 | .It Ar dump_unknown | ||
7864 | Dump any field whose OID is not recognised by | ||
7865 | .Nm OpenSSL . | ||
7866 | .It Ar sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline | ||
7867 | These options determine the field separators. | ||
7868 | The first character is between RDNs and the second between multiple AVAs | ||
7869 | (multiple AVAs are very rare and their use is discouraged). | ||
7870 | The options ending in | ||
7871 | .Qq space | ||
7872 | additionally place a space after the separator to make it more readable. | ||
7873 | The | ||
7874 | .Ar sep_multiline | ||
7875 | uses a linefeed character for the RDN separator and a spaced | ||
7876 | .Sq + | ||
7877 | for the AVA separator. | ||
7878 | It also indents the fields by four characters. | ||
7879 | .It Ar dn_rev | ||
7880 | Reverse the fields of the DN. | ||
7881 | This is required by RFC 2253. | ||
7882 | As a side effect, this also reverses the order of multiple AVAs but this is | ||
7883 | permissible. | ||
7884 | .It Ar nofname , sname , lname , oid | 7848 | .It Ar nofname , sname , lname , oid |
7885 | These options alter how the field name is displayed. | 7849 | These options alter how the field name is displayed. |
7886 | .Ar nofname | 7850 | .Ar nofname |
@@ -7895,14 +7859,68 @@ for example). | |||
7895 | uses the long form. | 7859 | uses the long form. |
7896 | .Ar oid | 7860 | .Ar oid |
7897 | represents the OID in numerical form and is useful for diagnostic purpose. | 7861 | represents the OID in numerical form and is useful for diagnostic purpose. |
7898 | .It Ar align | 7862 | .It Ar oneline |
7899 | Align field values for a more readable output. | 7863 | A oneline format which is more readable than |
7900 | Only usable with | 7864 | .Ar RFC2253 . |
7901 | .Ar sep_multiline . | 7865 | It is equivalent to specifying the |
7866 | .Ar esc_2253 , esc_ctrl , esc_msb , utf8 , | ||
7867 | .Ar dump_nostr , dump_der , use_quote , sep_comma_plus_spc , | ||
7868 | .Ar spc_eq , | ||
7869 | and | ||
7870 | .Ar sname | ||
7871 | options. | ||
7872 | .It Ar RFC2253 | ||
7873 | Displays names compatible with RFC 2253; equivalent to | ||
7874 | .Ar esc_2253 , esc_ctrl , | ||
7875 | .Ar esc_msb , utf8 , dump_nostr , dump_unknown , | ||
7876 | .Ar dump_der , sep_comma_plus , dn_rev , | ||
7877 | and | ||
7878 | .Ar sname . | ||
7879 | .It Ar sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline | ||
7880 | These options determine the field separators. | ||
7881 | The first character is between RDNs and the second between multiple AVAs | ||
7882 | (multiple AVAs are very rare and their use is discouraged). | ||
7883 | The options ending in | ||
7884 | .Qq space | ||
7885 | additionally place a space after the separator to make it more readable. | ||
7886 | The | ||
7887 | .Ar sep_multiline | ||
7888 | uses a linefeed character for the RDN separator and a spaced | ||
7889 | .Sq + | ||
7890 | for the AVA separator. | ||
7891 | It also indents the fields by four characters. | ||
7892 | .It Ar show_type | ||
7893 | Show the type of the ASN1 character string. | ||
7894 | The type precedes the field contents. | ||
7895 | For example | ||
7896 | .Qq BMPSTRING: Hello World . | ||
7902 | .It Ar spc_eq | 7897 | .It Ar spc_eq |
7903 | Places spaces round the | 7898 | Places spaces round the |
7904 | .Sq = | 7899 | .Sq = |
7905 | character which follows the field name. | 7900 | character which follows the field name. |
7901 | .It Ar use_quote | ||
7902 | Escapes some characters by surrounding the whole string with | ||
7903 | .Sq \&" | ||
7904 | characters. | ||
7905 | Without the option, all escaping is done with the | ||
7906 | .Sq \e | ||
7907 | character. | ||
7908 | .It Ar utf8 | ||
7909 | Convert all strings to UTF8 format first. | ||
7910 | This is required by RFC 2253. | ||
7911 | If you are lucky enough to have a UTF8 compatible terminal, | ||
7912 | the use of this option (and | ||
7913 | .Em not | ||
7914 | setting | ||
7915 | .Ar esc_msb ) | ||
7916 | may result in the correct display of multibyte | ||
7917 | .Pq international | ||
7918 | characters. | ||
7919 | If this option is not present, multibyte characters larger than 0xff | ||
7920 | will be represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX | ||
7921 | for 32 bits. | ||
7922 | Also, if this option is off, any UTF8Strings will be converted to their | ||
7923 | character form first. | ||
7906 | .El | 7924 | .El |
7907 | .Sh X509 TEXT OPTIONS | 7925 | .Sh X509 TEXT OPTIONS |
7908 | As well as customising the name output format, it is also possible to | 7926 | As well as customising the name output format, it is also possible to |
@@ -7913,62 +7931,57 @@ options when the | |||
7913 | option is present. | 7931 | option is present. |
7914 | The default behaviour is to print all fields. | 7932 | The default behaviour is to print all fields. |
7915 | .Bl -tag -width "XXXX" | 7933 | .Bl -tag -width "XXXX" |
7934 | .It Ar ca_default | ||
7935 | The value used by the | ||
7936 | .Nm ca | ||
7937 | utility; equivalent to | ||
7938 | .Ar no_issuer , no_pubkey , no_header , | ||
7939 | .Ar no_version , no_sigdump , | ||
7940 | and | ||
7941 | .Ar no_signame . | ||
7916 | .It Ar compatible | 7942 | .It Ar compatible |
7917 | Use the old format. | 7943 | Use the old format. |
7918 | This is equivalent to specifying no output options at all. | 7944 | This is equivalent to specifying no output options at all. |
7945 | .It Ar ext_default | ||
7946 | Retain default extension behaviour: attempt to print out unsupported | ||
7947 | certificate extensions. | ||
7948 | .It Ar ext_dump | ||
7949 | Hex dump unsupported extensions. | ||
7950 | .It Ar ext_error | ||
7951 | Print an error message for unsupported certificate extensions. | ||
7952 | .It Ar ext_parse | ||
7953 | ASN1 parse unsupported extensions. | ||
7954 | .It Ar no_aux | ||
7955 | Don't print out certificate trust information. | ||
7956 | .It Ar no_extensions | ||
7957 | Don't print out any X509V3 extensions. | ||
7919 | .It Ar no_header | 7958 | .It Ar no_header |
7920 | Don't print header information: that is, the lines saying | 7959 | Don't print header information: that is, the lines saying |
7921 | .Qq Certificate | 7960 | .Qq Certificate |
7922 | and | 7961 | and |
7923 | .Qq Data . | 7962 | .Qq Data . |
7924 | .It Ar no_version | 7963 | .It Ar no_issuer |
7925 | Don't print out the version number. | 7964 | Don't print out the issuer name. |
7965 | .It Ar no_pubkey | ||
7966 | Don't print out the public key. | ||
7926 | .It Ar no_serial | 7967 | .It Ar no_serial |
7927 | Don't print out the serial number. | 7968 | Don't print out the serial number. |
7969 | .It Ar no_sigdump | ||
7970 | Don't give a hexadecimal dump of the certificate signature. | ||
7928 | .It Ar no_signame | 7971 | .It Ar no_signame |
7929 | Don't print out the signature algorithm used. | 7972 | Don't print out the signature algorithm used. |
7973 | .It Ar no_subject | ||
7974 | Don't print out the subject name. | ||
7930 | .It Ar no_validity | 7975 | .It Ar no_validity |
7931 | Don't print the validity; that is, the | 7976 | Don't print the validity; that is, the |
7932 | .Em notBefore | 7977 | .Em notBefore |
7933 | and | 7978 | and |
7934 | .Em notAfter | 7979 | .Em notAfter |
7935 | fields. | 7980 | fields. |
7936 | .It Ar no_subject | 7981 | .It Ar no_version |
7937 | Don't print out the subject name. | 7982 | Don't print out the version number. |
7938 | .It Ar no_issuer | ||
7939 | Don't print out the issuer name. | ||
7940 | .It Ar no_pubkey | ||
7941 | Don't print out the public key. | ||
7942 | .It Ar no_sigdump | ||
7943 | Don't give a hexadecimal dump of the certificate signature. | ||
7944 | .It Ar no_aux | ||
7945 | Don't print out certificate trust information. | ||
7946 | .It Ar no_extensions | ||
7947 | Don't print out any X509V3 extensions. | ||
7948 | .It Ar ext_default | ||
7949 | Retain default extension behaviour: attempt to print out unsupported | ||
7950 | certificate extensions. | ||
7951 | .It Ar ext_error | ||
7952 | Print an error message for unsupported certificate extensions. | ||
7953 | .It Ar ext_parse | ||
7954 | ASN1 parse unsupported extensions. | ||
7955 | .It Ar ext_dump | ||
7956 | Hex dump unsupported extensions. | ||
7957 | .It Ar ca_default | ||
7958 | The value used by the | ||
7959 | .Nm ca | ||
7960 | utility, equivalent to | ||
7961 | .Ar no_issuer , no_pubkey , no_header , | ||
7962 | .Ar no_version , no_sigdump | ||
7963 | and | ||
7964 | .Ar no_signame . | ||
7965 | .El | 7983 | .El |
7966 | .Sh X509 EXAMPLES | 7984 | .Sh X509 EXAMPLES |
7967 | .Sy Note : | ||
7968 | In these examples the | ||
7969 | .Sq \e | ||
7970 | means the example should be all on one line. | ||
7971 | .Pp | ||
7972 | Display the contents of a certificate: | 7985 | Display the contents of a certificate: |
7973 | .Pp | 7986 | .Pp |
7974 | .Dl $ openssl x509 -in cert.pem -noout -text | 7987 | .Dl $ openssl x509 -in cert.pem -noout -text |
@@ -7989,7 +8002,7 @@ Display the certificate subject name in oneline form on a terminal | |||
7989 | supporting UTF8: | 8002 | supporting UTF8: |
7990 | .Bd -literal -offset indent | 8003 | .Bd -literal -offset indent |
7991 | $ openssl x509 -in cert.pem -noout -subject \e | 8004 | $ openssl x509 -in cert.pem -noout -subject \e |
7992 | -nameopt oneline,-escmsb | 8005 | -nameopt oneline,esc_msb |
7993 | .Ed | 8006 | .Ed |
7994 | .Pp | 8007 | .Pp |
7995 | Display the certificate MD5 fingerprint: | 8008 | Display the certificate MD5 fingerprint: |