{"id":241,"date":"2012-04-24T16:51:55","date_gmt":"2012-04-24T16:51:55","guid":{"rendered":"f340f1b1f65b6df5b5e3f94d95b11daf"},"modified":"2012-04-24T16:51:55","modified_gmt":"2012-04-24T16:51:55","slug":"","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/241","title":{"rendered":"OpenSSL Command"},"content":{"rendered":"<p><strong><span style=\"color:#996600;\">NAME<\/span><\/strong><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ca - sample minimal CA application<\/p>\n<p><b><span style=\"color:#996600;\">SYNOPSIS<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">openssl<\/span><\/b> <b><span style=\"color:#996600;\">ca<\/span><\/b> [<b><span style=\"color:#996600;\">-verbose<\/span><\/b>] [<b><span style=\"color:#996600;\">-config<\/span><\/b> <b><span style=\"color:#996600;\">filename<\/span><\/b>] [<b><span style=\"color:#996600;\">-name<\/span><\/b> <b><span style=\"color:#996600;\">section<\/span><\/b>] [<b><span style=\"color:#996600;\">-gencrl<\/span><\/b>] [<b><span style=\"color:#996600;\">-revoke<\/span><\/b> <b><span style=\"color:#996600;\">file<\/span><\/b>] [<b><span style=\"color:#996600;\">-crl_reason<\/span><\/b> <b><span style=\"color:#996600;\">reason<\/span><\/b>]<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<b><span style=\"color:#996600;\">-crl_hold<\/span><\/b> <b><span style=\"color:#996600;\">instruction<\/span><\/b>] [<b><span style=\"color:#996600;\">-crl_compromise<\/span><\/b> <b><span style=\"color:#996600;\">time<\/span><\/b>] [<b><span style=\"color:#996600;\">-crl_CA_compromise<\/span><\/b> <b><span style=\"color:#996600;\">time<\/span><\/b>] [<b><span style=\"color:#996600;\">-subj<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b>] [<b><span style=\"color:#996600;\">-crldays<\/span><\/b> <b><span style=\"color:#996600;\">days<\/span><\/b>] [<b><span style=\"color:#996600;\">-crl-<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">hours<\/span><\/b> <b><span style=\"color:#996600;\">hours<\/span><\/b>] [<b><span style=\"color:#996600;\">-crlexts<\/span><\/b> <b><span style=\"color:#996600;\">section<\/span><\/b>] [<b><span style=\"color:#996600;\">-startdate<\/span><\/b> <b><span style=\"color:#996600;\">date<\/span><\/b>] [<b><span style=\"color:#996600;\">-enddate<\/span><\/b> <b><span style=\"color:#996600;\">date<\/span><\/b>] [<b><span style=\"color:#996600;\">-days<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b>] [<b><span style=\"color:#996600;\">-md<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b>] [<b><span style=\"color:#996600;\">-policy<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b>] [<b><span style=\"color:#996600;\">-key-<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">file<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b>] [<b><span style=\"color:#996600;\">-key<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b>] [<b><span style=\"color:#996600;\">-passin<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b>] [<b><span style=\"color:#996600;\">-cert<\/span><\/b> <b><span style=\"color:#996600;\">file<\/span><\/b>] [<b><span style=\"color:#996600;\">-in<\/span><\/b> <b><span style=\"color:#996600;\">file<\/span><\/b>] [<b><span style=\"color:#996600;\">-out<\/span><\/b> <b><span style=\"color:#996600;\">file<\/span><\/b>] [<b><span style=\"color:#996600;\">-notext<\/span><\/b>] [<b><span style=\"color:#996600;\">-outdir<\/span><\/b> <b><span style=\"color:#996600;\">dir<\/span><\/b>] [<b><span style=\"color:#996600;\">-infiles<\/span><\/b>]<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<b><span style=\"color:#996600;\">-spkac<\/span><\/b> <b><span style=\"color:#996600;\">file<\/span><\/b>] [<b><span style=\"color:#996600;\">-ss_cert<\/span><\/b> <b><span style=\"color:#996600;\">file<\/span><\/b>] [<b><span style=\"color:#996600;\">-preserveDN<\/span><\/b>] [<b><span style=\"color:#996600;\">-noemailDN<\/span><\/b>] [<b><span style=\"color:#996600;\">-batch<\/span><\/b>] [<b><span style=\"color:#996600;\">-msie_hack<\/span><\/b>] [<b><span style=\"color:#996600;\">-extensions<\/span><\/b> <b><span style=\"color:#996600;\">section<\/span><\/b>] [<b><span style=\"color:#996600;\">-extfile<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">section<\/span><\/b>] [<b><span style=\"color:#996600;\">-engine<\/span><\/b> <b><span style=\"color:#996600;\">id<\/span><\/b>]<\/p>\n<p><b><span style=\"color:#996600;\">DESCRIPTION<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The <b><span style=\"color:#996600;\">ca<\/span><\/b> command is a minimal CA application. It can be used to sign certificate requests in a variety of forms<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and generate CRLs it also maintains a text database of issued certificates and their status.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The options descriptions will be divided into each purpose.<\/p>\n<p><b><span style=\"color:#996600;\">CA<\/span><\/b> <b><span style=\"color:#996600;\">OPTIONS<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-config<\/span><\/b> <b><span style=\"color:#996600;\">filename<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specifies the configuration file to use.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-name<\/span><\/b> <b><span style=\"color:#996600;\">section<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specifies the configuration file section to use (overrides <b><span style=\"color:#996600;\">default_ca<\/span><\/b> in the <b><span style=\"color:#996600;\">ca<\/span><\/b> section).<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-in<\/span><\/b> <b><span style=\"color:#996600;\">filename<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; an input filename containing a single certificate request to be signed by the CA.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-ss_cert<\/span><\/b> <b><span style=\"color:#996600;\">filename<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a single self signed certificate to be signed by the CA.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-spkac<\/span><\/b> <b><span style=\"color:#996600;\">filename<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a file containing a single Netscape signed public key and challenge and additional field values to be<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signed by the CA. See the <b><span style=\"color:#996600;\">SPKAC<\/span><\/b> <b><span style=\"color:#996600;\">FORMAT<\/span><\/b> section for information on the required format.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-infiles<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if present this should be the last option, all subsequent arguments are assumed to the the names of files<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; containing certificate requests.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-out<\/span><\/b> <b><span style=\"color:#996600;\">filename<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the output file to output certificates to. The default is standard output. The certificate details will<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; also be printed out to this file.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-outdir<\/span><\/b> <b><span style=\"color:#996600;\">directory<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the directory to output certificates to. The certificate will be written to a filename consisting of the<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serial number in hex with \".pem\" appended.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-cert<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the CA certificate file.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-keyfile<\/span><\/b> <b><span style=\"color:#996600;\">filename<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the private key to sign requests with.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-key<\/span><\/b> <b><span style=\"color:#996600;\">password<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the password used to encrypt the private key. Since on some systems the command line arguments are visible<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (e.g. Unix with the 'ps' utility) this option should be used with caution.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-passin<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the key password source. For more information about the format of <b><span style=\"color:#996600;\">arg<\/span><\/b> see the <b><span style=\"color:#996600;\">PASS<\/span><\/b> <b><span style=\"color:#996600;\">PHRASE<\/span><\/b> <b><span style=\"color:#996600;\">ARGUMENTS<\/span><\/b> sec-<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tion in <a href=\"http:\/\/www.9linux.com\/index.php\/man\/openssl\/1\"><span style=\"color:#2200cc;\">openssl(1)<\/span><\/a>.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-verbose<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this prints extra details about the operations being performed.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-notext<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; don't output the text form of a certificate to the output file.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-startdate<\/span><\/b> <b><span style=\"color:#996600;\">date<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this allows the start date to be explicitly set. The format of the date is YYMMDDHHMMSSZ (the same as an<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ASN1 UTCTime structure).<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-enddate<\/span><\/b> <b><span style=\"color:#996600;\">date<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this allows the expiry date to be explicitly set. The format of the date is YYMMDDHHMMSSZ (the same as an<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ASN1 UTCTime structure).<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-days<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the number of days to certify the certificate for.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-md<\/span><\/b> <b><span style=\"color:#996600;\">alg<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the message digest to use. Possible values include md5, sha1 and mdc2.&nbsp; This option also applies to CRLs.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-policy<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this option defines the CA \"policy\" to use. This is a section in the configuration file which decides<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; which fields should be mandatory or match the CA certificate. Check out the <b><span style=\"color:#996600;\">POLICY<\/span><\/b> <b><span style=\"color:#996600;\">FORMAT<\/span><\/b> section for more<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; information.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-msie_hack<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this is a legacy option to make <b><span style=\"color:#996600;\">ca<\/span><\/b> work with very old versions of the IE certificate enrollment control<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"certenr3\". It used UniversalStrings for almost everything. Since the old control has various security<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bugs its use is strongly discouraged. The newer control \"Xenroll\" does not need this option.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-preserveDN<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Normally the DN order of a certificate is the same as the order of the fields in the relevant policy sec-<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tion. When this option is set the order is the same as the request. This is largely for compatibility with<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the older IE enrollment control which would only accept certificates if their DNs match the order of the<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; request. This is not needed for Xenroll.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-noemailDN<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The DN of a certificate can contain the EMAIL field if present in the request DN, however it is good pol-<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icy just having the e-mail set into the altName extension of the certificate. When this option is set the<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EMAIL field is removed from the certificate' subject and set only in the, eventually present, extensions.<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The <b><span style=\"color:#996600;\">email_in_dn<\/span><\/b> keyword can be used in the configuration file to enable this behaviour.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-batch<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this sets the batch mode. In this mode no questions will be asked and all certificates will be certified<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; automatically.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-extensions<\/span><\/b> <b><span style=\"color:#996600;\">section<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the section of the configuration file containing certificate extensions to be added when a certificate is<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; issued (defaults to <b><span style=\"color:#996600;\">x509_extensions<\/span><\/b> unless the <b><span style=\"color:#996600;\">-extfile<\/span><\/b> option is used). If no extension section is<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; present then, a V1 certificate is created. If the extension section is present (even if it is empty), then<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a V3 certificate is created.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-extfile<\/span><\/b> <b><span style=\"color:#996600;\">file<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; an additional configuration file to read certificate extensions from (using the default section unless the<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-extensions<\/span><\/b> option is also used).<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-engine<\/span><\/b> <b><span style=\"color:#996600;\">id<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specifying an engine (by it's unique <b><span style=\"color:#996600;\">id<\/span><\/b> string) will cause <b><span style=\"color:#996600;\">req<\/span><\/b> to attempt to obtain a functional reference<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to the specified engine, thus initialising it if needed. The engine will then be set as the default for<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; all available algorithms.<\/p>\n<p><b><span style=\"color:#996600;\">CRL<\/span><\/b> <b><span style=\"color:#996600;\">OPTIONS<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-gencrl<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this option generates a CRL based on information in the index file.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-crldays<\/span><\/b> <b><span style=\"color:#996600;\">num<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the number of days before the next CRL is due. That is the days from now to place in the CRL nextUpdate<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; field.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-crlhours<\/span><\/b> <b><span style=\"color:#996600;\">num<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the number of hours before the next CRL is due.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-revoke<\/span><\/b> <b><span style=\"color:#996600;\">filename<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a filename containing a certificate to revoke.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-crl_reason<\/span><\/b> <b><span style=\"color:#996600;\">reason<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; revocation reason, where <b><span style=\"color:#996600;\">reason<\/span><\/b> is one of: <b><span style=\"color:#996600;\">unspecified<\/span><\/b>, <b><span style=\"color:#996600;\">keyCompromise<\/span><\/b>, <b><span style=\"color:#996600;\">CACompromise<\/span><\/b>, <b><span style=\"color:#996600;\">affiliationChanged<\/span><\/b>,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">superseded<\/span><\/b>, <b><span style=\"color:#996600;\">cessationOfOperation<\/span><\/b>, <b><span style=\"color:#996600;\">certificateHold<\/span><\/b> or <b><span style=\"color:#996600;\">removeFromCRL<\/span><\/b>. The matching of <b><span style=\"color:#996600;\">reason<\/span><\/b> is case insen-<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sitive. Setting any revocation reason will make the CRL v2.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In practive <b><span style=\"color:#996600;\">removeFromCRL<\/span><\/b> is not particularly useful because it is only used in delta CRLs which are not<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; currently implemented.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-crl_hold<\/span><\/b> <b><span style=\"color:#996600;\">instruction<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This sets the CRL revocation reason code to <b><span style=\"color:#996600;\">certificateHold<\/span><\/b> and the hold instruction to <b><span style=\"color:#996600;\">instruction<\/span><\/b> which<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; must be an OID. Although any OID can be used only <b><span style=\"color:#996600;\">holdInstructionNone<\/span><\/b> (the use of which is discouraged by<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RFC2459) <b><span style=\"color:#996600;\">holdInstructionCallIssuer<\/span><\/b> or <b><span style=\"color:#996600;\">holdInstructionReject<\/span><\/b> will normally be used.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-crl_compromise<\/span><\/b> <b><span style=\"color:#996600;\">time<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This sets the revocation reason to <b><span style=\"color:#996600;\">keyCompromise<\/span><\/b> and the compromise time to <b><span style=\"color:#996600;\">time<\/span><\/b>. <b><span style=\"color:#996600;\">time<\/span><\/b> should be in Gener-<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alizedTime format that is <b><span style=\"color:#996600;\">YYYYMMDDHHMMSSZ<\/span><\/b>.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-crl_CA_compromise<\/span><\/b> <b><span style=\"color:#996600;\">time<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is the same as <b><span style=\"color:#996600;\">crl_compromise<\/span><\/b> except the revocation reason is set to <b><span style=\"color:#996600;\">CACompromise<\/span><\/b>.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-subj<\/span><\/b> <b><span style=\"color:#996600;\">arg<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; supersedes subject name given in the request.&nbsp; The arg must be formatted as<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <u><span style=\"color:#008000;\">\/type0=value0\/type1=value1\/type2=...<\/span><\/u>, characters may be escaped by \\ (backslash), no spaces are skipped.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-crlexts<\/span><\/b> <b><span style=\"color:#996600;\">section<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the section of the configuration file containing CRL extensions to include. If no CRL extension section is<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; present then a V1 CRL is created, if the CRL extension section is present (even if it is empty) then a V2<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CRL is created. The CRL extensions specified are CRL extensions and <b><span style=\"color:#996600;\">not<\/span><\/b> CRL entry extensions.&nbsp; It should<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; be noted that some software (for example Netscape) can't handle V2 CRLs.<\/p>\n<p><b><span style=\"color:#996600;\">CONFIGURATION<\/span><\/b> <b><span style=\"color:#996600;\">FILE<\/span><\/b> <b><span style=\"color:#996600;\">OPTIONS<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The section of the configuration file containing options for <b><span style=\"color:#996600;\">ca<\/span><\/b> is found as follows: If the <b><span style=\"color:#996600;\">-name<\/span><\/b> command line<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; option is used, then it names the section to be used. Otherwise the section to be used must be named in the<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">default_ca<\/span><\/b> option of the <b><span style=\"color:#996600;\">ca<\/span><\/b> section of the configuration file (or in the default section of the configuration<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file). Besides <b><span style=\"color:#996600;\">default_ca<\/span><\/b>, the following options are read directly from the <b><span style=\"color:#996600;\">ca<\/span><\/b> section:<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RANDFILE<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; preserve<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msie_hack With the exception of <b><span style=\"color:#996600;\">RANDFILE<\/span><\/b>, this is probably a bug and may change in future releases. Many of the configuration file options are identical to command line options. Where the option is present in the configuration file and the command line the command line value is used. Where an option is described as mandatory then it must be present in the configuration file or the command line equivalent (if any) used. <b><span style=\"color:#996600;\">oid_file<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This specifies a file containing additional <b><span style=\"color:#996600;\">OBJECT<\/span><\/b> <b><span style=\"color:#996600;\">IDENTIFIERS<\/span><\/b>.&nbsp; Each line of the file should consist of<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the numerical form of the object identifier followed by white space then the short name followed by white<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; space and finally the long name.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">oid_section<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This specifies a section in the configuration file containing extra object identifiers. Each line should<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; consist of the short name of the object identifier followed by <b><span style=\"color:#996600;\">=<\/span><\/b> and the numerical form. The short and<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long names are the same when this option is used.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">new_certs_dir<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as the <b><span style=\"color:#996600;\">-outdir<\/span><\/b> command line option. It specifies the directory where new certificates will be<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; placed. Mandatory.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">certificate<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as <b><span style=\"color:#996600;\">-cert<\/span><\/b>. It gives the file containing the CA certificate. Mandatory.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">private_key<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same as the <b><span style=\"color:#996600;\">-keyfile<\/span><\/b> option. The file containing the CA private key. Mandatory.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">RANDFILE<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a file used to read and write random number seed information, or an EGD socket (see <a href=\"http:\/\/www.9linux.com\/index.php\/man\/RAND_egd\/3\"><span style=\"color:#2200cc;\">RAND_egd(3)<\/span><\/a>).<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">default_days<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as the <b><span style=\"color:#996600;\">-days<\/span><\/b> option. The number of days to certify a certificate for.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">default_startdate<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as the <b><span style=\"color:#996600;\">-startdate<\/span><\/b> option. The start date to certify a certificate for. If not set the current<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time is used.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">default_enddate<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as the <b><span style=\"color:#996600;\">-enddate<\/span><\/b> option. Either this option or <b><span style=\"color:#996600;\">default_days<\/span><\/b> (or the command line equivalents) must<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; be present.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">default_crl_hours<\/span><\/b> <b><span style=\"color:#996600;\">default_crl_days<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as the <b><span style=\"color:#996600;\">-crlhours<\/span><\/b> and the <b><span style=\"color:#996600;\">-crldays<\/span><\/b> options. These will only be used if neither command line option<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; is present. At least one of these must be present to generate a CRL.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">default_md<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as the <b><span style=\"color:#996600;\">-md<\/span><\/b> option. The message digest to use. Mandatory.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">database<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the text database file to use. Mandatory. This file must be present though initially it will be empty.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">serialfile<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a text file containing the next serial number to use in hex. Mandatory.&nbsp; This file must be present and<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; contain a valid serial number.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">x509_extensions<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as <b><span style=\"color:#996600;\">-extensions<\/span><\/b>.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">crl_extensions<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as <b><span style=\"color:#996600;\">-crlexts<\/span><\/b>.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">preserve<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as <b><span style=\"color:#996600;\">-preserveDN<\/span><\/b><\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">email_in_dn<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as <b><span style=\"color:#996600;\">-noemailDN<\/span><\/b>. If you want the EMAIL field to be removed from the DN of the certificate simply<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set this to 'no'. If not present the default is to allow for the EMAIL filed in the certificate's DN.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">msie_hack<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as <b><span style=\"color:#996600;\">-msie_hack<\/span><\/b><\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">policy<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the same as <b><span style=\"color:#996600;\">-policy<\/span><\/b>. Mandatory. See the <b><span style=\"color:#996600;\">POLICY<\/span><\/b> <b><span style=\"color:#996600;\">FORMAT<\/span><\/b> section for more information.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">nameopt<\/span><\/b>, <b><span style=\"color:#996600;\">certopt<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; these options allow the format used to display the certificate details when asking the user to confirm<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signing. All the options supported by the <b><span style=\"color:#996600;\">x509<\/span><\/b> utilities <b><span style=\"color:#996600;\">-nameopt<\/span><\/b> and <b><span style=\"color:#996600;\">-certopt<\/span><\/b> switches can be used here,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; except the <b><span style=\"color:#996600;\">no_signame<\/span><\/b> and <b><span style=\"color:#996600;\">no_sigdump<\/span><\/b> are permanently set and cannot be disabled (this is because the cer-<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tificate signature cannot be displayed because the certificate has not been signed at this point).<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For convenience the values <b><span style=\"color:#996600;\">default_ca<\/span><\/b> are accepted by both to produce a reasonable output.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If neither option is present the format used in earlier versions of OpenSSL is used. Use of the old format<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; is <b><span style=\"color:#996600;\">strongly<\/span><\/b> discouraged because it only displays fields mentioned in the <b><span style=\"color:#996600;\">policy<\/span><\/b> section, mishandles multi-<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; character string types and does not display extensions.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">copy_extensions<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; determines how extensions in certificate requests should be handled.&nbsp; If set to <b><span style=\"color:#996600;\">none<\/span><\/b> or this option is not<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; present then extensions are ignored and not copied to the certificate. If set to <b><span style=\"color:#996600;\">copy<\/span><\/b> then any extensions<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; present in the request that are not already present are copied to the certificate. If set to <b><span style=\"color:#996600;\">copyall<\/span><\/b> then<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; all extensions in the request are copied to the certificate: if the extension is already present in the<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; certificate it is deleted first. See the <b><span style=\"color:#996600;\">WARNINGS<\/span><\/b> section before using this option.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The main use of this option is to allow a certificate request to supply values for certain extensions such<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as subjectAltName.<\/p>\n<p><b><span style=\"color:#996600;\">POLICY<\/span><\/b> <b><span style=\"color:#996600;\">FORMAT<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The policy section consists of a set of variables corresponding to certificate DN fields. If the value is<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"match\" then the field value must match the same field in the CA certificate. If the value is \"supplied\" then<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it must be present. If the value is \"optional\" then it may be present. Any fields not mentioned in the policy<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; section are silently deleted, unless the <b><span style=\"color:#996600;\">-preserveDN<\/span><\/b> option is set but this can be regarded more of a quirk<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; than intended behaviour.<\/p>\n<p><b><span style=\"color:#996600;\">SPKAC<\/span><\/b> <b><span style=\"color:#996600;\">FORMAT<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The input to the <b><span style=\"color:#996600;\">-spkac<\/span><\/b> command line option is a Netscape signed public key and challenge. This will usually<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; come from the <b><span style=\"color:#996600;\">KEYGEN<\/span><\/b> tag in an HTML form to create a new private key.&nbsp; It is however possible to create SPKACs<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using the <b><span style=\"color:#996600;\">spkac<\/span><\/b> utility.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The file should contain the variable SPKAC set to the value of the SPKAC and also the required DN components<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as name value pairs.&nbsp; If you need to include the same component twice then it can be preceded by a number and<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a '.'.<\/p>\n<p><b><span style=\"color:#996600;\">EXAMPLES<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Note: these examples assume that the <b><span style=\"color:#996600;\">ca<\/span><\/b> directory structure is already set up and the relevant files already<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exist. This usually involves creating a CA certificate and private key with <b><span style=\"color:#996600;\">req<\/span><\/b>, a serial number file and an<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; empty index file and placing them in the relevant directories.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; To use the sample configuration file below the directories demoCA, demoCA\/private and demoCA\/newcerts would be<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; created. The CA certificate would be copied to demoCA\/cacert.pem and its private key to demoCA\/pri-<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vate\/cakey.pem. A file demoCA\/serial would be created containing for example \"01\" and the empty index file<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; demoCA\/index.txt.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sign a certificate request:<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; openssl ca -in req.pem -out newcert.pem<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sign a certificate request, using CA extensions:<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; openssl ca -in req.pem -extensions v3_ca -out newcert.pem<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Generate a CRL<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; openssl ca -gencrl -out crl.pem<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sign several requests:<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; openssl ca -infiles req1.pem req2.pem req3.pem<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Certify a Netscape SPKAC:<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; openssl ca -spkac spkac.txt<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A sample SPKAC file (the SPKAC line has been truncated for clarity):<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SPKAC=MIG0MGAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAn7PDhCeV\/xIxUg8V70YRxK2A5<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CN=Steve Test<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; emailAddress=<a href=\"mailto:steve%20AT%20openssl.org\"><span style=\"color:#2200cc;\">steve<\/span><u><span style=\"color:#008000;\"> AT <\/span><\/u><span style=\"color:#2200cc;\">openssl.org<\/span><\/a><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.OU=OpenSSL Group<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.OU=Another Group<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A sample configuration file with the relevant sections for <b><span style=\"color:#996600;\">ca<\/span><\/b>:<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ ca ]<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default_ca&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = CA_default&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # The default ca section<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ CA_default ]<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = .\/demoCA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # top dir<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; database&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = $dir\/index.txt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # index file.<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new_certs_dir&nbsp; = $dir\/newcerts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # new certs dir<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; certificate&nbsp;&nbsp;&nbsp; = $dir\/cacert.pem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # The CA cert<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = $dir\/serial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # serial no file<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private_key&nbsp;&nbsp;&nbsp; = $dir\/private\/cakey.pem# CA private key<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RANDFILE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = $dir\/private\/.rand&nbsp;&nbsp;&nbsp; # random number file<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default_days&nbsp;&nbsp; = 365&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # how long to certify for<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default_crl_days= 30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # how long before next CRL<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default_md&nbsp;&nbsp;&nbsp;&nbsp; = md5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # md to use<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; policy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = policy_any&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # default policy<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; email_in_dn&nbsp;&nbsp;&nbsp; = no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Don't add the email into cert DN<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nameopt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = default_ca&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Subject name display option<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; certopt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = default_ca&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Certificate display option<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; copy_extensions = none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Don't copy extensions from request<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ policy_any ]<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; countryName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = supplied<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stateOrProvinceName&nbsp;&nbsp;&nbsp; = optional<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; organizationName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = optional<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; organizationalUnitName = optional<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; commonName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = supplied<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; emailAddress&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = optional<\/p>\n<p><b><span style=\"color:#996600;\">FILES<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Note: the location of all files can change either by compile time options, configuration file entries, envi-<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ronment variables or command line options.&nbsp; The values below reflect the default values.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/usr\/local\/ssl\/lib\/openssl.cnf - master configuration file<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .\/demoCA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - main CA directory<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .\/demoCA\/cacert.pem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - CA certificate<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .\/demoCA\/private\/cakey.pem&nbsp;&nbsp;&nbsp;&nbsp; - CA private key<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .\/demoCA\/serial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - CA serial number file<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .\/demoCA\/serial.old&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - CA serial number backup file<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .\/demoCA\/index.txt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - CA text database file<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .\/demoCA\/index.txt.old&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - CA text database backup file<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .\/demoCA\/certs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - certificate output file<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .\/demoCA\/.rnd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - CA random seed information<\/p>\n<p><b><span style=\"color:#996600;\">ENVIRONMENT<\/span><\/b> <b><span style=\"color:#996600;\">VARIABLES<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">OPENSSL_CONF<\/span><\/b> reflects the location of master configuration file it can be overridden by the <b><span style=\"color:#996600;\">-config<\/span><\/b> command<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; line option.<\/p>\n<p><b><span style=\"color:#996600;\">RESTRICTIONS<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The text database index file is a critical part of the process and if corrupted it can be difficult to fix. It<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; is theoretically possible to rebuild the index file from all the issued certificates and a current CRL: how-<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ever there is no option to do this.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; V2 CRL features like delta CRL support and CRL numbers are not currently supported.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Although several requests can be input and handled at once it is only possible to include one SPKAC or self<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signed certificate.<\/p>\n<p><b><span style=\"color:#996600;\">BUGS<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The use of an in memory text database can cause problems when large numbers of certificates are present<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; because, as the name implies the database has to be kept in memory.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; It is not possible to certify two certificates with the same DN: this is a side effect of how the text<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; database is indexed and it cannot easily be fixed without introducing other problems. Some S\/MIME clients can<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; use two certificates with the same DN for separate signing and encryption keys.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The <b><span style=\"color:#996600;\">ca<\/span><\/b> command really needs rewriting or the required functionality exposed at either a command or interface<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level so a more friendly utility (perl script or GUI) can handle things properly. The scripts <b><span style=\"color:#996600;\">CA.sh<\/span><\/b> and <b><span style=\"color:#996600;\">CA.pl<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; help a little but not very much.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Any fields in a request that are not present in a policy are silently deleted. This does not happen if the<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">-preserveDN<\/span><\/b> option is used. To enforce the absence of the EMAIL field within the DN, as suggested by RFCs,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; regardless the contents of the request' subject the <b><span style=\"color:#996600;\">-noemailDN<\/span><\/b> option can be used. The behaviour should be<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; more friendly and configurable.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cancelling some commands by refusing to certify a certificate can create an empty file.<\/p>\n<p><b><span style=\"color:#996600;\">WARNINGS<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The <b><span style=\"color:#996600;\">ca<\/span><\/b> command is quirky and at times downright unfriendly.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The <b><span style=\"color:#996600;\">ca<\/span><\/b> utility was originally meant as an example of how to do things in a CA. It was not supposed to be used<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as a full blown CA itself: nevertheless some people are using it for this purpose.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The <b><span style=\"color:#996600;\">ca<\/span><\/b> command is effectively a single user command: no locking is done on the various files and attempts to<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; run more than one <b><span style=\"color:#996600;\">ca<\/span><\/b> command on the same database can have unpredictable results.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The <b><span style=\"color:#996600;\">copy_extensions<\/span><\/b> option should be used with caution. If care is not taken then it can be a security risk.<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For example if a certificate request contains a basicConstraints extension with CA:TRUE and the <b><span style=\"color:#996600;\">copy_exten-<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">sions<\/span><\/b> value is set to <b><span style=\"color:#996600;\">copyall<\/span><\/b> and the user does not spot this when the certificate is displayed then this will<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hand the requestor a valid CA certificate.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This situation can be avoided by setting <b><span style=\"color:#996600;\">copy_extensions<\/span><\/b> to <b><span style=\"color:#996600;\">copy<\/span><\/b> and including basicConstraints with CA:FALSE<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the configuration file.&nbsp; Then if the request contains a basicConstraints extension it will be ignored.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; It is advisable to also include values for other extensions such as <b><span style=\"color:#996600;\">keyUsage<\/span><\/b> to prevent a request supplying<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; its own values.<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Additional restrictions can be placed on the CA certificate itself.&nbsp; For example if the CA certificate has:<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; basicConstraints = CA:TRUE, pathlen:0<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then even if a certificate is issued with CA:TRUE it will not be valid.<\/p>\n<p><b><span style=\"color:#996600;\">SEE<\/span><\/b> <b><span style=\"color:#996600;\">ALSO<\/span><\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong><span style=\"color:#996600;\">NAME<\/span><\/strong><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ca - sample minimal CA application<\/p>\n<p><b><span style=\"color:#996600;\">SYNOPSIS<\/span><\/b><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style=\"color:#996600;\">openssl<\/span><\/b><b><span style=\"color:#996600;\">ca<\/span><\/b> [<b><span style=\"color:#996600;\">-verbose<\/span><\/b>] [<b><span style=\"color:#996600;\">-config<\/span><\/b><b><span style=\"color:#996600;\">filename<\/span><\/b>] [<b><span style=\"color:#996600;\">-name<\/span><\/b><b><span style=\"color:#996600;\">section<\/span><\/b>] [<b><span style=\"color:#996600;\">-gencrl<\/span><\/b>] [<b><span style=\"color:#996600;\">-revoke<\/span><\/b><b><span style=\"color:#996600;\">file<\/span><\/b>] [<b><span style=\"color:#996600;\">-crl_reason<\/span><\/b><b><span style=\"color:#996600;\">reason<\/span><\/b>]<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<b><span style=\"color:#996600;\">-crl_hold<\/span><\/b><b><span style=\"color:#996600;\">instruction<\/span><\/b>] [<b><span style=\"color:#996600;\">-crl_compromise<\/span><\/b><b><span style=\"color:#996600;\">t...<\/span><\/b> <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/241\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[273],"tags":[],"class_list":["post-241","post","type-post","status-publish","format-standard","hentry","category-article"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}