1ebfedea0SLionel Sambuc=pod 2ebfedea0SLionel Sambuc 3ebfedea0SLionel Sambuc=for comment openssl_manual_section:5 4ebfedea0SLionel Sambuc 5ebfedea0SLionel Sambuc=head1 NAME 6ebfedea0SLionel Sambuc 7ebfedea0SLionel Sambucx509v3_config - X509 V3 certificate extension configuration format 8ebfedea0SLionel Sambuc 9ebfedea0SLionel Sambuc=head1 DESCRIPTION 10ebfedea0SLionel Sambuc 11ebfedea0SLionel SambucSeveral of the OpenSSL utilities can add extensions to a certificate or 12ebfedea0SLionel Sambuccertificate request based on the contents of a configuration file. 13ebfedea0SLionel Sambuc 14ebfedea0SLionel SambucTypically the application will contain an option to point to an extension 15ebfedea0SLionel Sambucsection. Each line of the extension section takes the form: 16ebfedea0SLionel Sambuc 17ebfedea0SLionel Sambuc extension_name=[critical,] extension_options 18ebfedea0SLionel Sambuc 19ebfedea0SLionel SambucIf B<critical> is present then the extension will be critical. 20ebfedea0SLionel Sambuc 21ebfedea0SLionel SambucThe format of B<extension_options> depends on the value of B<extension_name>. 22ebfedea0SLionel Sambuc 23ebfedea0SLionel SambucThere are four main types of extension: I<string> extensions, I<multi-valued> 24ebfedea0SLionel Sambucextensions, I<raw> and I<arbitrary> extensions. 25ebfedea0SLionel Sambuc 26ebfedea0SLionel SambucString extensions simply have a string which contains either the value itself 27ebfedea0SLionel Sambucor how it is obtained. 28ebfedea0SLionel Sambuc 29ebfedea0SLionel SambucFor example: 30ebfedea0SLionel Sambuc 31ebfedea0SLionel Sambuc nsComment="This is a Comment" 32ebfedea0SLionel Sambuc 33ebfedea0SLionel SambucMulti-valued extensions have a short form and a long form. The short form 34ebfedea0SLionel Sambucis a list of names and values: 35ebfedea0SLionel Sambuc 36ebfedea0SLionel Sambuc basicConstraints=critical,CA:true,pathlen:1 37ebfedea0SLionel Sambuc 38ebfedea0SLionel SambucThe long form allows the values to be placed in a separate section: 39ebfedea0SLionel Sambuc 40ebfedea0SLionel Sambuc basicConstraints=critical,@bs_section 41ebfedea0SLionel Sambuc 42ebfedea0SLionel Sambuc [bs_section] 43ebfedea0SLionel Sambuc 44ebfedea0SLionel Sambuc CA=true 45ebfedea0SLionel Sambuc pathlen=1 46ebfedea0SLionel Sambuc 47ebfedea0SLionel SambucBoth forms are equivalent. 48ebfedea0SLionel Sambuc 49ebfedea0SLionel SambucThe syntax of raw extensions is governed by the extension code: it can 50ebfedea0SLionel Sambucfor example contain data in multiple sections. The correct syntax to 51ebfedea0SLionel Sambucuse is defined by the extension code itself: check out the certificate 52ebfedea0SLionel Sambucpolicies extension for an example. 53ebfedea0SLionel Sambuc 54ebfedea0SLionel SambucIf an extension type is unsupported then the I<arbitrary> extension syntax 55ebfedea0SLionel Sambucmust be used, see the L<ARBITRARY EXTENSIONS|/"ARBITRARY EXTENSIONS"> section for more details. 56ebfedea0SLionel Sambuc 57ebfedea0SLionel Sambuc=head1 STANDARD EXTENSIONS 58ebfedea0SLionel Sambuc 59ebfedea0SLionel SambucThe following sections describe each supported extension in detail. 60ebfedea0SLionel Sambuc 61ebfedea0SLionel Sambuc=head2 Basic Constraints. 62ebfedea0SLionel Sambuc 63ebfedea0SLionel SambucThis is a multi valued extension which indicates whether a certificate is 64ebfedea0SLionel Sambuca CA certificate. The first (mandatory) name is B<CA> followed by B<TRUE> or 65ebfedea0SLionel SambucB<FALSE>. If B<CA> is B<TRUE> then an optional B<pathlen> name followed by an 66ebfedea0SLionel Sambucnon-negative value can be included. 67ebfedea0SLionel Sambuc 68ebfedea0SLionel SambucFor example: 69ebfedea0SLionel Sambuc 70ebfedea0SLionel Sambuc basicConstraints=CA:TRUE 71ebfedea0SLionel Sambuc 72ebfedea0SLionel Sambuc basicConstraints=CA:FALSE 73ebfedea0SLionel Sambuc 74ebfedea0SLionel Sambuc basicConstraints=critical,CA:TRUE, pathlen:0 75ebfedea0SLionel Sambuc 76ebfedea0SLionel SambucA CA certificate B<must> include the basicConstraints value with the CA field 77ebfedea0SLionel Sambucset to TRUE. An end user certificate must either set CA to FALSE or exclude the 78ebfedea0SLionel Sambucextension entirely. Some software may require the inclusion of basicConstraints 79ebfedea0SLionel Sambucwith CA set to FALSE for end entity certificates. 80ebfedea0SLionel Sambuc 81ebfedea0SLionel SambucThe pathlen parameter indicates the maximum number of CAs that can appear 82ebfedea0SLionel Sambucbelow this one in a chain. So if you have a CA with a pathlen of zero it can 83ebfedea0SLionel Sambuconly be used to sign end user certificates and not further CAs. 84ebfedea0SLionel Sambuc 85ebfedea0SLionel Sambuc 86ebfedea0SLionel Sambuc=head2 Key Usage. 87ebfedea0SLionel Sambuc 88ebfedea0SLionel SambucKey usage is a multi valued extension consisting of a list of names of the 89ebfedea0SLionel Sambucpermitted key usages. 90ebfedea0SLionel Sambuc 91ebfedea0SLionel SambucThe supporte names are: digitalSignature, nonRepudiation, keyEncipherment, 92ebfedea0SLionel SambucdataEncipherment, keyAgreement, keyCertSign, cRLSign, encipherOnly 93ebfedea0SLionel Sambucand decipherOnly. 94ebfedea0SLionel Sambuc 95ebfedea0SLionel SambucExamples: 96ebfedea0SLionel Sambuc 97ebfedea0SLionel Sambuc keyUsage=digitalSignature, nonRepudiation 98ebfedea0SLionel Sambuc 99ebfedea0SLionel Sambuc keyUsage=critical, keyCertSign 100ebfedea0SLionel Sambuc 101ebfedea0SLionel Sambuc 102ebfedea0SLionel Sambuc=head2 Extended Key Usage. 103ebfedea0SLionel Sambuc 104ebfedea0SLionel SambucThis extensions consists of a list of usages indicating purposes for which 105ebfedea0SLionel Sambucthe certificate public key can be used for, 106ebfedea0SLionel Sambuc 107ebfedea0SLionel SambucThese can either be object short names of the dotted numerical form of OIDs. 108ebfedea0SLionel SambucWhile any OID can be used only certain values make sense. In particular the 109ebfedea0SLionel Sambucfollowing PKIX, NS and MS values are meaningful: 110ebfedea0SLionel Sambuc 111ebfedea0SLionel Sambuc Value Meaning 112ebfedea0SLionel Sambuc ----- ------- 113ebfedea0SLionel Sambuc serverAuth SSL/TLS Web Server Authentication. 114ebfedea0SLionel Sambuc clientAuth SSL/TLS Web Client Authentication. 115ebfedea0SLionel Sambuc codeSigning Code signing. 116ebfedea0SLionel Sambuc emailProtection E-mail Protection (S/MIME). 117ebfedea0SLionel Sambuc timeStamping Trusted Timestamping 118ebfedea0SLionel Sambuc msCodeInd Microsoft Individual Code Signing (authenticode) 119ebfedea0SLionel Sambuc msCodeCom Microsoft Commercial Code Signing (authenticode) 120ebfedea0SLionel Sambuc msCTLSign Microsoft Trust List Signing 121ebfedea0SLionel Sambuc msSGC Microsoft Server Gated Crypto 122ebfedea0SLionel Sambuc msEFS Microsoft Encrypted File System 123ebfedea0SLionel Sambuc nsSGC Netscape Server Gated Crypto 124ebfedea0SLionel Sambuc 125ebfedea0SLionel SambucExamples: 126ebfedea0SLionel Sambuc 127ebfedea0SLionel Sambuc extendedKeyUsage=critical,codeSigning,1.2.3.4 128ebfedea0SLionel Sambuc extendedKeyUsage=nsSGC,msSGC 129ebfedea0SLionel Sambuc 130ebfedea0SLionel Sambuc 131ebfedea0SLionel Sambuc=head2 Subject Key Identifier. 132ebfedea0SLionel Sambuc 133ebfedea0SLionel SambucThis is really a string extension and can take two possible values. Either 134ebfedea0SLionel Sambucthe word B<hash> which will automatically follow the guidelines in RFC3280 135ebfedea0SLionel Sambucor a hex string giving the extension value to include. The use of the hex 136ebfedea0SLionel Sambucstring is strongly discouraged. 137ebfedea0SLionel Sambuc 138ebfedea0SLionel SambucExample: 139ebfedea0SLionel Sambuc 140ebfedea0SLionel Sambuc subjectKeyIdentifier=hash 141ebfedea0SLionel Sambuc 142ebfedea0SLionel Sambuc 143ebfedea0SLionel Sambuc=head2 Authority Key Identifier. 144ebfedea0SLionel Sambuc 145ebfedea0SLionel SambucThe authority key identifier extension permits two options. keyid and issuer: 146ebfedea0SLionel Sambucboth can take the optional value "always". 147ebfedea0SLionel Sambuc 148ebfedea0SLionel SambucIf the keyid option is present an attempt is made to copy the subject key 149ebfedea0SLionel Sambucidentifier from the parent certificate. If the value "always" is present 150ebfedea0SLionel Sambucthen an error is returned if the option fails. 151ebfedea0SLionel Sambuc 152ebfedea0SLionel SambucThe issuer option copies the issuer and serial number from the issuer 153ebfedea0SLionel Sambuccertificate. This will only be done if the keyid option fails or 154ebfedea0SLionel Sambucis not included unless the "always" flag will always include the value. 155ebfedea0SLionel Sambuc 156ebfedea0SLionel SambucExample: 157ebfedea0SLionel Sambuc 158ebfedea0SLionel Sambuc authorityKeyIdentifier=keyid,issuer 159ebfedea0SLionel Sambuc 160ebfedea0SLionel Sambuc 161ebfedea0SLionel Sambuc=head2 Subject Alternative Name. 162ebfedea0SLionel Sambuc 163ebfedea0SLionel SambucThe subject alternative name extension allows various literal values to be 164ebfedea0SLionel Sambucincluded in the configuration file. These include B<email> (an email address) 165ebfedea0SLionel SambucB<URI> a uniform resource indicator, B<DNS> (a DNS domain name), B<RID> (a 166ebfedea0SLionel Sambucregistered ID: OBJECT IDENTIFIER), B<IP> (an IP address), B<dirName> 167ebfedea0SLionel Sambuc(a distinguished name) and otherName. 168ebfedea0SLionel Sambuc 169ebfedea0SLionel SambucThe email option include a special 'copy' value. This will automatically 170ebfedea0SLionel Sambucinclude and email addresses contained in the certificate subject name in 171ebfedea0SLionel Sambucthe extension. 172ebfedea0SLionel Sambuc 173ebfedea0SLionel SambucThe IP address used in the B<IP> options can be in either IPv4 or IPv6 format. 174ebfedea0SLionel Sambuc 175ebfedea0SLionel SambucThe value of B<dirName> should point to a section containing the distinguished 176ebfedea0SLionel Sambucname to use as a set of name value pairs. Multi values AVAs can be formed by 177*0a6a1f1dSLionel Sambucprefacing the name with a B<+> character. 178ebfedea0SLionel Sambuc 179ebfedea0SLionel SambucotherName can include arbitrary data associated with an OID: the value 180ebfedea0SLionel Sambucshould be the OID followed by a semicolon and the content in standard 181ebfedea0SLionel SambucL<ASN1_generate_nconf(3)|ASN1_generate_nconf(3)> format. 182ebfedea0SLionel Sambuc 183ebfedea0SLionel SambucExamples: 184ebfedea0SLionel Sambuc 185ebfedea0SLionel Sambuc subjectAltName=email:copy,email:my@other.address,URI:http://my.url.here/ 186ebfedea0SLionel Sambuc subjectAltName=IP:192.168.7.1 187ebfedea0SLionel Sambuc subjectAltName=IP:13::17 188ebfedea0SLionel Sambuc subjectAltName=email:my@other.address,RID:1.2.3.4 189ebfedea0SLionel Sambuc subjectAltName=otherName:1.2.3.4;UTF8:some other identifier 190ebfedea0SLionel Sambuc 191ebfedea0SLionel Sambuc subjectAltName=dirName:dir_sect 192ebfedea0SLionel Sambuc 193ebfedea0SLionel Sambuc [dir_sect] 194ebfedea0SLionel Sambuc C=UK 195ebfedea0SLionel Sambuc O=My Organization 196ebfedea0SLionel Sambuc OU=My Unit 197ebfedea0SLionel Sambuc CN=My Name 198ebfedea0SLionel Sambuc 199ebfedea0SLionel Sambuc 200ebfedea0SLionel Sambuc=head2 Issuer Alternative Name. 201ebfedea0SLionel Sambuc 202ebfedea0SLionel SambucThe issuer alternative name option supports all the literal options of 203ebfedea0SLionel Sambucsubject alternative name. It does B<not> support the email:copy option because 204ebfedea0SLionel Sambucthat would not make sense. It does support an additional issuer:copy option 205ebfedea0SLionel Sambucthat will copy all the subject alternative name values from the issuer 206ebfedea0SLionel Sambuccertificate (if possible). 207ebfedea0SLionel Sambuc 208ebfedea0SLionel SambucExample: 209ebfedea0SLionel Sambuc 210ebfedea0SLionel Sambuc issuserAltName = issuer:copy 211ebfedea0SLionel Sambuc 212ebfedea0SLionel Sambuc 213ebfedea0SLionel Sambuc=head2 Authority Info Access. 214ebfedea0SLionel Sambuc 215ebfedea0SLionel SambucThe authority information access extension gives details about how to access 216ebfedea0SLionel Sambuccertain information relating to the CA. Its syntax is accessOID;location 217ebfedea0SLionel Sambucwhere I<location> has the same syntax as subject alternative name (except 218ebfedea0SLionel Sambucthat email:copy is not supported). accessOID can be any valid OID but only 219ebfedea0SLionel Sambuccertain values are meaningful, for example OCSP and caIssuers. 220ebfedea0SLionel Sambuc 221ebfedea0SLionel SambucExample: 222ebfedea0SLionel Sambuc 223ebfedea0SLionel Sambuc authorityInfoAccess = OCSP;URI:http://ocsp.my.host/ 224ebfedea0SLionel Sambuc authorityInfoAccess = caIssuers;URI:http://my.ca/ca.html 225ebfedea0SLionel Sambuc 226ebfedea0SLionel Sambuc 227ebfedea0SLionel Sambuc=head2 CRL distribution points. 228ebfedea0SLionel Sambuc 229ebfedea0SLionel SambucThis is a multi-valued extension whose options can be either in name:value pair 230ebfedea0SLionel Sambucusing the same form as subject alternative name or a single value representing 231ebfedea0SLionel Sambuca section name containing all the distribution point fields. 232ebfedea0SLionel Sambuc 233ebfedea0SLionel SambucFor a name:value pair a new DistributionPoint with the fullName field set to 234ebfedea0SLionel Sambucthe given value both the cRLissuer and reasons fields are omitted in this case. 235ebfedea0SLionel Sambuc 236ebfedea0SLionel SambucIn the single option case the section indicated contains values for each 237ebfedea0SLionel Sambucfield. In this section: 238ebfedea0SLionel Sambuc 239ebfedea0SLionel SambucIf the name is "fullname" the value field should contain the full name 240ebfedea0SLionel Sambucof the distribution point in the same format as subject alternative name. 241ebfedea0SLionel Sambuc 242ebfedea0SLionel SambucIf the name is "relativename" then the value field should contain a section 243ebfedea0SLionel Sambucname whose contents represent a DN fragment to be placed in this field. 244ebfedea0SLionel Sambuc 245ebfedea0SLionel SambucThe name "CRLIssuer" if present should contain a value for this field in 246ebfedea0SLionel Sambucsubject alternative name format. 247ebfedea0SLionel Sambuc 248ebfedea0SLionel SambucIf the name is "reasons" the value field should consist of a comma 249ebfedea0SLionel Sambucseparated field containing the reasons. Valid reasons are: "keyCompromise", 250ebfedea0SLionel Sambuc"CACompromise", "affiliationChanged", "superseded", "cessationOfOperation", 251ebfedea0SLionel Sambuc"certificateHold", "privilegeWithdrawn" and "AACompromise". 252ebfedea0SLionel Sambuc 253ebfedea0SLionel Sambuc 254ebfedea0SLionel SambucSimple examples: 255ebfedea0SLionel Sambuc 256ebfedea0SLionel Sambuc crlDistributionPoints=URI:http://myhost.com/myca.crl 257ebfedea0SLionel Sambuc crlDistributionPoints=URI:http://my.com/my.crl,URI:http://oth.com/my.crl 258ebfedea0SLionel Sambuc 259ebfedea0SLionel SambucFull distribution point example: 260ebfedea0SLionel Sambuc 261ebfedea0SLionel Sambuc crlDistributionPoints=crldp1_section 262ebfedea0SLionel Sambuc 263ebfedea0SLionel Sambuc [crldp1_section] 264ebfedea0SLionel Sambuc 265ebfedea0SLionel Sambuc fullname=URI:http://myhost.com/myca.crl 266ebfedea0SLionel Sambuc CRLissuer=dirName:issuer_sect 267ebfedea0SLionel Sambuc reasons=keyCompromise, CACompromise 268ebfedea0SLionel Sambuc 269ebfedea0SLionel Sambuc [issuer_sect] 270ebfedea0SLionel Sambuc C=UK 271ebfedea0SLionel Sambuc O=Organisation 272ebfedea0SLionel Sambuc CN=Some Name 273ebfedea0SLionel Sambuc 274ebfedea0SLionel Sambuc=head2 Issuing Distribution Point 275ebfedea0SLionel Sambuc 276ebfedea0SLionel SambucThis extension should only appear in CRLs. It is a multi valued extension 277ebfedea0SLionel Sambucwhose syntax is similar to the "section" pointed to by the CRL distribution 278ebfedea0SLionel Sambucpoints extension with a few differences. 279ebfedea0SLionel Sambuc 280ebfedea0SLionel SambucThe names "reasons" and "CRLissuer" are not recognized. 281ebfedea0SLionel Sambuc 282ebfedea0SLionel SambucThe name "onlysomereasons" is accepted which sets this field. The value is 283ebfedea0SLionel Sambucin the same format as the CRL distribution point "reasons" field. 284ebfedea0SLionel Sambuc 285ebfedea0SLionel SambucThe names "onlyuser", "onlyCA", "onlyAA" and "indirectCRL" are also accepted 286ebfedea0SLionel Sambucthe values should be a boolean value (TRUE or FALSE) to indicate the value of 287ebfedea0SLionel Sambucthe corresponding field. 288ebfedea0SLionel Sambuc 289ebfedea0SLionel SambucExample: 290ebfedea0SLionel Sambuc 291ebfedea0SLionel Sambuc issuingDistributionPoint=critical, @idp_section 292ebfedea0SLionel Sambuc 293ebfedea0SLionel Sambuc [idp_section] 294ebfedea0SLionel Sambuc 295ebfedea0SLionel Sambuc fullname=URI:http://myhost.com/myca.crl 296ebfedea0SLionel Sambuc indirectCRL=TRUE 297ebfedea0SLionel Sambuc onlysomereasons=keyCompromise, CACompromise 298ebfedea0SLionel Sambuc 299ebfedea0SLionel Sambuc [issuer_sect] 300ebfedea0SLionel Sambuc C=UK 301ebfedea0SLionel Sambuc O=Organisation 302ebfedea0SLionel Sambuc CN=Some Name 303ebfedea0SLionel Sambuc 304ebfedea0SLionel Sambuc 305ebfedea0SLionel Sambuc=head2 Certificate Policies. 306ebfedea0SLionel Sambuc 307ebfedea0SLionel SambucThis is a I<raw> extension. All the fields of this extension can be set by 308ebfedea0SLionel Sambucusing the appropriate syntax. 309ebfedea0SLionel Sambuc 310ebfedea0SLionel SambucIf you follow the PKIX recommendations and just using one OID then you just 311ebfedea0SLionel Sambucinclude the value of that OID. Multiple OIDs can be set separated by commas, 312ebfedea0SLionel Sambucfor example: 313ebfedea0SLionel Sambuc 314ebfedea0SLionel Sambuc certificatePolicies= 1.2.4.5, 1.1.3.4 315ebfedea0SLionel Sambuc 316ebfedea0SLionel SambucIf you wish to include qualifiers then the policy OID and qualifiers need to 317ebfedea0SLionel Sambucbe specified in a separate section: this is done by using the @section syntax 318ebfedea0SLionel Sambucinstead of a literal OID value. 319ebfedea0SLionel Sambuc 320ebfedea0SLionel SambucThe section referred to must include the policy OID using the name 321ebfedea0SLionel SambucpolicyIdentifier, cPSuri qualifiers can be included using the syntax: 322ebfedea0SLionel Sambuc 323ebfedea0SLionel Sambuc CPS.nnn=value 324ebfedea0SLionel Sambuc 325ebfedea0SLionel SambucuserNotice qualifiers can be set using the syntax: 326ebfedea0SLionel Sambuc 327ebfedea0SLionel Sambuc userNotice.nnn=@notice 328ebfedea0SLionel Sambuc 329ebfedea0SLionel SambucThe value of the userNotice qualifier is specified in the relevant section. 330ebfedea0SLionel SambucThis section can include explicitText, organization and noticeNumbers 331ebfedea0SLionel Sambucoptions. explicitText and organization are text strings, noticeNumbers is a 332ebfedea0SLionel Sambuccomma separated list of numbers. The organization and noticeNumbers options 333ebfedea0SLionel Sambuc(if included) must BOTH be present. If you use the userNotice option with IE5 334ebfedea0SLionel Sambucthen you need the 'ia5org' option at the top level to modify the encoding: 335ebfedea0SLionel Sambucotherwise it will not be interpreted properly. 336ebfedea0SLionel Sambuc 337ebfedea0SLionel SambucExample: 338ebfedea0SLionel Sambuc 339ebfedea0SLionel Sambuc certificatePolicies=ia5org,1.2.3.4,1.5.6.7.8,@polsect 340ebfedea0SLionel Sambuc 341ebfedea0SLionel Sambuc [polsect] 342ebfedea0SLionel Sambuc 343ebfedea0SLionel Sambuc policyIdentifier = 1.3.5.8 344ebfedea0SLionel Sambuc CPS.1="http://my.host.name/" 345ebfedea0SLionel Sambuc CPS.2="http://my.your.name/" 346ebfedea0SLionel Sambuc userNotice.1=@notice 347ebfedea0SLionel Sambuc 348ebfedea0SLionel Sambuc [notice] 349ebfedea0SLionel Sambuc 350ebfedea0SLionel Sambuc explicitText="Explicit Text Here" 351ebfedea0SLionel Sambuc organization="Organisation Name" 352ebfedea0SLionel Sambuc noticeNumbers=1,2,3,4 353ebfedea0SLionel Sambuc 354ebfedea0SLionel SambucThe B<ia5org> option changes the type of the I<organization> field. In RFC2459 355ebfedea0SLionel Sambucit can only be of type DisplayText. In RFC3280 IA5Strring is also permissible. 356ebfedea0SLionel SambucSome software (for example some versions of MSIE) may require ia5org. 357ebfedea0SLionel Sambuc 358ebfedea0SLionel Sambuc=head2 Policy Constraints 359ebfedea0SLionel Sambuc 360ebfedea0SLionel SambucThis is a multi-valued extension which consisting of the names 361ebfedea0SLionel SambucB<requireExplicitPolicy> or B<inhibitPolicyMapping> and a non negative intger 362ebfedea0SLionel Sambucvalue. At least one component must be present. 363ebfedea0SLionel Sambuc 364ebfedea0SLionel SambucExample: 365ebfedea0SLionel Sambuc 366ebfedea0SLionel Sambuc policyConstraints = requireExplicitPolicy:3 367ebfedea0SLionel Sambuc 368ebfedea0SLionel Sambuc 369ebfedea0SLionel Sambuc=head2 Inhibit Any Policy 370ebfedea0SLionel Sambuc 371ebfedea0SLionel SambucThis is a string extension whose value must be a non negative integer. 372ebfedea0SLionel Sambuc 373ebfedea0SLionel SambucExample: 374ebfedea0SLionel Sambuc 375ebfedea0SLionel Sambuc inhibitAnyPolicy = 2 376ebfedea0SLionel Sambuc 377ebfedea0SLionel Sambuc 378ebfedea0SLionel Sambuc=head2 Name Constraints 379ebfedea0SLionel Sambuc 380ebfedea0SLionel SambucThe name constraints extension is a multi-valued extension. The name should 381ebfedea0SLionel Sambucbegin with the word B<permitted> or B<excluded> followed by a B<;>. The rest of 382ebfedea0SLionel Sambucthe name and the value follows the syntax of subjectAltName except email:copy 383ebfedea0SLionel Sambucis not supported and the B<IP> form should consist of an IP addresses and 384ebfedea0SLionel Sambucsubnet mask separated by a B</>. 385ebfedea0SLionel Sambuc 386ebfedea0SLionel SambucExamples: 387ebfedea0SLionel Sambuc 388ebfedea0SLionel Sambuc nameConstraints=permitted;IP:192.168.0.0/255.255.0.0 389ebfedea0SLionel Sambuc 390ebfedea0SLionel Sambuc nameConstraints=permitted;email:.somedomain.com 391ebfedea0SLionel Sambuc 392ebfedea0SLionel Sambuc nameConstraints=excluded;email:.com 393*0a6a1f1dSLionel Sambuc 394ebfedea0SLionel Sambuc 395ebfedea0SLionel Sambuc=head2 OCSP No Check 396ebfedea0SLionel Sambuc 397ebfedea0SLionel SambucThe OCSP No Check extension is a string extension but its value is ignored. 398ebfedea0SLionel Sambuc 399ebfedea0SLionel SambucExample: 400ebfedea0SLionel Sambuc 401ebfedea0SLionel Sambuc noCheck = ignored 402ebfedea0SLionel Sambuc 403ebfedea0SLionel Sambuc 404ebfedea0SLionel Sambuc=head1 DEPRECATED EXTENSIONS 405ebfedea0SLionel Sambuc 406ebfedea0SLionel SambucThe following extensions are non standard, Netscape specific and largely 407ebfedea0SLionel Sambucobsolete. Their use in new applications is discouraged. 408ebfedea0SLionel Sambuc 409ebfedea0SLionel Sambuc=head2 Netscape String extensions. 410ebfedea0SLionel Sambuc 411ebfedea0SLionel SambucNetscape Comment (B<nsComment>) is a string extension containing a comment 412ebfedea0SLionel Sambucwhich will be displayed when the certificate is viewed in some browsers. 413ebfedea0SLionel Sambuc 414ebfedea0SLionel SambucExample: 415ebfedea0SLionel Sambuc 416ebfedea0SLionel Sambuc nsComment = "Some Random Comment" 417ebfedea0SLionel Sambuc 418ebfedea0SLionel SambucOther supported extensions in this category are: B<nsBaseUrl>, 419ebfedea0SLionel SambucB<nsRevocationUrl>, B<nsCaRevocationUrl>, B<nsRenewalUrl>, B<nsCaPolicyUrl> 420ebfedea0SLionel Sambucand B<nsSslServerName>. 421ebfedea0SLionel Sambuc 422ebfedea0SLionel Sambuc 423ebfedea0SLionel Sambuc=head2 Netscape Certificate Type 424ebfedea0SLionel Sambuc 425ebfedea0SLionel SambucThis is a multi-valued extensions which consists of a list of flags to be 426ebfedea0SLionel Sambucincluded. It was used to indicate the purposes for which a certificate could 427ebfedea0SLionel Sambucbe used. The basicConstraints, keyUsage and extended key usage extensions are 428ebfedea0SLionel Sambucnow used instead. 429ebfedea0SLionel Sambuc 430ebfedea0SLionel SambucAcceptable values for nsCertType are: B<client>, B<server>, B<email>, 431ebfedea0SLionel SambucB<objsign>, B<reserved>, B<sslCA>, B<emailCA>, B<objCA>. 432ebfedea0SLionel Sambuc 433ebfedea0SLionel Sambuc 434ebfedea0SLionel Sambuc=head1 ARBITRARY EXTENSIONS 435ebfedea0SLionel Sambuc 436ebfedea0SLionel SambucIf an extension is not supported by the OpenSSL code then it must be encoded 437ebfedea0SLionel Sambucusing the arbitrary extension format. It is also possible to use the arbitrary 438ebfedea0SLionel Sambucformat for supported extensions. Extreme care should be taken to ensure that 439ebfedea0SLionel Sambucthe data is formatted correctly for the given extension type. 440ebfedea0SLionel Sambuc 441ebfedea0SLionel SambucThere are two ways to encode arbitrary extensions. 442ebfedea0SLionel Sambuc 443ebfedea0SLionel SambucThe first way is to use the word ASN1 followed by the extension content 444ebfedea0SLionel Sambucusing the same syntax as L<ASN1_generate_nconf(3)|ASN1_generate_nconf(3)>. 445ebfedea0SLionel SambucFor example: 446ebfedea0SLionel Sambuc 447ebfedea0SLionel Sambuc 1.2.3.4=critical,ASN1:UTF8String:Some random data 448ebfedea0SLionel Sambuc 449ebfedea0SLionel Sambuc 1.2.3.4=ASN1:SEQUENCE:seq_sect 450ebfedea0SLionel Sambuc 451ebfedea0SLionel Sambuc [seq_sect] 452ebfedea0SLionel Sambuc 453ebfedea0SLionel Sambuc field1 = UTF8:field1 454ebfedea0SLionel Sambuc field2 = UTF8:field2 455ebfedea0SLionel Sambuc 456ebfedea0SLionel SambucIt is also possible to use the word DER to include the raw encoded data in any 457ebfedea0SLionel Sambucextension. 458ebfedea0SLionel Sambuc 459ebfedea0SLionel Sambuc 1.2.3.4=critical,DER:01:02:03:04 460ebfedea0SLionel Sambuc 1.2.3.4=DER:01020304 461ebfedea0SLionel Sambuc 462ebfedea0SLionel SambucThe value following DER is a hex dump of the DER encoding of the extension 463ebfedea0SLionel SambucAny extension can be placed in this form to override the default behaviour. 464ebfedea0SLionel SambucFor example: 465ebfedea0SLionel Sambuc 466ebfedea0SLionel Sambuc basicConstraints=critical,DER:00:01:02:03 467ebfedea0SLionel Sambuc 468ebfedea0SLionel Sambuc=head1 WARNING 469ebfedea0SLionel Sambuc 470ebfedea0SLionel SambucThere is no guarantee that a specific implementation will process a given 471ebfedea0SLionel Sambucextension. It may therefore be sometimes possible to use certificates for 472ebfedea0SLionel Sambucpurposes prohibited by their extensions because a specific application does 473ebfedea0SLionel Sambucnot recognize or honour the values of the relevant extensions. 474ebfedea0SLionel Sambuc 475ebfedea0SLionel SambucThe DER and ASN1 options should be used with caution. It is possible to create 476ebfedea0SLionel Sambuctotally invalid extensions if they are not used carefully. 477ebfedea0SLionel Sambuc 478ebfedea0SLionel Sambuc 479ebfedea0SLionel Sambuc=head1 NOTES 480ebfedea0SLionel Sambuc 481ebfedea0SLionel SambucIf an extension is multi-value and a field value must contain a comma the long 482ebfedea0SLionel Sambucform must be used otherwise the comma would be misinterpreted as a field 483ebfedea0SLionel Sambucseparator. For example: 484ebfedea0SLionel Sambuc 485ebfedea0SLionel Sambuc subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar 486ebfedea0SLionel Sambuc 487ebfedea0SLionel Sambucwill produce an error but the equivalent form: 488ebfedea0SLionel Sambuc 489ebfedea0SLionel Sambuc subjectAltName=@subject_alt_section 490ebfedea0SLionel Sambuc 491ebfedea0SLionel Sambuc [subject_alt_section] 492ebfedea0SLionel Sambuc subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar 493ebfedea0SLionel Sambuc 494ebfedea0SLionel Sambucis valid. 495ebfedea0SLionel Sambuc 496ebfedea0SLionel SambucDue to the behaviour of the OpenSSL B<conf> library the same field name 497ebfedea0SLionel Sambuccan only occur once in a section. This means that: 498ebfedea0SLionel Sambuc 499ebfedea0SLionel Sambuc subjectAltName=@alt_section 500ebfedea0SLionel Sambuc 501ebfedea0SLionel Sambuc [alt_section] 502ebfedea0SLionel Sambuc 503ebfedea0SLionel Sambuc email=steve@here 504ebfedea0SLionel Sambuc email=steve@there 505ebfedea0SLionel Sambuc 506ebfedea0SLionel Sambucwill only recognize the last value. This can be worked around by using the form: 507ebfedea0SLionel Sambuc 508ebfedea0SLionel Sambuc [alt_section] 509ebfedea0SLionel Sambuc 510ebfedea0SLionel Sambuc email.1=steve@here 511ebfedea0SLionel Sambuc email.2=steve@there 512ebfedea0SLionel Sambuc 513ebfedea0SLionel Sambuc=head1 HISTORY 514ebfedea0SLionel Sambuc 515ebfedea0SLionel SambucThe X509v3 extension code was first added to OpenSSL 0.9.2. 516ebfedea0SLionel Sambuc 517ebfedea0SLionel SambucPolicy mappings, inhibit any policy and name constraints support was added in 518ebfedea0SLionel SambucOpenSSL 0.9.8 519ebfedea0SLionel Sambuc 520ebfedea0SLionel SambucThe B<directoryName> and B<otherName> option as well as the B<ASN1> option 521ebfedea0SLionel Sambucfor arbitrary extensions was added in OpenSSL 0.9.8 522ebfedea0SLionel Sambuc 523ebfedea0SLionel Sambuc=head1 SEE ALSO 524ebfedea0SLionel Sambuc 525ebfedea0SLionel SambucL<req(1)|req(1)>, L<ca(1)|ca(1)>, L<x509(1)|x509(1)>, 526ebfedea0SLionel SambucL<ASN1_generate_nconf(3)|ASN1_generate_nconf(3)> 527ebfedea0SLionel Sambuc 528ebfedea0SLionel Sambuc 529ebfedea0SLionel Sambuc=cut 530