2 * Copyright (c) 2000-2009,2011,2012,2014,2016 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
23 * CertExtensions.h -- X.509 Cert Extensions as C structs
26 #ifndef _CERT_EXTENSIONS_H_
27 #define _CERT_EXTENSIONS_H_
29 #include <Security/SecBase.h>
33 #include <Security/cssmtype.h>
34 #include <Security/x509defs.h> /* CSSM_X509_RDN_PTR */
35 #pragma clang diagnostic push
36 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
38 #else /* SEC_OS_IPHONE */
41 #include <libDER/libDER.h>
43 #endif /* SEC_OS_IPHONE */
46 *** Structs for declaring extension-specific data.
50 * GeneralName, used in AuthorityKeyID, SubjectAltName, and
53 * For now, we just provide explicit support for the types which are
54 * represented as IA5Strings, OIDs, and octet strings. Constructed types
55 * such as EDIPartyName and x400Address are not explicitly handled
56 * right now and must be encoded and decoded by the caller. (See exception
57 * for Name and OtherName, below). In those cases the SecECGeneralName.name.Data / CE_GeneralName.name.Data field
58 * represents the BER contents octets; SecCEGeneralName.name.Length / CE_GeneralName.name.Length is the
59 * length of the contents; the tag of the field is not needed - the BER
60 * encoding uses context-specific implicit tagging. The berEncoded field
61 * is set to true / CSSM_TRUE in these case. Simple types have berEncoded = false / CSSM_FALSE.
63 * In the case of a GeneralName in the form of a Name, we parse the Name
64 * into a CSSM_X509_NAME and place a pointer to the CSSM_X509_NAME in the
65 * CE_GeneralName.name.Data field. SecCEGeneralName.name.Length / CE_GeneralName.name.Length is set to
66 * sizeof(CSSM_X509_NAME). In this case berEncoded is false.
68 * In the case of a GeneralName in the form of a OtherName, we parse the fields
69 * into a CE_OtherName and place a pointer to the SecCEOtherName / CE_OtherName in the
70 * SecCEGeneralName.name.Data / CE_GeneralName.name.Data field. SecCEGeneralName.name.Length / CE_GeneralName.name.Length is set to
71 * sizeof(SecCEOtherName) / sizeof(CE_OtherName). In this case berEncoded is false.
73 * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
75 * GeneralName ::= CHOICE {
76 * otherName [0] OtherName
77 * rfc822Name [1] IA5String,
78 * dNSName [2] IA5String,
79 * x400Address [3] ORAddress,
80 * directoryName [4] Name,
81 * ediPartyName [5] EDIPartyName,
82 * uniformResourceIdentifier [6] IA5String,
83 * iPAddress [7] OCTET STRING,
84 * registeredID [8] OBJECT IDENTIFIER}
86 * OtherName ::= SEQUENCE {
87 * type-id OBJECT IDENTIFIER,
88 * value [0] EXPLICIT ANY DEFINED BY type-id }
90 * EDIPartyName ::= SEQUENCE {
91 * nameAssigner [0] DirectoryString OPTIONAL,
92 * partyName [1] DirectoryString }
95 typedef enum __CE_GeneralNameType
{
105 } CE_GeneralNameType
;
107 #define SecCEGeneralNameType CE_GeneralNameType
111 typedef struct __CE_OtherName
{
113 CSSM_DATA value
; // unparsed, BER-encoded
114 } CE_OtherName DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
116 typedef struct __CE_GeneralName
{
117 CE_GeneralNameType nameType
; // GNT_RFC822Name, etc.
118 CSSM_BOOL berEncoded
;
120 } CE_GeneralName DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
122 typedef struct __CE_GeneralNames
{
124 CE_GeneralName
*generalName
;
125 } CE_GeneralNames DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
131 DERItem value
; // unparsed, BER-encoded
135 SecCEGeneralNameType nameType
; // GNT_RFC822Name, etc.
142 SecCEGeneralName
*generalName
;
145 #endif /* SEC_OS_IPHONE */
148 * id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 35 }
150 * AuthorityKeyIdentifier ::= SEQUENCE {
151 * keyIdentifier [0] KeyIdentifier OPTIONAL,
152 * authorityCertIssuer [1] GeneralNames OPTIONAL,
153 * authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL }
155 * KeyIdentifier ::= OCTET STRING
157 * CSSM OID = CSSMOID_AuthorityKeyIdentifier
160 typedef struct __CE_AuthorityKeyID
{
161 CSSM_BOOL keyIdentifierPresent
;
162 CSSM_DATA keyIdentifier
;
163 CSSM_BOOL generalNamesPresent
;
164 CE_GeneralNames
*generalNames
;
165 CSSM_BOOL serialNumberPresent
;
166 CSSM_DATA serialNumber
;
167 } CE_AuthorityKeyID DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
170 bool keyIdentifierPresent
;
171 DERItem keyIdentifier
;
172 bool generalNamesPresent
;
173 SecCEGeneralNames
*generalNames
;
174 bool serialNumberPresent
;
175 DERItem serialNumber
;
176 } SecCEAuthorityKeyID
;
177 #endif /* SEC_OS_IPHONE */
180 * id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 14 }
181 * SubjectKeyIdentifier ::= KeyIdentifier
183 * CSSM OID = CSSMOID_SubjectKeyIdentifier
186 typedef CSSM_DATA CE_SubjectKeyID DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
188 typedef DERItem SecCESubjectKeyID
;
189 #endif /* SEC_OS_IPHONE */
192 * id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 }
194 * KeyUsage ::= BIT STRING {
195 * digitalSignature (0),
196 * nonRepudiation (1),
197 * keyEncipherment (2),
198 * dataEncipherment (3),
205 * CSSM OID = CSSMOID_KeyUsage
209 typedef uint16 CE_KeyUsage DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
211 typedef uint16_t SecCEKeyUsage
;
212 #endif /* SEC_OS_IPHONE */
215 #define CE_KU_DigitalSignature 0x8000
216 #define CE_KU_NonRepudiation 0x4000
217 #define CE_KU_KeyEncipherment 0x2000
218 #define CE_KU_DataEncipherment 0x1000
219 #define CE_KU_KeyAgreement 0x0800
220 #define CE_KU_KeyCertSign 0x0400
221 #define CE_KU_CRLSign 0x0200
222 #define CE_KU_EncipherOnly 0x0100
223 #define CE_KU_DecipherOnly 0x0080
224 #else /* SEC_OS_IPHONE */
225 #define SecCEKU_DigitalSignature 0x8000
226 #define SecCEKU_NonRepudiation 0x4000
227 #define SecCEKU_KeyEncipherment 0x2000
228 #define SecCEKU_DataEncipherment 0x1000
229 #define SecCEKU_KeyAgreement 0x0800
230 #define SecCEKU_KeyCertSign 0x0400
231 #define SecCEKU_CRLSign 0x0200
232 #define SecCEKU_EncipherOnly 0x0100
233 #define SecCEKU_DecipherOnly 0x0080
234 #endif /* SEC_OS_IPHONE */
237 * id-ce-cRLReason OBJECT IDENTIFIER ::= { id-ce 21 }
239 * -- reasonCode ::= { CRLReason }
241 * CRLReason ::= ENUMERATED {
245 * affiliationChanged (3),
247 * cessationOfOperation (5),
248 * certificateHold (6),
249 * removeFromCRL (8) }
251 * CSSM OID = CSSMOID_CrlReason
255 typedef uint32 CE_CrlReason DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
257 typedef uint32_t SecCECrlReason
;
258 #endif /* SEC_OS_IPHONE */
261 #define CE_CR_Unspecified 0
262 #define CE_CR_KeyCompromise 1
263 #define CE_CR_CACompromise 2
264 #define CE_CR_AffiliationChanged 3
265 #define CE_CR_Superseded 4
266 #define CE_CR_CessationOfOperation 5
267 #define CE_CR_CertificateHold 6
268 #define CE_CR_RemoveFromCRL 8
270 #define SecCECR_Unspecified 0
271 #define SecCECR_KeyCompromise 1
272 #define SecCECR_CACompromise 2
273 #define SecCECR_AffiliationChanged 3
274 #define SecCECR_Superseded 4
275 #define SecCECR_CessationOfOperation 5
276 #define SecCECR_CertificateHold 6
277 #define SecCECR_RemoveFromCRL 8
278 #endif /* SEC_OS_IPHONE */
281 * id-ce-subjectAltName OBJECT IDENTIFIER ::= { id-ce 17 }
283 * SubjectAltName ::= GeneralNames
285 * CSSM OID = CSSMOID_SubjectAltName
287 * GeneralNames defined above.
291 * id-ce-extKeyUsage OBJECT IDENTIFIER ::= {id-ce 37}
293 * ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId*
295 * KeyPurposeId ::= OBJECT IDENTIFIER
297 * CSSM OID = CSSMOID_ExtendedKeyUsage
300 typedef struct __CE_ExtendedKeyUsage
{
302 CSSM_OID_PTR purposes
; // in Intel pre-encoded format
303 } CE_ExtendedKeyUsage
;
308 uint32_t numPurposes
;
309 DERItem
*purposes
; // in Intel pre-encoded format
310 } SecCEExtendedKeyUsage
;
311 #endif /* SEC_OS_IPHONE */
314 * id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 }
316 * BasicConstraints ::= SEQUENCE {
317 * cA BOOLEAN DEFAULT FALSE,
318 * pathLenConstraint INTEGER (0..MAX) OPTIONAL }
320 * CSSM OID = CSSMOID_BasicConstraints
323 typedef struct __CE_BasicConstraints
{
325 CSSM_BOOL pathLenConstraintPresent
;
326 uint32 pathLenConstraint
;
327 } CE_BasicConstraints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
335 bool pathLenConstraintPresent
;
336 uint32_t pathLenConstraint
;
337 } SecCEBasicConstraints
;
342 bool requireExplicitPolicyPresent
;
343 uint32_t requireExplicitPolicy
;
344 bool inhibitPolicyMappingPresent
;
345 uint32_t inhibitPolicyMapping
;
346 } SecCEPolicyConstraints
;
347 #endif /* SEC_OS_IPHONE */
350 * id-ce-certificatePolicies OBJECT IDENTIFIER ::= { id-ce 32 }
352 * certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
354 * PolicyInformation ::= SEQUENCE {
355 * policyIdentifier CertPolicyId,
356 * policyQualifiers SEQUENCE SIZE (1..MAX) OF
357 * PolicyQualifierInfo OPTIONAL }
359 * CertPolicyId ::= OBJECT IDENTIFIER
361 * PolicyQualifierInfo ::= SEQUENCE {
362 * policyQualifierId PolicyQualifierId,
363 * qualifier ANY DEFINED BY policyQualifierId }
365 * -- policyQualifierIds for Internet policy qualifiers
367 * id-qt OBJECT IDENTIFIER ::= { id-pkix 2 }
368 * id-qt-cps OBJECT IDENTIFIER ::= { id-qt 1 }
369 * id-qt-unotice OBJECT IDENTIFIER ::= { id-qt 2 }
371 * PolicyQualifierId ::=
372 * OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
374 * Qualifier ::= CHOICE {
376 * userNotice UserNotice }
378 * CPSuri ::= IA5String
380 * UserNotice ::= SEQUENCE {
381 * noticeRef NoticeReference OPTIONAL,
382 * explicitText DisplayText OPTIONAL}
384 * NoticeReference ::= SEQUENCE {
385 * organization DisplayText,
386 * noticeNumbers SEQUENCE OF INTEGER }
388 * DisplayText ::= CHOICE {
389 * visibleString VisibleString (SIZE (1..200)),
390 * bmpString BMPString (SIZE (1..200)),
391 * utf8String UTF8String (SIZE (1..200)) }
393 * CSSM OID = CSSMOID_CertificatePolicies
395 * We only support down to the level of Qualifier, and then only the CPSuri
396 * choice. UserNotice is transmitted to and from this library as a raw
397 * CSSM_DATA containing the BER-encoded UserNotice sequence.
401 typedef struct __CE_PolicyQualifierInfo
{
402 CSSM_OID policyQualifierId
; // CSSMOID_QT_CPS, CSSMOID_QT_UNOTICE
403 CSSM_DATA qualifier
; // CSSMOID_QT_CPS: IA5String contents
408 DERItem policyQualifierId
; // CSSMOID_QT_CPS, CSSMOID_QT_UNOTICE
409 DERItem qualifier
; // CSSMOID_QT_CPS: IA5String contents
410 } SecCEPolicyQualifierInfo
;
414 DERItem policyIdentifier
;
415 DERItem policyQualifiers
;
416 } SecCEPolicyInformation
;
421 size_t numPolicies
; // size of *policies;
422 SecCEPolicyInformation
*policies
;
423 } SecCECertificatePolicies
;
426 DERItem issuerDomainPolicy
;
427 DERItem subjectDomainPolicy
;
428 } SecCEPolicyMapping
;
431 PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE {
432 issuerDomainPolicy CertPolicyId,
433 subjectDomainPolicy CertPolicyId }
438 size_t numMappings
; // size of *mappings;
439 SecCEPolicyMapping
*mappings
;
440 } SecCEPolicyMappings
;
443 InhibitAnyPolicy ::= SkipCerts
444 SkipCerts ::= INTEGER (0..MAX)
450 } SecCEInhibitAnyPolicy
;
451 #endif /* SEC_OS_IPHONE */
452 // CSSMOID_QT_UNOTICE : Sequence contents
454 } CE_PolicyQualifierInfo DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
456 typedef struct __CE_PolicyInformation
{
457 CSSM_OID certPolicyId
;
458 uint32 numPolicyQualifiers
; // size of *policyQualifiers;
459 CE_PolicyQualifierInfo
*policyQualifiers
;
460 } CE_PolicyInformation DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
462 typedef struct __CE_CertPolicies
{
463 uint32 numPolicies
; // size of *policies;
464 CE_PolicyInformation
*policies
;
465 } CE_CertPolicies DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
468 * netscape-cert-type, a bit string.
470 * CSSM OID = CSSMOID_NetscapeCertType
472 * Bit fields defined in oidsattr.h: CE_NCT_SSL_Client, etc.
474 typedef uint16 CE_NetscapeCertType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
477 * CRLDistributionPoints.
479 * id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::= { id-ce 31 }
481 * cRLDistributionPoints ::= {
482 * CRLDistPointsSyntax }
484 * CRLDistPointsSyntax ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
486 * NOTE: RFC 2459 claims that the tag for the optional DistributionPointName
487 * is IMPLICIT as shown here, but in practice it is EXPLICIT. It has to be -
488 * because the underlying type also uses an implicit tag for distinguish
491 * DistributionPoint ::= SEQUENCE {
492 * distributionPoint [0] DistributionPointName OPTIONAL,
493 * reasons [1] ReasonFlags OPTIONAL,
494 * cRLIssuer [2] GeneralNames OPTIONAL }
496 * DistributionPointName ::= CHOICE {
497 * fullName [0] GeneralNames,
498 * nameRelativeToCRLIssuer [1] RelativeDistinguishedName }
500 * ReasonFlags ::= BIT STRING {
504 * affiliationChanged (3),
506 * cessationOfOperation (5),
507 * certificateHold (6) }
509 * CSSM OID = CSSMOID_CrlDistributionPoints
513 * Note that this looks similar to CE_CrlReason, but that's an enum and this
514 * is an OR-able bit string.
516 typedef uint8 CE_CrlDistReasonFlags DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
518 #define CE_CD_Unspecified 0x80
519 #define CE_CD_KeyCompromise 0x40
520 #define CE_CD_CACompromise 0x20
521 #define CE_CD_AffiliationChanged 0x10
522 #define CE_CD_Superseded 0x08
523 #define CE_CD_CessationOfOperation 0x04
524 #define CE_CD_CertificateHold 0x02
526 typedef enum __CE_CrlDistributionPointNameType
{
528 CE_CDNT_NameRelativeToCrlIssuer
529 } CE_CrlDistributionPointNameType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
531 typedef struct __CE_DistributionPointName
{
532 CE_CrlDistributionPointNameType nameType
;
534 CE_GeneralNames
*fullName
;
535 CSSM_X509_RDN_PTR rdn
;
537 } CE_DistributionPointName DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
540 * The top-level CRLDistributionPoint.
541 * All fields are optional; NULL pointers indicate absence.
543 typedef struct __CE_CRLDistributionPoint
{
544 CE_DistributionPointName
*distPointName
;
545 CSSM_BOOL reasonsPresent
;
546 CE_CrlDistReasonFlags reasons
;
547 CE_GeneralNames
*crlIssuer
;
548 } CE_CRLDistributionPoint DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
550 typedef struct __CE_CRLDistPointsSyntax
{
551 uint32 numDistPoints
;
552 CE_CRLDistributionPoint
*distPoints
;
553 } CE_CRLDistPointsSyntax DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
556 * Authority Information Access and Subject Information Access.
558 * CSSM OID = CSSMOID_AuthorityInfoAccess
559 * CSSM OID = CSSMOID_SubjectInfoAccess
561 * SubjAuthInfoAccessSyntax ::=
562 * SEQUENCE SIZE (1..MAX) OF AccessDescription
564 * AccessDescription ::= SEQUENCE {
565 * accessMethod OBJECT IDENTIFIER,
566 * accessLocation GeneralName }
568 typedef struct __CE_AccessDescription
{
569 CSSM_OID accessMethod
;
570 CE_GeneralName accessLocation
;
571 } CE_AccessDescription DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
573 typedef struct __CE_AuthorityInfoAccess
{
574 uint32 numAccessDescriptions
;
575 CE_AccessDescription
*accessDescriptions
;
576 } CE_AuthorityInfoAccess DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
579 * Qualified Certificate Statement support, per RFC 3739.
581 * First, NameRegistrationAuthorities, a component of
582 * SemanticsInformation; it's the same as a GeneralNames -
583 * a sequence of GeneralName.
585 typedef CE_GeneralNames CE_NameRegistrationAuthorities DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
588 * SemanticsInformation, identified as the qcType field
589 * of a CE_QC_Statement for statementId value id-qcs-pkixQCSyntax-v2.
590 * Both fields optional; at least one must be present.
592 typedef struct __CE_SemanticsInformation
{
593 CSSM_OID
*semanticsIdentifier
;
594 CE_NameRegistrationAuthorities
*nameRegistrationAuthorities
;
595 } CE_SemanticsInformation DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
598 * One Qualified Certificate Statement.
599 * The statementId OID is required; zero or one of {semanticsInfo,
600 * otherInfo} can be valid, depending on the value of statementId.
601 * For statementId id-qcs-pkixQCSyntax-v2 (CSSMOID_OID_QCS_SYNTAX_V2),
602 * the semanticsInfo field may be present; otherwise, DER-encoded
603 * information may be present in otherInfo. Both semanticsInfo and
604 * otherInfo are optional.
606 typedef struct __CE_QC_Statement
{
607 CSSM_OID statementId
;
608 CE_SemanticsInformation
*semanticsInfo
;
609 CSSM_DATA
*otherInfo
;
610 } CE_QC_Statement DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
613 * The top-level Qualified Certificate Statements extension.
615 typedef struct __CE_QC_Statements
{
616 uint32 numQCStatements
;
617 CE_QC_Statement
*qcStatements
;
618 } CE_QC_Statements DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
620 /*** CRL extensions ***/
623 * cRLNumber, an integer.
625 * CSSM OID = CSSMOID_CrlNumber
627 typedef uint32 CE_CrlNumber
;
630 * deltaCRLIndicator, an integer.
632 * CSSM OID = CSSMOID_DeltaCrlIndicator
634 typedef uint32 CE_DeltaCrl
;
637 * IssuingDistributionPoint
639 * id-ce-issuingDistributionPoint OBJECT IDENTIFIER ::= { id-ce 28 }
641 * issuingDistributionPoint ::= SEQUENCE {
642 * distributionPoint [0] DistributionPointName OPTIONAL,
643 * onlyContainsUserCerts [1] BOOLEAN DEFAULT FALSE,
644 * onlyContainsCACerts [2] BOOLEAN DEFAULT FALSE,
645 * onlySomeReasons [3] ReasonFlags OPTIONAL,
646 * indirectCRL [4] BOOLEAN DEFAULT FALSE }
648 * CSSM OID = CSSMOID_IssuingDistributionPoint
650 typedef struct __CE_IssuingDistributionPoint
{
651 CE_DistributionPointName
*distPointName
; // optional
652 CSSM_BOOL onlyUserCertsPresent
;
653 CSSM_BOOL onlyUserCerts
;
654 CSSM_BOOL onlyCACertsPresent
;
655 CSSM_BOOL onlyCACerts
;
656 CSSM_BOOL onlySomeReasonsPresent
;
657 CE_CrlDistReasonFlags onlySomeReasons
;
658 CSSM_BOOL indirectCrlPresent
;
659 CSSM_BOOL indirectCrl
;
660 } CE_IssuingDistributionPoint DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
665 * id-ce-nameConstraints OBJECT IDENTIFIER ::= { id-ce 30 }
667 * NameConstraints ::= SEQUENCE {
668 * permittedSubtrees [0] GeneralSubtrees OPTIONAL,
669 * excludedSubtrees [1] GeneralSubtrees OPTIONAL }
671 * GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree
673 * GeneralSubtree ::= SEQUENCE {
675 * minimum [0] BaseDistance DEFAULT 0,
676 * maximum [1] BaseDistance OPTIONAL }
678 * BaseDistance ::= INTEGER (0..MAX)
680 typedef struct __CE_GeneralSubtree
{
681 CE_GeneralNames
*base
;
682 uint32 minimum
; // default=0
683 CSSM_BOOL maximumPresent
;
684 uint32 maximum
; // optional
685 } CE_GeneralSubtree DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
687 typedef struct __CE_GeneralSubtrees
{
689 CE_GeneralSubtree
*subtrees
;
690 } CE_GeneralSubtrees DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
692 typedef struct __CE_NameConstraints
{
693 CE_GeneralSubtrees
*permitted
; // optional
694 CE_GeneralSubtrees
*excluded
; // optional
695 } CE_NameConstraints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
700 * id-ce-policyMappings OBJECT IDENTIFIER ::= { id-ce 33 }
702 * PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE {
703 * issuerDomainPolicy CertPolicyId,
704 * subjectDomainPolicy CertPolicyId }
706 * Note that both issuer and subject policy OIDs are required,
707 * and are stored by value in this structure.
709 typedef struct __CE_PolicyMapping
{
710 CSSM_OID issuerDomainPolicy
;
711 CSSM_OID subjectDomainPolicy
;
712 } CE_PolicyMapping DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
714 typedef struct __CE_PolicyMappings
{
715 uint32 numPolicyMappings
;
716 CE_PolicyMapping
*policyMappings
;
717 } CE_PolicyMappings DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
722 * id-ce-policyConstraints OBJECT IDENTIFIER ::= { id-ce 36 }
724 * PolicyConstraints ::= SEQUENCE {
725 * requireExplicitPolicy [0] SkipCerts OPTIONAL,
726 * inhibitPolicyMapping [1] SkipCerts OPTIONAL }
728 * SkipCerts ::= INTEGER (0..MAX)
730 typedef struct __CE_PolicyConstraints
{
731 CSSM_BOOL requireExplicitPolicyPresent
;
732 uint32 requireExplicitPolicy
; // optional
733 CSSM_BOOL inhibitPolicyMappingPresent
;
734 uint32 inhibitPolicyMapping
; // optional
735 } CE_PolicyConstraints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
738 * InhibitAnyPolicy, an integer.
740 * CSSM OID = CSSMOID_InhibitAnyPolicy
742 typedef uint32 CE_InhibitAnyPolicy DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
745 * An enumerated list identifying one of the above per-extension
748 typedef enum __CE_DataType
{
749 DT_AuthorityKeyID
, // CE_AuthorityKeyID
750 DT_SubjectKeyID
, // CE_SubjectKeyID
751 DT_KeyUsage
, // CE_KeyUsage
752 DT_SubjectAltName
, // implies CE_GeneralName
753 DT_IssuerAltName
, // implies CE_GeneralName
754 DT_ExtendedKeyUsage
, // CE_ExtendedKeyUsage
755 DT_BasicConstraints
, // CE_BasicConstraints
756 DT_CertPolicies
, // CE_CertPolicies
757 DT_NetscapeCertType
, // CE_NetscapeCertType
758 DT_CrlNumber
, // CE_CrlNumber
759 DT_DeltaCrl
, // CE_DeltaCrl
760 DT_CrlReason
, // CE_CrlReason
761 DT_CrlDistributionPoints
, // CE_CRLDistPointsSyntax
762 DT_IssuingDistributionPoint
,// CE_IssuingDistributionPoint
763 DT_AuthorityInfoAccess
, // CE_AuthorityInfoAccess
764 DT_Other
, // unknown, raw data as a CSSM_DATA
765 DT_QC_Statements
, // CE_QC_Statements
766 DT_NameConstraints
, // CE_NameConstraints
767 DT_PolicyMappings
, // CE_PolicyMappings
768 DT_PolicyConstraints
, // CE_PolicyConstraints
769 DT_InhibitAnyPolicy
// CE_InhibitAnyPolicy
773 * One unified representation of all the cert and CRL extensions we know about.
776 CE_AuthorityKeyID authorityKeyID
;
777 CE_SubjectKeyID subjectKeyID
;
778 CE_KeyUsage keyUsage
;
779 CE_GeneralNames subjectAltName
;
780 CE_GeneralNames issuerAltName
;
781 CE_ExtendedKeyUsage extendedKeyUsage
;
782 CE_BasicConstraints basicConstraints
;
783 CE_CertPolicies certPolicies
;
784 CE_NetscapeCertType netscapeCertType
;
785 CE_CrlNumber crlNumber
;
786 CE_DeltaCrl deltaCrl
;
787 CE_CrlReason crlReason
;
788 CE_CRLDistPointsSyntax crlDistPoints
;
789 CE_IssuingDistributionPoint issuingDistPoint
;
790 CE_AuthorityInfoAccess authorityInfoAccess
;
791 CE_QC_Statements qualifiedCertStatements
;
792 CE_NameConstraints nameConstraints
;
793 CE_PolicyMappings policyMappings
;
794 CE_PolicyConstraints policyConstraints
;
795 CE_InhibitAnyPolicy inhibitAnyPolicy
;
796 CSSM_DATA rawData
; // unknown, not decoded
797 } CE_Data DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
799 typedef struct __CE_DataAndType
{
803 } CE_DataAndType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
805 #endif /* SEC_OS_OSX */
808 #pragma clang diagnostic pop
811 #endif /* _CERT_EXTENSIONS_H_ */