1 .\" $OpenBSD: x509v3.cnf.5,v 1.3 2016/12/25 22:15:10 schwarze Exp $
2 .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
4 .\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5 .\" Copyright (c) 2004, 2006, 2013, 2014, 2015, 2016 The OpenSSL Project.
6 .\" All rights reserved.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in
17 .\" the documentation and/or other materials provided with the
20 .\" 3. All advertising materials mentioning features or use of this
21 .\" software must display the following acknowledgment:
22 .\" "This product includes software developed by the OpenSSL Project
23 .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 .\" endorse or promote products derived from this software without
27 .\" prior written permission. For written permission, please contact
28 .\" openssl-core@openssl.org.
30 .\" 5. Products derived from this software may not be called "OpenSSL"
31 .\" nor may "OpenSSL" appear in their names without prior written
32 .\" permission of the OpenSSL Project.
34 .\" 6. Redistributions of any form whatsoever must retain the following
36 .\" "This product includes software developed by the OpenSSL Project
37 .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
52 .Dd $Mdocdate: December 25 2016 $
57 .Nd X.509 V3 certificate extension configuration format
59 Several of the OpenSSL utilities can add extensions to a certificate or
60 certificate request based on the contents of a configuration file.
61 The file format is based on the
65 Typically the application will contain an option to point to an
67 Each line of the extension section takes the form:
69 .D1 Ar extension_name Ns = Ns Oo Cm critical , Oc Ar extension_options
73 is present, then the extension will be critical.
77 depends on the value of
80 There are four main types of extension: string extensions, multi-valued
81 extensions, raw extensions, and arbitrary extensions.
83 String extensions simply have a string which contains either the value
84 itself or how it is obtained.
87 .Dl nsComment="This is a Comment"
89 Multi-valued extensions have a short form and a long form.
90 The short form is a list of names and values:
92 .Dl basicConstraints=critical,CA:true,pathlen:1
94 The long form allows the values to be placed in a separate section:
95 .Bd -literal -offset indent
96 basicConstraints=critical,@bs_section
103 Both forms are equivalent.
105 The syntax of raw extensions is governed by the extension code:
106 it can for example contain data in multiple sections.
107 The correct syntax to use is defined by the extension code itself:
108 check out the certificate policies extension for an example.
110 If an extension type is unsupported, then the arbitrary extension
111 syntax must be used; see the
112 .Sx ARBITRARY EXTENSIONS
113 section for more details.
114 .Sh STANDARD EXTENSIONS
115 The following sections describe each supported extension in detail.
116 .Ss Basic constraints
117 This is a multi-valued extension which indicates whether a certificate
119 The first (mandatory) name is
131 name followed by an non-negative value can be included.
133 .Bd -literal -offset indent
134 basicConstraints=CA:TRUE
135 basicConstraints=CA:FALSE
136 basicConstraints=critical,CA:TRUE, pathlen:0
139 A CA certificate must include the
145 An end user certificate must either set
149 or exclude the extension entirely.
150 Some software may require the inclusion of
156 for end entity certificates.
160 parameter indicates the maximum number of CAs that can appear below
162 So if you have a CA with a
164 of zero it can only be used to sign end user certificates and not
167 Key usage is a multi-valued extension consisting of a list of names of
168 the permitted key usages.
170 The supported names are:
171 .Ic digitalSignature ,
173 .Ic keyEncipherment ,
174 .Ic dataEncipherment ,
182 .Bd -literal -offset indent
183 keyUsage=digitalSignature, nonRepudiation
184 keyUsage=critical, keyCertSign
186 .Ss Extended key usage
187 This extensions consists of a list of usages indicating purposes for
188 which the certificate public key can be used for.
190 These can either be object short names or the dotted numerical form of OIDs.
191 While any OID can be used, only certain values make sense.
192 In particular the following PKIX, NS and MS values are meaningful:
193 .Bl -column emailProtection
194 .It Em value Ta Em meaning
195 .It Ic serverAuth Ta SSL/TLS web server authentication
196 .It Ic clientAuth Ta SSL/TLS web client authentication
197 .It Ic codeSigning Ta code signing
198 .It Ic emailProtection Ta E-mail protection (S/MIME)
199 .It Ic timeStamping Ta trusted timestamping
200 .It Ic OCSPSigning Ta OCSP signing
201 .It Ic ipsecIKE Ta IPsec internet key exchange
202 .It Ic msCodeInd Ta Microsoft individual code signing (authenticode)
203 .It Ic msCodeCom Ta Microsoft commercial code signing (authenticode)
204 .It Ic msCTLSign Ta Microsoft trust list signing
205 .It Ic msEFS Ta Microsoft encrypted file system
209 .Bd -literal -offset indent
210 extendedKeyUsage=critical,codeSigning,1.2.3.4
211 extendedKeyUsage=serverAuth,clientAuth
213 .Ss Subject key identifier
214 This is really a string extension and can take two possible values.
217 which will automatically follow the guidelines in RFC 3280
218 or a hex string giving the extension value to include.
219 The use of the hex string is strongly discouraged.
222 .Dl subjectKeyIdentifier=hash
223 .Ss Authority key identifier
224 The authority key identifier extension permits two options,
228 both can take the optional value
233 option is present, an attempt is made to copy the subject
234 key identifier from the parent certificate.
237 is present, then an error is returned if the option fails.
241 option copies the issuer and serial number from the issuer certificate.
242 This will only be done if the
244 option fails or is not included unless the
246 flag will always include the value.
249 .Dl authorityKeyIdentifier=keyid,issuer
250 .Ss Subject alternative name
251 The subject alternative name extension allows various literal values to
252 be included in the configuration file.
257 (a uniform resource indicator),
261 (a registered ID: OBJECT IDENTIFIER),
265 (a distinguished name), and
270 option can include a special
273 This will automatically include any email addresses contained in the
274 certificate subject name in the extension.
276 The IP address used in the
278 options can be in either IPv4 or IPv6 format.
282 should point to a section containing the distinguished name to use as a
283 set of name value pairs.
284 Multi values AVAs can be formed by prefacing the name with a
289 can include arbitrary data associated with an OID: the value should
290 be the OID followed by a semicolon and the content in standard
291 .Xr ASN1_generate_nconf 3
294 .Bd -literal -offset 2n
295 subjectAltName=email:copy,email:my@other.address,URI:http://my.url.here/
296 subjectAltName=IP:192.168.7.1
297 subjectAltName=IP:13::17
298 subjectAltName=email:my@other.address,RID:1.2.3.4
299 subjectAltName=otherName:1.2.3.4;UTF8:some other identifier
301 subjectAltName=dirName:dir_sect
309 .Ss Issuer alternative name
310 The issuer alternative name option supports all the literal options of
311 subject alternative name.
312 It does not support the
313 .Ic email : Ns Cm copy
314 option because that would not make sense.
315 It does support an additional
316 .Ic issuer : Ns Cm copy
317 option that will copy all the subject alternative name values from
318 the issuer certificate (if possible).
321 .Dl issuserAltName = issuer:copy
322 .Ss Authority info access
323 The authority information access extension gives details about how to
324 access certain information relating to the CA.
326 .Ar accessOID ; location
329 has the same syntax as subject alternative name (except that
330 .Ic email : Ns Cm copy
333 can be any valid OID but only certain values are meaningful,
339 .Bd -literal -offset indent
340 authorityInfoAccess = OCSP;URI:http://ocsp.my.host/
341 authorityInfoAccess = caIssuers;URI:http://my.ca/ca.html
343 .Ss CRL distribution points
344 This is a multi-valued extension whose options can be either in
345 .Ar name : Ns Ar value
346 pair form using the same form as subject alternative name or a
347 single value representing a section name containing all the
348 distribution point fields.
351 .Ar name : Ns Ar value
352 pair a new DistributionPoint with the fullName field set to the
353 given value, both the cRLissuer and reasons fields are omitted in
356 In the single option case, the section indicated contains values
362 the value field should contain the full name of the distribution
363 point in the same format as subject alternative name.
367 then the value field should contain a section name whose contents
368 represent a DN fragment to be placed in this field.
372 if present, should contain a value for this field in subject
373 alternative name format.
377 the value field should consist of a comma separated field containing
382 .Cm affiliationChanged ,
384 .Cm cessationOfOperation ,
385 .Cm certificateHold ,
386 .Cm privilegeWithdrawn ,
391 .Bd -literal -offset indent
392 crlDistributionPoints=URI:http://myhost.com/myca.crl
393 crlDistributionPoints=URI:http://my.com/my.crl,URI:http://oth.com/my.crl
396 Full distribution point example:
397 .Bd -literal -offset indent
398 crlDistributionPoints=crldp1_section
401 fullname=URI:http://myhost.com/myca.crl
402 CRLissuer=dirName:issuer_sect
403 reasons=keyCompromise, CACompromise
410 .Ss Issuing distribution point
411 This extension should only appear in CRLs.
412 It is a multi-valued extension whose syntax is similar to the "section"
413 pointed to by the CRL distribution points extension with a few
424 is accepted, which sets this field.
425 The value is in the same format as the CRL distribution point
436 The values should be a boolean values
440 to indicate the value of the corresponding field.
442 .Bd -literal -offset indent
443 issuingDistributionPoint=critical, @idp_section
446 fullname=URI:http://myhost.com/myca.crl
448 onlysomereasons=keyCompromise, CACompromise
455 .Ss Certificate policies
456 This is a raw extension.
457 All the fields of this extension can be set by using the appropriate
460 If you follow the PKIX recommendations and just use one OID, then you
461 just include the value of that OID.
462 Multiple OIDs can be set separated by commas, for example:
464 .Dl certificatePolicies= 1.2.4.5, 1.1.3.4
466 If you wish to include qualifiers, then the policy OID and qualifiers
467 need to be specified in a separate section: this is done by using the
469 syntax instead of a literal OID value.
471 The section referred to must include the policy OID using the name
472 .Ic policyIdentifier .
474 qualifiers can be included using the syntax:
476 .D1 Ic CPS . Ns Ar nnn Ns = Ns Ar value
479 qualifiers can be set using the syntax:
481 .D1 Ic userNotice . Ns Ar nnn Ns =@ Ns Ar notice
485 qualifier is specified in the relevant section.
486 This section can include
498 is a comma separated list of numbers.
503 options (if included) must
508 option with IE5 then you need the
510 option at the top level to modify the encoding: otherwise it will
511 not be interpreted properly.
513 .Bd -literal -offset indent
514 certificatePolicies=ia5org,1.2.3.4,1.5.6.7.8,@polsect
517 policyIdentifier = 1.3.5.8
518 CPS.1="http://my.host.name/"
519 CPS.2="http://my.your.name/"
523 explicitText="Explicit Text Here"
524 organization="Organisation Name"
525 noticeNumbers=1,2,3,4
530 option changes the type of the
533 In RFC 2459, it can only be of type
538 Some software (for example some versions of MSIE) may require
540 .Ss Policy constraints
541 This is a multi-valued extension which consists of the names
542 .Ic requireExplicitPolicy
544 .Ic inhibitPolicyMapping
545 and a non-negative integer value.
546 At least one component must be present.
549 .Dl policyConstraints = requireExplicitPolicy:3
550 .Ss Inhibit any policy
551 This is a string extension whose value must be a non-negative integer.
554 .Dl inhibitAnyPolicy = 2
556 The name constraints extension is a multi-valued extension.
557 The name should begin with the word
561 followed by a semicolon.
562 The rest of the name and the value follows the syntax of subjectAltName
564 .Ic email : Ns Cm copy
565 is not supported and the
567 form should consist of an IP addresses and subnet mask separated
570 .Bd -literal -offset indent
571 nameConstraints=permitted;IP:192.168.0.0/255.255.0.0
572 nameConstraints=permitted;email:.somedomain.com
573 nameConstraints=excluded;email:.com
576 The OCSP no check extension is a string extension,
577 but its value is ignored.
580 .Dl noCheck = ignored
581 .Ss TLS Feature (aka must staple)
582 This is a multi-valued extension consisting of a list of TLS extension
584 Each identifier may be a number in the range from 0 to 65535 or a
586 When a TLS client sends a listed extension, the TLS server is expected
587 to include that extension in its reply.
589 The supported names are:
592 .Cm status_request_v2 .
595 .Dl tlsfeature = status_request
596 .Sh DEPRECATED EXTENSIONS
597 The following extensions are non-standard, Netscape specific and largely
599 Their use in new applications is discouraged.
600 .Ss Netscape string extensions
603 is a string extension containing a comment which will be displayed when
604 the certificate is viewed in some browsers.
607 .Dl nsComment = "Some Random Comment"
609 Other supported extensions in this category are:
611 .Ic nsRevocationUrl ,
612 .Ic nsCaRevocationUrl ,
616 .Ic nsSslServerName .
617 .Ss Netscape certificate type
618 This is a multi-valued extensions which consists of a list of flags to
620 It was used to indicate the purposes for which a certificate could be
623 .Ic basicConstraints ,
625 and extended key usage extensions are now used instead.
627 Acceptable values for
638 .Sh ARBITRARY EXTENSIONS
639 If an extension is not supported by the OpenSSL code, then it must
640 be encoded using the arbitrary extension format.
641 It is also possible to use the arbitrary format for supported
643 Extreme care should be taken to ensure that the data is formatted
644 correctly for the given extension type.
646 There are two ways to encode arbitrary extensions.
648 The first way is to use the word
650 followed by the extension content using the same syntax as
651 .Xr ASN1_generate_nconf 3 .
653 .Bd -literal -offset indent
654 1.2.3.4=critical,ASN1:UTF8String:Some random data
655 1.2.3.4=ASN1:SEQUENCE:seq_sect
662 It is also possible to use the word
664 to include the raw encoded data in any extension.
665 .Bd -literal -offset indent
666 1.2.3.4=critical,DER:01:02:03:04
672 is a hex dump of the DER encoding of the extension.
673 Any extension can be placed in this form to override the default behaviour.
676 .Dl basicConstraints=critical,DER:00:01:02:03
678 .Bl -tag -width /etc/ssl/x509v3.cnf -compact
679 .It Pa /etc/ssl/x509v3.cnf
680 standard configuration file
684 .Xr ASN1_generate_nconf 3 ,
687 X509v3 extension code was first added to OpenSSL 0.9.2.
689 There is no guarantee that a specific implementation will process a
691 It may therefore sometimes be possible to use certificates for purposes
692 prohibited by their extensions because a specific application does not
693 recognize or honour the values of the relevant extensions.
699 options should be used with caution.
700 It is possible to create totally invalid extensions if they are not used
703 If an extension is multi-value and a field value must contain a comma,
704 the long form must be used.
705 Otherwise the comma would be misinterpreted as a field separator.
708 .Dl subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar
710 will produce an error, but the following form is valid:
711 .Bd -literal -offset indent
712 subjectAltName=@subject_alt_section
714 [subject_alt_section]
715 subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar
718 Due to the behaviour of the OpenSSL CONF library, the same field
719 name can only occur once in a section.
721 .Bd -literal -offset indent
722 subjectAltName=@alt_section
729 will only use the last value.
730 This can be worked around by using the form:
731 .Bd -literal -offset indent