diff options
| author | jmc <> | 2016-07-19 20:02:47 +0000 |
|---|---|---|
| committer | jmc <> | 2016-07-19 20:02:47 +0000 |
| commit | 22a0d2d2ad39139f6c9af0cb94bc5d1db7d03dbc (patch) | |
| tree | 026963390ae00ff2682fa1cf5c239508be5148ec /src | |
| parent | c7c0c4b1ecb389c009d446c6c9253677915896dc (diff) | |
| download | openbsd-22a0d2d2ad39139f6c9af0cb94bc5d1db7d03dbc.tar.gz openbsd-22a0d2d2ad39139f6c9af0cb94bc5d1db7d03dbc.tar.bz2 openbsd-22a0d2d2ad39139f6c9af0cb94bc5d1db7d03dbc.zip | |
strip back openssl ca: in particular remove some excessively wordy sections,
move some other sections into more relevant places, and remove the example
ca file;
Diffstat (limited to '')
| -rw-r--r-- | src/usr.bin/openssl/openssl.1 | 457 |
1 files changed, 120 insertions, 337 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1 index 08769c56e4..184da99a49 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.34 2016/07/17 16:33:17 jmc Exp $ | 1 | .\" $OpenBSD: openssl.1,v 1.35 2016/07/19 20:02:47 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: July 17 2016 $ | 115 | .Dd $Mdocdate: July 19 2016 $ |
| 116 | .Dt OPENSSL 1 | 116 | .Dt OPENSSL 1 |
| 117 | .Os | 117 | .Os |
| 118 | .Sh NAME | 118 | .Sh NAME |
| @@ -309,13 +309,9 @@ This option can be used multiple times to | |||
| 309 | .Qq drill down | 309 | .Qq drill down |
| 310 | into a nested structure. | 310 | into a nested structure. |
| 311 | .El | 311 | .El |
| 312 | .\" | ||
| 313 | .\" CA | ||
| 314 | .\" | ||
| 315 | .Sh CA | 312 | .Sh CA |
| 316 | .nr nS 1 | 313 | .nr nS 1 |
| 317 | .Nm "openssl ca" | 314 | .Nm "openssl ca" |
| 318 | .Bk -words | ||
| 319 | .Op Fl batch | 315 | .Op Fl batch |
| 320 | .Op Fl cert Ar file | 316 | .Op Fl cert Ar file |
| 321 | .Op Fl config Ar file | 317 | .Op Fl config Ar file |
| @@ -354,18 +350,16 @@ into a nested structure. | |||
| 354 | .Op Fl subj Ar arg | 350 | .Op Fl subj Ar arg |
| 355 | .Op Fl updatedb | 351 | .Op Fl updatedb |
| 356 | .Op Fl verbose | 352 | .Op Fl verbose |
| 357 | .Ek | ||
| 358 | .nr nS 0 | 353 | .nr nS 0 |
| 359 | .Pp | 354 | .Pp |
| 360 | The | 355 | The |
| 361 | .Nm ca | 356 | .Nm ca |
| 362 | command is a minimal CA application. | 357 | command is a minimal certificate authority (CA) application. |
| 363 | It can be used to sign certificate requests in a variety of forms | 358 | It can be used to sign certificate requests in a variety of forms |
| 364 | and generate CRLs. | 359 | and generate certificate revocation lists (CRLs). |
| 365 | It also maintains a text database of issued certificates and their status. | 360 | It also maintains a text database of issued certificates and their status. |
| 366 | .Pp | 361 | .Pp |
| 367 | The options descriptions will be divided into each purpose. | 362 | The options relevant to CAs are as follows: |
| 368 | .Sh CA OPTIONS | ||
| 369 | .Bl -tag -width "XXXX" | 363 | .Bl -tag -width "XXXX" |
| 370 | .It Fl batch | 364 | .It Fl batch |
| 371 | This sets the batch mode. | 365 | This sets the batch mode. |
| @@ -384,7 +378,7 @@ The format of the date is YYMMDDHHMMSSZ | |||
| 384 | .It Fl extensions Ar section | 378 | .It Fl extensions Ar section |
| 385 | The section of the configuration file containing certificate extensions | 379 | The section of the configuration file containing certificate extensions |
| 386 | to be added when a certificate is issued (defaults to | 380 | to be added when a certificate is issued (defaults to |
| 387 | .Em x509_extensions | 381 | .Cm x509_extensions |
| 388 | unless the | 382 | unless the |
| 389 | .Fl extfile | 383 | .Fl extfile |
| 390 | option is used). | 384 | option is used). |
| @@ -408,12 +402,8 @@ If present, this should be the last option; all subsequent arguments | |||
| 408 | are assumed to be the names of files containing certificate requests. | 402 | are assumed to be the names of files containing certificate requests. |
| 409 | .It Fl key Ar keyfile | 403 | .It Fl key Ar keyfile |
| 410 | The password used to encrypt the private key. | 404 | The password used to encrypt the private key. |
| 411 | Since on some systems the command line arguments are visible | 405 | Since on some systems the command line arguments are visible, |
| 412 | (e.g.\& | 406 | this option should be used with caution. |
| 413 | .Ux | ||
| 414 | with the | ||
| 415 | .Xr ps 1 | ||
| 416 | utility) this option should be used with caution. | ||
| 417 | .It Fl keyfile Ar file | 407 | .It Fl keyfile Ar file |
| 418 | The private key to sign requests with. | 408 | The private key to sign requests with. |
| 419 | .It Fl keyform Ar PEM | 409 | .It Fl keyform Ar PEM |
| @@ -448,7 +438,7 @@ section). | |||
| 448 | The DN of a certificate can contain the EMAIL field if present in the | 438 | The DN of a certificate can contain the EMAIL field if present in the |
| 449 | request DN, however it is good policy just having the email set into | 439 | request DN, however it is good policy just having the email set into |
| 450 | the | 440 | the |
| 451 | .Em altName | 441 | .Cm altName |
| 452 | extension of the certificate. | 442 | extension of the certificate. |
| 453 | When this option is set, the EMAIL field is removed from the certificate's | 443 | When this option is set, the EMAIL field is removed from the certificate's |
| 454 | subject and set only in the, eventually present, extensions. | 444 | subject and set only in the, eventually present, extensions. |
| @@ -475,11 +465,20 @@ The key password source. | |||
| 475 | This option defines the CA | 465 | This option defines the CA |
| 476 | .Qq policy | 466 | .Qq policy |
| 477 | to use. | 467 | to use. |
| 478 | This is a section in the configuration file which decides which fields | 468 | The policy section in the configuration file |
| 479 | should be mandatory or match the CA certificate. | 469 | consists of a set of variables corresponding to certificate DN fields. |
| 480 | Check out the | 470 | The values may be one of |
| 481 | .Sx CA POLICY FORMAT | 471 | .Qq match |
| 482 | section for more information. | 472 | (the value must match the same field in the CA certificate), |
| 473 | .Qq supplied | ||
| 474 | (the value must be present), or | ||
| 475 | .Qq optional | ||
| 476 | (the value may be present). | ||
| 477 | Any fields not mentioned in the policy section | ||
| 478 | are silently deleted, unless the | ||
| 479 | .Fl preserveDN | ||
| 480 | option is set, | ||
| 481 | but this can be regarded more of a quirk than intended behaviour. | ||
| 483 | .It Fl preserveDN | 482 | .It Fl preserveDN |
| 484 | Normally, the DN order of a certificate is the same as the order of the | 483 | Normally, the DN order of a certificate is the same as the order of the |
| 485 | fields in the relevant policy section. | 484 | fields in the relevant policy section. |
| @@ -491,9 +490,17 @@ This is not needed for Xenroll. | |||
| 491 | .It Fl spkac Ar file | 490 | .It Fl spkac Ar file |
| 492 | A file containing a single Netscape signed public key and challenge, | 491 | A file containing a single Netscape signed public key and challenge, |
| 493 | and additional field values to be signed by the CA. | 492 | and additional field values to be signed by the CA. |
| 494 | See the | 493 | This will usually come from the |
| 495 | .Sx SPKAC FORMAT | 494 | KEYGEN tag in an HTML form to create a new private key. |
| 496 | section for information on the required format. | 495 | It is, however, possible to create SPKACs using the |
| 496 | .Nm spkac | ||
| 497 | utility. | ||
| 498 | .Pp | ||
| 499 | The file should contain the variable SPKAC set to the value of | ||
| 500 | the SPKAC and also the required DN components as name value pairs. | ||
| 501 | If it's necessary to include the same component twice, | ||
| 502 | then it can be preceded by a number and a | ||
| 503 | .Sq \&. . | ||
| 497 | .It Fl ss_cert Ar file | 504 | .It Fl ss_cert Ar file |
| 498 | A single self-signed certificate to be signed by the CA. | 505 | A single self-signed certificate to be signed by the CA. |
| 499 | .It Fl startdate Ar date | 506 | .It Fl startdate Ar date |
| @@ -501,14 +508,15 @@ This allows the start date to be explicitly set. | |||
| 501 | The format of the date is YYMMDDHHMMSSZ | 508 | The format of the date is YYMMDDHHMMSSZ |
| 502 | .Pq the same as an ASN1 UTCTime structure . | 509 | .Pq the same as an ASN1 UTCTime structure . |
| 503 | .It Fl status Ar serial | 510 | .It Fl status Ar serial |
| 504 | Show status of certificate with serial number | 511 | Show the status of the certificate with serial number |
| 505 | .Ar serial . | 512 | .Ar serial . |
| 506 | .It Fl updatedb | 513 | .It Fl updatedb |
| 507 | Update database for expired certificates. | 514 | Update database for expired certificates. |
| 508 | .It Fl verbose | 515 | .It Fl verbose |
| 509 | This prints extra details about the operations being performed. | 516 | This prints extra details about the operations being performed. |
| 510 | .El | 517 | .El |
| 511 | .Sh CRL OPTIONS | 518 | .Pp |
| 519 | The options relevant to CRLs are as follows: | ||
| 512 | .Bl -tag -width "XXXX" | 520 | .Bl -tag -width "XXXX" |
| 513 | .It Fl crl_CA_compromise Ar time | 521 | .It Fl crl_CA_compromise Ar time |
| 514 | This is the same as | 522 | This is the same as |
| @@ -542,7 +550,7 @@ in delta CRLs which are not currently implemented. | |||
| 542 | .It Fl crldays Ar num | 550 | .It Fl crldays Ar num |
| 543 | The number of days before the next CRL is due. | 551 | The number of days before the next CRL is due. |
| 544 | This is the days from now to place in the CRL | 552 | This is the days from now to place in the CRL |
| 545 | .Em nextUpdate | 553 | .Cm nextUpdate |
| 546 | field. | 554 | field. |
| 547 | .It Fl crlexts Ar section | 555 | .It Fl crlexts Ar section |
| 548 | The | 556 | The |
| @@ -577,31 +585,22 @@ characters may be escaped by | |||
| 577 | .Pq backslash , | 585 | .Pq backslash , |
| 578 | no spaces are skipped. | 586 | no spaces are skipped. |
| 579 | .El | 587 | .El |
| 580 | .Sh CA CONFIGURATION FILE OPTIONS | ||
| 581 | The section of the configuration file containing options for | ||
| 582 | .Nm ca | ||
| 583 | is found as follows: | ||
| 584 | If the | ||
| 585 | .Fl name | ||
| 586 | command line option is used, then it names the section to be used. | ||
| 587 | Otherwise the section to be used must be named in the | ||
| 588 | .Em default_ca | ||
| 589 | option of the | ||
| 590 | .Em ca | ||
| 591 | section of the configuration file (or in the default section of the | ||
| 592 | configuration file). | ||
| 593 | Besides | ||
| 594 | .Em default_ca , | ||
| 595 | the following options are read directly from the | ||
| 596 | .Em ca | ||
| 597 | section: | ||
| 598 | .Pp | ||
| 599 | .Bl -tag -width Ds -offset indent -compact | ||
| 600 | .It preserve | ||
| 601 | .It msie_hack | ||
| 602 | .El | ||
| 603 | .Pp | 588 | .Pp |
| 604 | This is probably a bug and may change in future releases. | 589 | Many of the options can be set in the |
| 590 | .Cm ca | ||
| 591 | section of the configuration file | ||
| 592 | (or in the default section of the configuration file), | ||
| 593 | specified using | ||
| 594 | .Cm default_ca | ||
| 595 | or | ||
| 596 | .Fl name . | ||
| 597 | The options | ||
| 598 | .Cm preserve | ||
| 599 | and | ||
| 600 | .Cm msie_hack | ||
| 601 | are read directly from the | ||
| 602 | .Cm ca | ||
| 603 | section. | ||
| 605 | .Pp | 604 | .Pp |
| 606 | Many of the configuration file options are identical to command line | 605 | Many of the configuration file options are identical to command line |
| 607 | options. | 606 | options. |
| @@ -612,44 +611,66 @@ the configuration file or the command line equivalent | |||
| 612 | .Pq if any | 611 | .Pq if any |
| 613 | used. | 612 | used. |
| 614 | .Bl -tag -width "XXXX" | 613 | .Bl -tag -width "XXXX" |
| 615 | .It Ar certificate | 614 | .It Cm certificate |
| 616 | The same as | 615 | The same as |
| 617 | .Fl cert . | 616 | .Fl cert . |
| 618 | It gives the file containing the CA certificate. | 617 | It gives the file containing the CA certificate. |
| 619 | Mandatory. | 618 | Mandatory. |
| 620 | .It Ar copy_extensions | 619 | .It Cm copy_extensions |
| 621 | Determines how extensions in certificate requests should be handled. | 620 | Determines how extensions in certificate requests should be handled. |
| 622 | If set to | 621 | If set to |
| 623 | .Ar none | 622 | .Cm none |
| 624 | or this option is not present, then extensions are | 623 | or this option is not present, then extensions are |
| 625 | ignored and not copied to the certificate. | 624 | ignored and not copied to the certificate. |
| 626 | If set to | 625 | If set to |
| 627 | .Ar copy , | 626 | .Cm copy , |
| 628 | then any extensions present in the request that are not already present | 627 | then any extensions present in the request that are not already present |
| 629 | are copied to the certificate. | 628 | are copied to the certificate. |
| 630 | If set to | 629 | If set to |
| 631 | .Ar copyall , | 630 | .Cm copyall , |
| 632 | then all extensions in the request are copied to the certificate: | 631 | then all extensions in the request are copied to the certificate: |
| 633 | if the extension is already present in the certificate it is deleted first. | 632 | if the extension is already present in the certificate it is deleted first. |
| 634 | See the | 633 | .Pp |
| 635 | .Sx CA WARNINGS | 634 | The |
| 636 | section before using this option. | 635 | .Cm copy_extensions |
| 636 | option should be used with caution. | ||
| 637 | If care is not taken, it can be a security risk. | ||
| 638 | For example, if a certificate request contains a | ||
| 639 | .Cm basicConstraints | ||
| 640 | extension with CA:TRUE and the | ||
| 641 | .Cm copy_extensions | ||
| 642 | value is set to | ||
| 643 | .Cm copyall | ||
| 644 | and the user does not spot | ||
| 645 | this when the certificate is displayed, then this will hand the requestor | ||
| 646 | a valid CA certificate. | ||
| 647 | .Pp | ||
| 648 | This situation can be avoided by setting | ||
| 649 | .Cm copy_extensions | ||
| 650 | to | ||
| 651 | .Cm copy | ||
| 652 | and including | ||
| 653 | .Cm basicConstraints | ||
| 654 | with CA:FALSE in the configuration file. | ||
| 655 | Then if the request contains a | ||
| 656 | .Cm basicConstraints | ||
| 657 | extension, it will be ignored. | ||
| 637 | .Pp | 658 | .Pp |
| 638 | The main use of this option is to allow a certificate request to supply | 659 | The main use of this option is to allow a certificate request to supply |
| 639 | values for certain extensions such as | 660 | values for certain extensions such as |
| 640 | .Em subjectAltName . | 661 | .Cm subjectAltName . |
| 641 | .It Ar crl_extensions | 662 | .It Cm crl_extensions |
| 642 | The same as | 663 | The same as |
| 643 | .Fl crlexts . | 664 | .Fl crlexts . |
| 644 | .It Ar crlnumber | 665 | .It Cm crlnumber |
| 645 | A text file containing the next CRL number to use in hex. | 666 | A text file containing the next CRL number to use in hex. |
| 646 | The CRL number will be inserted in the CRLs only if this file exists. | 667 | The CRL number will be inserted in the CRLs only if this file exists. |
| 647 | If this file is present, it must contain a valid CRL number. | 668 | If this file is present, it must contain a valid CRL number. |
| 648 | .It Ar database | 669 | .It Cm database |
| 649 | The text database file to use. | 670 | The text database file to use. |
| 650 | Mandatory. | 671 | Mandatory. |
| 651 | This file must be present, though initially it will be empty. | 672 | This file must be present, though initially it will be empty. |
| 652 | .It Ar default_crl_hours , default_crl_days | 673 | .It Cm default_crl_hours , default_crl_days |
| 653 | The same as the | 674 | The same as the |
| 654 | .Fl crlhours | 675 | .Fl crlhours |
| 655 | and | 676 | and |
| @@ -657,32 +678,32 @@ and | |||
| 657 | options. | 678 | options. |
| 658 | These will only be used if neither command line option is present. | 679 | These will only be used if neither command line option is present. |
| 659 | At least one of these must be present to generate a CRL. | 680 | At least one of these must be present to generate a CRL. |
| 660 | .It Ar default_days | 681 | .It Cm default_days |
| 661 | The same as the | 682 | The same as the |
| 662 | .Fl days | 683 | .Fl days |
| 663 | option. | 684 | option. |
| 664 | The number of days to certify a certificate for. | 685 | The number of days to certify a certificate for. |
| 665 | .It Ar default_enddate | 686 | .It Cm default_enddate |
| 666 | The same as the | 687 | The same as the |
| 667 | .Fl enddate | 688 | .Fl enddate |
| 668 | option. | 689 | option. |
| 669 | Either this option or | 690 | Either this option or |
| 670 | .Ar default_days | 691 | .Cm default_days |
| 671 | .Pq or the command line equivalents | 692 | .Pq or the command line equivalents |
| 672 | must be present. | 693 | must be present. |
| 673 | .It Ar default_md | 694 | .It Cm default_md |
| 674 | The same as the | 695 | The same as the |
| 675 | .Fl md | 696 | .Fl md |
| 676 | option. | 697 | option. |
| 677 | The message digest to use. | 698 | The message digest to use. |
| 678 | Mandatory. | 699 | Mandatory. |
| 679 | .It Ar default_startdate | 700 | .It Cm default_startdate |
| 680 | The same as the | 701 | The same as the |
| 681 | .Fl startdate | 702 | .Fl startdate |
| 682 | option. | 703 | option. |
| 683 | The start date to certify a certificate for. | 704 | The start date to certify a certificate for. |
| 684 | If not set, the current time is used. | 705 | If not set, the current time is used. |
| 685 | .It Ar email_in_dn | 706 | .It Cm email_in_dn |
| 686 | The same as | 707 | The same as |
| 687 | .Fl noemailDN . | 708 | .Fl noemailDN . |
| 688 | If the EMAIL field is to be removed from the DN of the certificate, | 709 | If the EMAIL field is to be removed from the DN of the certificate, |
| @@ -690,10 +711,10 @@ simply set this to | |||
| 690 | .Qq no . | 711 | .Qq no . |
| 691 | If not present, the default is to allow for the EMAIL field in the | 712 | If not present, the default is to allow for the EMAIL field in the |
| 692 | certificate's DN. | 713 | certificate's DN. |
| 693 | .It Ar msie_hack | 714 | .It Cm msie_hack |
| 694 | The same as | 715 | The same as |
| 695 | .Fl msie_hack . | 716 | .Fl msie_hack . |
| 696 | .It Ar name_opt , cert_opt | 717 | .It Cm name_opt , cert_opt |
| 697 | These options allow the format used to display the certificate details | 718 | These options allow the format used to display the certificate details |
| 698 | when asking the user to confirm signing. | 719 | when asking the user to confirm signing. |
| 699 | All the options supported by the | 720 | All the options supported by the |
| @@ -703,38 +724,38 @@ utilities' | |||
| 703 | and | 724 | and |
| 704 | .Fl certopt | 725 | .Fl certopt |
| 705 | switches can be used here, except that | 726 | switches can be used here, except that |
| 706 | .Ar no_signame | 727 | .Cm no_signame |
| 707 | and | 728 | and |
| 708 | .Ar no_sigdump | 729 | .Cm no_sigdump |
| 709 | are permanently set and cannot be disabled | 730 | are permanently set and cannot be disabled |
| 710 | (this is because the certificate signature cannot be displayed because | 731 | (this is because the certificate signature cannot be displayed because |
| 711 | the certificate has not been signed at this point). | 732 | the certificate has not been signed at this point). |
| 712 | .Pp | 733 | .Pp |
| 713 | For convenience, the value | 734 | For convenience, the value |
| 714 | .Em ca_default | 735 | .Cm ca_default |
| 715 | is accepted by both to produce a reasonable output. | 736 | is accepted by both to produce a reasonable output. |
| 716 | .Pp | 737 | .Pp |
| 717 | If neither option is present, the format used in earlier versions of | 738 | If neither option is present, the format used in earlier versions of |
| 718 | .Nm OpenSSL | 739 | .Nm openssl |
| 719 | is used. | 740 | is used. |
| 720 | Use of the old format is | 741 | Use of the old format is |
| 721 | .Em strongly | 742 | .Em strongly |
| 722 | discouraged because it only displays fields mentioned in the | 743 | discouraged because it only displays fields mentioned in the |
| 723 | .Ar policy | 744 | .Cm policy |
| 724 | section, | 745 | section, |
| 725 | mishandles multicharacter string types and does not display extensions. | 746 | mishandles multicharacter string types and does not display extensions. |
| 726 | .It Ar new_certs_dir | 747 | .It Cm new_certs_dir |
| 727 | The same as the | 748 | The same as the |
| 728 | .Fl outdir | 749 | .Fl outdir |
| 729 | command line option. | 750 | command line option. |
| 730 | It specifies the directory where new certificates will be placed. | 751 | It specifies the directory where new certificates will be placed. |
| 731 | Mandatory. | 752 | Mandatory. |
| 732 | .It Ar oid_file | 753 | .It Cm oid_file |
| 733 | This specifies a file containing additional object identifiers. | 754 | This specifies a file containing additional object identifiers. |
| 734 | Each line of the file should consist of the numerical form of the | 755 | Each line of the file should consist of the numerical form of the |
| 735 | object identifier followed by whitespace, then the short name followed | 756 | object identifier followed by whitespace, then the short name followed |
| 736 | by whitespace and finally the long name. | 757 | by whitespace and finally the long name. |
| 737 | .It Ar oid_section | 758 | .It Cm oid_section |
| 738 | This specifies a section in the configuration file containing extra | 759 | This specifies a section in the configuration file containing extra |
| 739 | object identifiers. | 760 | object identifiers. |
| 740 | Each line should consist of the short name of the object identifier | 761 | Each line should consist of the short name of the object identifier |
| @@ -742,283 +763,38 @@ followed by | |||
| 742 | .Sq = | 763 | .Sq = |
| 743 | and the numerical form. | 764 | and the numerical form. |
| 744 | The short and long names are the same when this option is used. | 765 | The short and long names are the same when this option is used. |
| 745 | .It Ar policy | 766 | .It Cm policy |
| 746 | The same as | 767 | The same as |
| 747 | .Fl policy . | 768 | .Fl policy . |
| 748 | Mandatory. | 769 | Mandatory. |
| 749 | See the | 770 | .It Cm preserve |
| 750 | .Sx CA POLICY FORMAT | ||
| 751 | section for more information. | ||
| 752 | .It Ar preserve | ||
| 753 | The same as | 771 | The same as |
| 754 | .Fl preserveDN . | 772 | .Fl preserveDN . |
| 755 | .It Ar private_key | 773 | .It Cm private_key |
| 756 | Same as the | 774 | Same as the |
| 757 | .Fl keyfile | 775 | .Fl keyfile |
| 758 | option. | 776 | option. |
| 759 | The file containing the CA private key. | 777 | The file containing the CA private key. |
| 760 | Mandatory. | 778 | Mandatory. |
| 761 | .It Ar serial | 779 | .It Cm serial |
| 762 | A text file containing the next serial number to use in hex. | 780 | A text file containing the next serial number to use in hex. |
| 763 | Mandatory. | 781 | Mandatory. |
| 764 | This file must be present and contain a valid serial number. | 782 | This file must be present and contain a valid serial number. |
| 765 | .It Ar unique_subject | 783 | .It Cm unique_subject |
| 766 | If the value | 784 | If the value |
| 767 | .Ar yes | 785 | .Cm yes |
| 768 | is given, the valid certificate entries in the | 786 | is given, the valid certificate entries in the |
| 769 | database must have unique subjects. | 787 | database must have unique subjects. |
| 770 | If the value | 788 | If the value |
| 771 | .Ar no | 789 | .Cm no |
| 772 | is given, | 790 | is given, |
| 773 | several valid certificate entries may have the exact same subject. | 791 | several valid certificate entries may have the exact same subject. |
| 774 | The default value is | 792 | The default value is |
| 775 | .Ar yes . | 793 | .Cm yes . |
| 776 | .It Ar x509_extensions | 794 | .It Cm x509_extensions |
| 777 | The same as | 795 | The same as |
| 778 | .Fl extensions . | 796 | .Fl extensions . |
| 779 | .El | 797 | .El |
| 780 | .Sh CA POLICY FORMAT | ||
| 781 | The policy section consists of a set of variables corresponding to | ||
| 782 | certificate DN fields. | ||
| 783 | If the value is | ||
| 784 | .Qq match , | ||
| 785 | then the field value must match the same field in the CA certificate. | ||
| 786 | If the value is | ||
| 787 | .Qq supplied , | ||
| 788 | then it must be present. | ||
| 789 | If the value is | ||
| 790 | .Qq optional , | ||
| 791 | then it may be present. | ||
| 792 | Any fields not mentioned in the policy section | ||
| 793 | are silently deleted, unless the | ||
| 794 | .Fl preserveDN | ||
| 795 | option is set, | ||
| 796 | but this can be regarded more of a quirk than intended behaviour. | ||
| 797 | .Sh SPKAC FORMAT | ||
| 798 | The input to the | ||
| 799 | .Fl spkac | ||
| 800 | command line option is a Netscape signed public key and challenge. | ||
| 801 | This will usually come from the | ||
| 802 | .Em KEYGEN | ||
| 803 | tag in an HTML form to create a new private key. | ||
| 804 | It is, however, possible to create SPKACs using the | ||
| 805 | .Nm spkac | ||
| 806 | utility. | ||
| 807 | .Pp | ||
| 808 | The file should contain the variable SPKAC set to the value of | ||
| 809 | the SPKAC and also the required DN components as name value pairs. | ||
| 810 | If it's necessary to include the same component twice, | ||
| 811 | then it can be preceded by a number and a | ||
| 812 | .Sq \&. . | ||
| 813 | .Sh CA EXAMPLES | ||
| 814 | .Sy Note : | ||
| 815 | these examples assume that the | ||
| 816 | .Nm ca | ||
| 817 | directory structure is already set up and the relevant files already exist. | ||
| 818 | This usually involves creating a CA certificate and private key with | ||
| 819 | .Cm req , | ||
| 820 | a serial number file and an empty index file and placing them in | ||
| 821 | the relevant directories. | ||
| 822 | .Pp | ||
| 823 | To use the sample configuration file below, the directories | ||
| 824 | .Pa demoCA , | ||
| 825 | .Pa demoCA/private | ||
| 826 | and | ||
| 827 | .Pa demoCA/newcerts | ||
| 828 | would be created. | ||
| 829 | The CA certificate would be copied to | ||
| 830 | .Pa demoCA/cacert.pem | ||
| 831 | and its private key to | ||
| 832 | .Pa demoCA/private/cakey.pem . | ||
| 833 | A file | ||
| 834 | .Pa demoCA/serial | ||
| 835 | would be created containing, for example, | ||
| 836 | .Qq 01 | ||
| 837 | and the empty index file | ||
| 838 | .Pa demoCA/index.txt . | ||
| 839 | .Pp | ||
| 840 | Sign a certificate request: | ||
| 841 | .Pp | ||
| 842 | .Dl $ openssl ca -in req.pem -out newcert.pem | ||
| 843 | .Pp | ||
| 844 | Sign a certificate request, using CA extensions: | ||
| 845 | .Pp | ||
| 846 | .Dl $ openssl ca -in req.pem -extensions v3_ca -out newcert.pem | ||
| 847 | .Pp | ||
| 848 | Generate a CRL: | ||
| 849 | .Pp | ||
| 850 | .Dl $ openssl ca -gencrl -out crl.pem | ||
| 851 | .Pp | ||
| 852 | Sign several requests: | ||
| 853 | .Pp | ||
| 854 | .Dl $ openssl ca -infiles req1.pem req2.pem req3.pem | ||
| 855 | .Pp | ||
| 856 | Certify a Netscape SPKAC: | ||
| 857 | .Pp | ||
| 858 | .Dl $ openssl ca -spkac spkac.txt | ||
| 859 | .Pp | ||
| 860 | A sample SPKAC file | ||
| 861 | .Pq the SPKAC line has been truncated for clarity : | ||
| 862 | .Bd -literal -offset indent | ||
| 863 | SPKAC=MIG0MGAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAn7PDhCeV/xIxUg8V70YRxK | ||
| 864 | CN=Steve Test | ||
| 865 | emailAddress=steve@openssl.org | ||
| 866 | 0.OU=OpenSSL Group | ||
| 867 | 1.OU=Another Group | ||
| 868 | .Ed | ||
| 869 | .Pp | ||
| 870 | A sample configuration file with the relevant sections for | ||
| 871 | .Nm ca : | ||
| 872 | .Bd -literal | ||
| 873 | \& [ ca ] | ||
| 874 | \& default_ca = CA_default # The default ca section | ||
| 875 | |||
| 876 | \& [ CA_default ] | ||
| 877 | |||
| 878 | \& dir = ./demoCA # top dir | ||
| 879 | \& database = $dir/index.txt # index file | ||
| 880 | \& new_certs_dir = $dir/newcerts # new certs dir | ||
| 881 | |||
| 882 | \& certificate = $dir/cacert.pem # The CA cert | ||
| 883 | \& serial = $dir/serial # serial no file | ||
| 884 | \& private_key = $dir/private/cakey.pem# CA private key | ||
| 885 | |||
| 886 | \& default_days = 365 # how long to certify for | ||
| 887 | \& default_crl_days= 30 # how long before next CRL | ||
| 888 | \& default_md = md5 # md to use | ||
| 889 | |||
| 890 | \& policy = policy_any # default policy | ||
| 891 | \& email_in_dn = no # Don't add the email into cert DN | ||
| 892 | |||
| 893 | \& name_opt = ca_default # Subject name display option | ||
| 894 | \& cert_opt = ca_default # Certificate display option | ||
| 895 | \& copy_extensions = none #Don't copy extensions from request | ||
| 896 | |||
| 897 | \& [ policy_any ] | ||
| 898 | \& countryName = supplied | ||
| 899 | \& stateOrProvinceName = optional | ||
| 900 | \& organizationName = optional | ||
| 901 | \& organizationalUnitName = optional | ||
| 902 | \& commonName = supplied | ||
| 903 | \& emailAddress = optional | ||
| 904 | .Ed | ||
| 905 | .Sh CA FILES | ||
| 906 | .Sy Note : | ||
| 907 | the location of all files can change either by compile time options, | ||
| 908 | configuration file entries, environment variables, or command line options. | ||
| 909 | The values below reflect the default values. | ||
| 910 | .Bd -literal -offset indent | ||
| 911 | /etc/ssl/openssl.cnf - master configuration file | ||
| 912 | \&./demoCA - main CA directory | ||
| 913 | \&./demoCA/cacert.pem - CA certificate | ||
| 914 | \&./demoCA/private/cakey.pem - CA private key | ||
| 915 | \&./demoCA/serial - CA serial number file | ||
| 916 | \&./demoCA/serial.old - CA serial number backup file | ||
| 917 | \&./demoCA/index.txt - CA text database file | ||
| 918 | \&./demoCA/index.txt.old - CA text database backup file | ||
| 919 | \&./demoCA/certs - certificate output file | ||
| 920 | .Ed | ||
| 921 | .Sh CA ENVIRONMENT VARIABLES | ||
| 922 | .Ev OPENSSL_CONF | ||
| 923 | reflects the location of the master configuration file; | ||
| 924 | it can be overridden by the | ||
| 925 | .Fl config | ||
| 926 | command line option. | ||
| 927 | .Sh CA RESTRICTIONS | ||
| 928 | The text database index file is a critical part of the process, | ||
| 929 | and if corrupted it can be difficult to fix. | ||
| 930 | It is theoretically possible to rebuild the index file from all the | ||
| 931 | issued certificates and a current CRL; however there is no option to do this. | ||
| 932 | .Pp | ||
| 933 | V2 CRL features like delta CRLs are not currently supported. | ||
| 934 | .Pp | ||
| 935 | Although several requests can be input and handled at once, it is only | ||
| 936 | possible to include one SPKAC or self-signed certificate. | ||
| 937 | .Sh CA BUGS | ||
| 938 | The use of an in-memory text database can cause problems when large | ||
| 939 | numbers of certificates are present because, as the name implies, | ||
| 940 | the database has to be kept in memory. | ||
| 941 | .Pp | ||
| 942 | It is not possible to certify two certificates with the same DN; this | ||
| 943 | is a side effect of how the text database is indexed and it cannot easily | ||
| 944 | be fixed without introducing other problems. | ||
| 945 | Some S/MIME clients can use two certificates with the same DN for separate | ||
| 946 | signing and encryption keys. | ||
| 947 | .Pp | ||
| 948 | The | ||
| 949 | .Nm ca | ||
| 950 | command really needs rewriting or the required functionality | ||
| 951 | exposed at either a command or interface level so a more friendly utility | ||
| 952 | .Pq perl script or GUI | ||
| 953 | can handle things properly. | ||
| 954 | .Pp | ||
| 955 | Any fields in a request that are not present in a policy are silently | ||
| 956 | deleted. | ||
| 957 | This does not happen if the | ||
| 958 | .Fl preserveDN | ||
| 959 | option is used. | ||
| 960 | To enforce the absence of the EMAIL field within the DN, as suggested | ||
| 961 | by RFCs, regardless of the contents of the request's subject the | ||
| 962 | .Fl noemailDN | ||
| 963 | option can be used. | ||
| 964 | The behaviour should be more friendly and configurable. | ||
| 965 | .Pp | ||
| 966 | Cancelling some commands by refusing to certify a certificate can | ||
| 967 | create an empty file. | ||
| 968 | .Sh CA WARNINGS | ||
| 969 | The | ||
| 970 | .Nm ca | ||
| 971 | command is quirky and at times downright unfriendly. | ||
| 972 | .Pp | ||
| 973 | The | ||
| 974 | .Nm ca | ||
| 975 | utility was originally meant as an example of how to do things in a CA. | ||
| 976 | It was not supposed to be used as a full blown CA itself: | ||
| 977 | nevertheless some people are using it for this purpose. | ||
| 978 | .Pp | ||
| 979 | The | ||
| 980 | .Nm ca | ||
| 981 | command is effectively a single user command: no locking is done on the | ||
| 982 | various files, and attempts to run more than one | ||
| 983 | .Nm ca | ||
| 984 | command on the same database can have unpredictable results. | ||
| 985 | .Pp | ||
| 986 | The | ||
| 987 | .Ar copy_extensions | ||
| 988 | option should be used with caution. | ||
| 989 | If care is not taken, it can be a security risk. | ||
| 990 | For example, if a certificate request contains a | ||
| 991 | .Em basicConstraints | ||
| 992 | extension with CA:TRUE and the | ||
| 993 | .Ar copy_extensions | ||
| 994 | value is set to | ||
| 995 | .Ar copyall | ||
| 996 | and the user does not spot | ||
| 997 | this when the certificate is displayed, then this will hand the requestor | ||
| 998 | a valid CA certificate. | ||
| 999 | .Pp | ||
| 1000 | This situation can be avoided by setting | ||
| 1001 | .Ar copy_extensions | ||
| 1002 | to | ||
| 1003 | .Ar copy | ||
| 1004 | and including | ||
| 1005 | .Em basicConstraints | ||
| 1006 | with CA:FALSE in the configuration file. | ||
| 1007 | Then if the request contains a | ||
| 1008 | .Em basicConstraints | ||
| 1009 | extension, it will be ignored. | ||
| 1010 | .Pp | ||
| 1011 | It is advisable to also include values for other extensions such | ||
| 1012 | as | ||
| 1013 | .Ar keyUsage | ||
| 1014 | to prevent a request supplying its own values. | ||
| 1015 | .Pp | ||
| 1016 | Additional restrictions can be placed on the CA certificate itself. | ||
| 1017 | For example if the CA certificate has: | ||
| 1018 | .Pp | ||
| 1019 | .D1 basicConstraints = CA:TRUE, pathlen:0 | ||
| 1020 | .Pp | ||
| 1021 | then even if a certificate is issued with CA:TRUE it will not be valid. | ||
| 1022 | .\" | 798 | .\" |
| 1023 | .\" CIPHERS | 799 | .\" CIPHERS |
| 1024 | .\" | 800 | .\" |
| @@ -9352,6 +9128,13 @@ This can be used to send the data via a pipe for example. | |||
| 9352 | .It Ar stdin | 9128 | .It Ar stdin |
| 9353 | Read the password from standard input. | 9129 | Read the password from standard input. |
| 9354 | .El | 9130 | .El |
| 9131 | .Sh ENVIRONMENT | ||
| 9132 | The following environment variables affect the execution of | ||
| 9133 | .Nm openssl : | ||
| 9134 | .Bl -tag -width "OPENSSL_CONFXXX" | ||
| 9135 | .It Ev OPENSSL_CONF | ||
| 9136 | The location of the master configuration file. | ||
| 9137 | .El | ||
| 9355 | .\" | 9138 | .\" |
| 9356 | .\" FILES | 9139 | .\" FILES |
| 9357 | .\" | 9140 | .\" |
