2 * Copyright (c) 2002-2014 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@
25 // CertificateValues.cpp
27 #include <security_keychain/Certificate.h>
28 #include <Security/oidscert.h>
29 #include <Security/oidsattr.h>
30 #include <Security/SecCertificate.h>
31 #include <Security/SecCertificatePriv.h>
32 #include "SecCertificateOIDs.h"
33 #include "CertificateValues.h"
34 #include "SecCertificateP.h"
35 #include "SecCertificatePrivP.h"
36 #include <CoreFoundation/CFNumber.h>
37 #include "SecCertificateP.h"
39 /* FIXME including SecCertificateInternalP.h here produces errors; investigate */
40 extern "C" CFDataRef
SecCertificateCopyIssuerSequenceP(SecCertificateRefP certificate
);
41 extern "C" CFDataRef
SecCertificateCopySubjectSequenceP(SecCertificateRefP certificate
);
42 extern "C" CFDictionaryRef
SecCertificateCopyAttributeDictionaryP(SecCertificateRefP certificate
);
44 extern "C" void appendPropertyP(CFMutableArrayRef properties
, CFStringRef propertyType
, CFStringRef label
, CFTypeRef value
);
46 extern const CFStringRef __nonnull kSecPropertyKeyType
;
47 extern const CFStringRef __nonnull kSecPropertyKeyLabel
;
48 extern const CFStringRef __nonnull kSecPropertyKeyLocalizedLabel
;
49 extern const CFStringRef __nonnull kSecPropertyKeyValue
;
51 extern const CFStringRef __nonnull kSecPropertyTypeData
;
52 extern const CFStringRef __nonnull kSecPropertyTypeString
;
53 extern const CFStringRef __nonnull kSecPropertyTypeURL
;
54 extern const CFStringRef __nonnull kSecPropertyTypeDate
;
56 CFStringRef kSecPropertyTypeArray
= CFSTR("array");
57 CFStringRef kSecPropertyTypeNumber
= CFSTR("number");
60 #pragma mark ---------- CertificateValues Implementation ----------
62 using namespace KeychainCore
;
64 void addFieldValues(const void *key
, const void *value
, void *context
);
65 void addPropertyToFieldValues(const void *value
, void *context
);
66 void filterFieldValues(const void *key
, const void *value
, void *context
);
67 void validateKeys(const void *value
, void *context
);
69 CFDictionaryRef
CertificateValues::mOIDRemap
= NULL
;
71 typedef struct FieldValueFilterContext
73 CFMutableDictionaryRef filteredValues
;
74 CFArrayRef filterKeys
;
75 } FieldValueFilterContext
;
77 CertificateValues::CertificateValues(SecCertificateRef certificateRef
) : mCertificateRef(certificateRef
),
78 mCertificateData(NULL
)
81 CFRetain(mCertificateRef
);
84 CertificateValues::~CertificateValues() throw()
87 CFRelease(mCertificateData
);
89 CFRelease(mCertificateRef
);
92 CFDictionaryRef
CertificateValues::copyFieldValues(CFArrayRef keys
, CFErrorRef
*error
)
96 if (CFGetTypeID(keys
)!=CFArrayGetTypeID())
98 CFRange range
= CFRangeMake(0, CFArrayGetCount((CFArrayRef
)keys
));
100 CFArrayApplyFunction(keys
, range
, validateKeys
, &failed
);
105 if (mCertificateData
)
107 CFRelease(mCertificateData
);
108 mCertificateData
= NULL
;
110 if (!mCertificateData
)
112 mCertificateData
= SecCertificateCopyData(mCertificateRef
); // OK to call, no big lock
113 if (!mCertificateData
)
116 *error
= CFErrorCreate(NULL
, kCFErrorDomainOSStatus
, errSecInvalidCertificateRef
, NULL
);
122 SecCertificateRefP certificateP
= SecCertificateCreateWithDataP(kCFAllocatorDefault
, mCertificateData
);
126 *error
= CFErrorCreate(NULL
, kCFErrorDomainOSStatus
, errSecInvalidCertificateGroup
, NULL
);
130 CFMutableDictionaryRef fieldValues
=CFDictionaryCreateMutable(kCFAllocatorDefault
, 0,
131 &kCFTypeDictionaryKeyCallBacks
, &kCFTypeDictionaryValueCallBacks
);
133 // Return an array of CFStringRefs representing the common names in the certificates subject if any
134 CFArrayRef commonNames
=SecCertificateCopyCommonNamesP(certificateP
);
137 CFMutableArrayRef additionalValues
= CFArrayCreateMutable(kCFAllocatorDefault
, 0, &kCFTypeArrayCallBacks
);
138 appendPropertyP(additionalValues
, kSecPropertyTypeArray
, CFSTR("CN"), commonNames
);
139 CFDictionaryAddValue(fieldValues
, kSecOIDCommonName
, (CFTypeRef
)CFArrayGetValueAtIndex(additionalValues
, 0));
140 CFRelease(commonNames
);
141 CFRelease(additionalValues
);
144 // These can exist in the subject alt name or in the subject
145 CFArrayRef dnsNames
=SecCertificateCopyDNSNamesP(certificateP
);
148 CFMutableArrayRef additionalValues
= CFArrayCreateMutable(kCFAllocatorDefault
, 0, &kCFTypeArrayCallBacks
);
149 appendPropertyP(additionalValues
, kSecPropertyTypeArray
, CFSTR("DNS"), dnsNames
);
150 CFDictionaryAddValue(fieldValues
, CFSTR("DNSNAMES"), (CFTypeRef
)CFArrayGetValueAtIndex(additionalValues
, 0));
152 CFRelease(additionalValues
);
155 CFArrayRef ipAddresses
=SecCertificateCopyIPAddressesP(certificateP
);
158 CFMutableArrayRef additionalValues
= CFArrayCreateMutable(kCFAllocatorDefault
, 0, &kCFTypeArrayCallBacks
);
159 appendPropertyP(additionalValues
, kSecPropertyTypeArray
, CFSTR("IP"), dnsNames
);
160 CFDictionaryAddValue(fieldValues
, CFSTR("IPADDRESSES"), (CFTypeRef
)CFArrayGetValueAtIndex(additionalValues
, 0));
161 CFRelease(ipAddresses
);
162 CFRelease(additionalValues
);
165 // These can exist in the subject alt name or in the subject
166 CFArrayRef emailAddrs
=SecCertificateCopyRFC822NamesP(certificateP
);
169 CFMutableArrayRef additionalValues
= CFArrayCreateMutable(kCFAllocatorDefault
, 0, &kCFTypeArrayCallBacks
);
170 appendPropertyP(additionalValues
, kSecPropertyTypeArray
, CFSTR("DNS"), dnsNames
);
171 CFDictionaryAddValue(fieldValues
, kSecOIDEmailAddress
, (CFTypeRef
)CFArrayGetValueAtIndex(additionalValues
, 0));
172 CFRelease(emailAddrs
);
173 CFRelease(additionalValues
);
176 CFAbsoluteTime notBefore
= SecCertificateNotValidBeforeP(certificateP
);
177 CFNumberRef notBeforeRef
= CFNumberCreate(kCFAllocatorDefault
, kCFNumberDoubleType
, ¬Before
);
180 CFMutableArrayRef additionalValues
= CFArrayCreateMutable(kCFAllocatorDefault
, 0, &kCFTypeArrayCallBacks
);
181 appendPropertyP(additionalValues
, kSecPropertyTypeNumber
, CFSTR("Not Valid Before"), notBeforeRef
);
182 CFDictionaryAddValue(fieldValues
, kSecOIDX509V1ValidityNotBefore
, (CFTypeRef
)CFArrayGetValueAtIndex(additionalValues
, 0));
183 CFRelease(notBeforeRef
);
184 CFRelease(additionalValues
);
187 CFAbsoluteTime notAfter
= SecCertificateNotValidAfterP(certificateP
);
188 CFNumberRef notAfterRef
= CFNumberCreate(kCFAllocatorDefault
, kCFNumberDoubleType
, ¬After
);
191 CFMutableArrayRef additionalValues
= CFArrayCreateMutable(kCFAllocatorDefault
, 0, &kCFTypeArrayCallBacks
);
192 appendPropertyP(additionalValues
, kSecPropertyTypeNumber
, CFSTR("Not Valid After"), notAfterRef
);
193 CFDictionaryAddValue(fieldValues
, kSecOIDX509V1ValidityNotAfter
, (CFTypeRef
)CFArrayGetValueAtIndex(additionalValues
, 0));
194 CFRelease(notAfterRef
);
195 CFRelease(additionalValues
);
198 SecKeyUsage keyUsage
=SecCertificateGetKeyUsageP(certificateP
);
199 CFNumberRef ku
= CFNumberCreate(kCFAllocatorDefault
, kCFNumberSInt32Type
, &keyUsage
);
202 CFMutableArrayRef additionalValues
= CFArrayCreateMutable(kCFAllocatorDefault
, 0, &kCFTypeArrayCallBacks
);
203 appendPropertyP(additionalValues
, kSecPropertyTypeNumber
, CFSTR("Key Usage"), ku
);
204 CFDictionaryAddValue(fieldValues
, kSecOIDKeyUsage
, (CFTypeRef
)CFArrayGetValueAtIndex(additionalValues
, 0));
206 CFRelease(additionalValues
);
209 CFArrayRef ekus
= SecCertificateCopyExtendedKeyUsageP(certificateP
);
212 CFMutableArrayRef additionalValues
= CFArrayCreateMutable(kCFAllocatorDefault
, 0, &kCFTypeArrayCallBacks
);
213 appendPropertyP(additionalValues
, kSecPropertyTypeArray
, CFSTR("Extended Key Usage"), ekus
);
214 CFDictionaryAddValue(fieldValues
, kSecOIDExtendedKeyUsage
, (CFTypeRef
)CFArrayGetValueAtIndex(additionalValues
, 0));
216 CFRelease(additionalValues
);
219 // Add all values from properties dictionary
220 CFArrayRef properties
= SecCertificateCopyPropertiesP(certificateP
);
223 CFRange range
= CFRangeMake(0, CFArrayGetCount((CFArrayRef
)properties
));
224 CFArrayApplyFunction(properties
, range
, addPropertyToFieldValues
, fieldValues
);
225 // CFDictionaryApplyFunction(properties, addFieldValues, fieldValues);
226 CFRelease(properties
);
229 CFAbsoluteTime verifyTime
= CFAbsoluteTimeGetCurrent();
230 CFMutableArrayRef summaryProperties
=
231 SecCertificateCopySummaryPropertiesP(certificateP
, verifyTime
);
232 if (summaryProperties
)
234 CFRange range
= CFRangeMake(0, CFArrayGetCount((CFArrayRef
)summaryProperties
));
235 CFArrayApplyFunction(summaryProperties
, range
, addPropertyToFieldValues
, fieldValues
);
236 // CFDictionaryApplyFunction(summaryProperties, addFieldValues, fieldValues);
237 // CFDictionaryAddValue(fieldValues, CFSTR("summaryProperties"), summaryProperties);
238 CFRelease(summaryProperties
);
242 CFRelease(certificateP
);
245 return (CFDictionaryRef
)fieldValues
;
247 // Otherwise, we need to filter
248 CFMutableDictionaryRef filteredFieldValues
=CFDictionaryCreateMutable(kCFAllocatorDefault
, 0,
249 &kCFTypeDictionaryKeyCallBacks
, &kCFTypeDictionaryValueCallBacks
);
251 FieldValueFilterContext fvcontext
;
252 fvcontext
.filteredValues
= filteredFieldValues
;
253 fvcontext
.filterKeys
= keys
;
255 CFDictionaryApplyFunction(fieldValues
, filterFieldValues
, &fvcontext
);
257 CFRelease(fieldValues
);
258 return (CFDictionaryRef
)filteredFieldValues
;
261 void validateKeys(const void *value
, void *context
)
263 if (value
== NULL
|| (CFGetTypeID(value
)!=CFStringGetTypeID()))
265 *(bool *)context
= true;
268 void filterFieldValues(const void *key
, const void *value
, void *context
)
270 // each element of keys is a CFStringRef with an OID, e.g.
271 // const CFStringRef kSecOIDTitle = CFSTR("2.5.4.12");
273 CFTypeRef fieldKey
= (CFTypeRef
)key
;
274 if (fieldKey
== NULL
|| (CFGetTypeID(fieldKey
)!=CFStringGetTypeID()) || context
==NULL
)
277 FieldValueFilterContext
*fvcontext
= (FieldValueFilterContext
*)context
;
279 CFRange range
= CFRangeMake(0, CFArrayGetCount(fvcontext
->filterKeys
));
280 CFIndex idx
= CFArrayGetFirstIndexOfValue(fvcontext
->filterKeys
, range
, fieldKey
);
281 if (idx
!= kCFNotFound
)
282 CFDictionaryAddValue(fvcontext
->filteredValues
, fieldKey
, value
);
285 void addFieldValues(const void *key
, const void *value
, void *context
)
287 CFMutableDictionaryRef fieldValues
= (CFMutableDictionaryRef
)context
;
288 CFDictionaryAddValue(fieldValues
, key
, value
);
291 void addPropertyToFieldValues(const void *value
, void *context
)
293 CFMutableDictionaryRef fieldValues
= (CFMutableDictionaryRef
)context
;
294 if (CFGetTypeID(value
)==CFDictionaryGetTypeID())
296 CFStringRef label
= (CFStringRef
)CFDictionaryGetValue((CFDictionaryRef
)value
, kSecPropertyKeyLabel
);
298 CFStringRef typeD
= (CFStringRef
)CFDictionaryGetValue((CFDictionaryRef
)value
, kSecPropertyKeyType
);
299 CFTypeRef valueD
= (CFStringRef
)CFDictionaryGetValue((CFDictionaryRef
)value
, kSecPropertyKeyValue
);
301 CFStringRef key
= CertificateValues::remapLabelToKey(label
);
303 CFDictionaryAddValue(fieldValues
, key
, value
);
307 CFStringRef
CertificateValues::remapLabelToKey(CFStringRef label
)
316 CFSTR("Subject Name"),
317 CFSTR("Normalized Subject Name"),
318 CFSTR("Issuer Name"),
319 CFSTR("Normalized Subject Name"),
321 CFSTR("Serial Number"),
322 CFSTR("Signature Algorithm"),
323 CFSTR("Subject Unique ID"),
324 CFSTR("Issuer Unique ID"),
325 CFSTR("Public Key Algorithm"),
326 CFSTR("Public Key Data"),
328 CFSTR("Not Valid Before"),
329 CFSTR("Not Valid After"),
335 kSecOIDX509V1SubjectName
,
336 kSecOIDX509V1SubjectNameStd
,
337 kSecOIDX509V1IssuerName
,
338 kSecOIDX509V1IssuerNameStd
,
339 kSecOIDX509V1Version
,
340 kSecOIDX509V1SerialNumber
,
341 kSecOIDX509V1SignatureAlgorithm
, // or CSSMOID_X509V1SignatureAlgorithmTBS?
342 kSecOIDX509V1CertificateSubjectUniqueId
,
343 kSecOIDX509V1CertificateIssuerUniqueId
,
344 kSecOIDX509V1SubjectPublicKeyAlgorithm
,
345 kSecOIDX509V1SubjectPublicKey
,
346 kSecOIDX509V1Signature
,
347 kSecOIDX509V1ValidityNotBefore
,
348 kSecOIDX509V1ValidityNotAfter
,
349 kSecOIDInvalidityDate
352 mOIDRemap
= CFDictionaryCreate(NULL
, keys
, values
,
353 (sizeof(keys
) / sizeof(*keys
)), &kCFTypeDictionaryKeyCallBacks
,
354 &kCFTypeDictionaryValueCallBacks
);
357 CFTypeRef result
= (CFTypeRef
)CFDictionaryGetValue(mOIDRemap
, label
);
359 return result
?(CFStringRef
)result
:label
;
362 CFDataRef
CertificateValues::copySerialNumber(CFErrorRef
*error
)
364 CFDataRef result
= NULL
;
365 SecCertificateRefP certificateP
= getSecCertificateRefP(error
);
369 result
= SecCertificateCopySerialNumberP(certificateP
);
370 CFRelease(certificateP
);
375 CFDataRef
CertificateValues::copyNormalizedIssuerContent(CFErrorRef
*error
)
377 CFDataRef result
= NULL
;
378 SecCertificateRefP certificateP
= getSecCertificateRefP(error
);
381 result
= SecCertificateCopyNormalizedIssuerSequenceP(certificateP
);
382 CFRelease(certificateP
);
387 CFDataRef
CertificateValues::copyNormalizedSubjectContent(CFErrorRef
*error
)
389 CFDataRef result
= NULL
;
390 SecCertificateRefP certificateP
= getSecCertificateRefP(error
);
393 result
= SecCertificateCopyNormalizedSubjectSequenceP(certificateP
);
394 CFRelease(certificateP
);
399 CFDataRef
CertificateValues::copyIssuerSequence(CFErrorRef
*error
)
401 CFDataRef result
= NULL
;
402 SecCertificateRefP certificateP
= getSecCertificateRefP(error
);
405 result
= SecCertificateCopyIssuerSequenceP(certificateP
);
406 CFRelease(certificateP
);
411 CFDataRef
CertificateValues::copySubjectSequence(CFErrorRef
*error
)
413 CFDataRef result
= NULL
;
414 SecCertificateRefP certificateP
= getSecCertificateRefP(error
);
417 result
= SecCertificateCopySubjectSequenceP(certificateP
);
418 CFRelease(certificateP
);
423 CFDictionaryRef
CertificateValues::copyAttributeDictionary(CFErrorRef
*error
)
425 CFDictionaryRef result
= NULL
;
426 SecCertificateRefP certificateP
= getSecCertificateRefP(error
);
429 result
= SecCertificateCopyAttributeDictionaryP(certificateP
);
430 CFRelease(certificateP
);
435 bool CertificateValues::isValid(CFAbsoluteTime verifyTime
, CFErrorRef
*error
)
438 SecCertificateRefP certificateP
= getSecCertificateRefP(error
);
441 result
= SecCertificateIsValidP(certificateP
, verifyTime
);
442 CFRelease(certificateP
);
447 CFAbsoluteTime
CertificateValues::notValidBefore(CFErrorRef
*error
)
449 CFAbsoluteTime result
= 0;
450 SecCertificateRefP certificateP
= getSecCertificateRefP(error
);
453 result
= SecCertificateNotValidBeforeP(certificateP
);
454 CFRelease(certificateP
);
459 CFAbsoluteTime
CertificateValues::notValidAfter(CFErrorRef
*error
)
461 CFAbsoluteTime result
= 0;
462 SecCertificateRefP certificateP
= getSecCertificateRefP(error
);
465 result
= SecCertificateNotValidAfterP(certificateP
);
466 CFRelease(certificateP
);
471 SecCertificateRefP
CertificateValues::getSecCertificateRefP(CFErrorRef
*error
)
473 // SecCertificateCopyData returns an object created with CFDataCreate, so we
474 // own it and must release it
476 if (mCertificateData
)
478 CFRelease(mCertificateData
);
479 mCertificateData
= NULL
;
482 mCertificateData
= SecCertificateCopyData(mCertificateRef
); // OK to call, no big lock
483 if (!mCertificateData
&& error
)
485 *error
= CFErrorCreate(NULL
, kCFErrorDomainOSStatus
, errSecInvalidCertificateRef
, NULL
);
489 SecCertificateRefP certificateP
= SecCertificateCreateWithDataP(kCFAllocatorDefault
, mCertificateData
);
490 if (!certificateP
&& error
)
492 *error
= CFErrorCreate(NULL
, kCFErrorDomainOSStatus
, errSecInvalidCertificateGroup
, NULL
);
499 #pragma mark ---------- OID Constants ----------
501 const CFStringRef kSecOIDADC_CERT_POLICY
= CFSTR("1.2.840.113635.100.5.3");
502 const CFStringRef kSecOIDAPPLE_CERT_POLICY
= CFSTR("1.2.840.113635.100.5.1");
503 const CFStringRef kSecOIDAPPLE_EKU_CODE_SIGNING
= CFSTR("1.2.840.113635.100.4.1");
504 const CFStringRef kSecOIDAPPLE_EKU_CODE_SIGNING_DEV
= CFSTR("1.2.840.113635.100.4.1.1");
505 const CFStringRef kSecOIDAPPLE_EKU_ICHAT_ENCRYPTION
= CFSTR("1.2.840.113635.100.4.3");
506 const CFStringRef kSecOIDAPPLE_EKU_ICHAT_SIGNING
= CFSTR("1.2.840.113635.100.4.2");
507 const CFStringRef kSecOIDAPPLE_EKU_RESOURCE_SIGNING
= CFSTR("1.2.840.113635.100.4.1.4");
508 const CFStringRef kSecOIDAPPLE_EKU_SYSTEM_IDENTITY
= CFSTR("1.2.840.113635.100.4.4");
509 const CFStringRef kSecOIDAPPLE_EXTENSION
= CFSTR("1.2.840.113635.100.6");
510 const CFStringRef kSecOIDAPPLE_EXTENSION_ADC_APPLE_SIGNING
= CFSTR("1.2.840.113635.100.6.1.2.0.0");
511 const CFStringRef kSecOIDAPPLE_EXTENSION_ADC_DEV_SIGNING
= CFSTR("1.2.840.113635.100.6.1.2.0");
512 const CFStringRef kSecOIDAPPLE_EXTENSION_APPLE_SIGNING
= CFSTR("1.2.840.113635.100.6.1.1");
513 const CFStringRef kSecOIDAPPLE_EXTENSION_CODE_SIGNING
= CFSTR("1.2.840.113635.100.6.1");
514 const CFStringRef kSecOIDAPPLE_EXTENSION_INTERMEDIATE_MARKER
= CFSTR("1.2.840.113635.100.6.2");
515 const CFStringRef kSecOIDAPPLE_EXTENSION_WWDR_INTERMEDIATE
= CFSTR("1.2.840.113635.100.6.2.1");
516 const CFStringRef kSecOIDAPPLE_EXTENSION_ITMS_INTERMEDIATE
= CFSTR("1.2.840.113635.100.6.2.2");
517 const CFStringRef kSecOIDAPPLE_EXTENSION_AAI_INTERMEDIATE
= CFSTR("1.2.840.113635.100.6.2.3");
518 const CFStringRef kSecOIDAPPLE_EXTENSION_APPLEID_INTERMEDIATE
= CFSTR("1.2.840.113635.100.6.2.7");
519 const CFStringRef kSecOIDAuthorityInfoAccess
= CFSTR("1.3.6.1.5.5.7.1.1");
520 const CFStringRef kSecOIDAuthorityKeyIdentifier
= CFSTR("2.5.29.35");
521 const CFStringRef kSecOIDBasicConstraints
= CFSTR("2.5.29.19");
522 const CFStringRef kSecOIDBiometricInfo
= CFSTR("1.3.6.1.5.5.7.1.2");
523 const CFStringRef kSecOIDCSSMKeyStruct
= CFSTR("2.16.840.1.113741.2.1.1.1.20");
524 const CFStringRef kSecOIDCertIssuer
= CFSTR("2.5.29.29");
525 const CFStringRef kSecOIDCertificatePolicies
= CFSTR("2.5.29.32");
526 const CFStringRef kSecOIDClientAuth
= CFSTR("1.3.6.1.5.5.7.3.2");
527 const CFStringRef kSecOIDCollectiveStateProvinceName
= CFSTR("2.5.4.8.1");
528 const CFStringRef kSecOIDCollectiveStreetAddress
= CFSTR("2.5.4.9.1");
529 const CFStringRef kSecOIDCommonName
= CFSTR("2.5.4.3");
530 const CFStringRef kSecOIDCountryName
= CFSTR("2.5.4.6");
531 const CFStringRef kSecOIDCrlDistributionPoints
= CFSTR("2.5.29.31");
532 const CFStringRef kSecOIDCrlNumber
= CFSTR("2.5.29.20");
533 const CFStringRef kSecOIDCrlReason
= CFSTR("2.5.29.21");
534 const CFStringRef kSecOIDDOTMAC_CERT_EMAIL_ENCRYPT
= CFSTR("1.2.840.113635.100.3.2.3");
535 const CFStringRef kSecOIDDOTMAC_CERT_EMAIL_SIGN
= CFSTR("1.2.840.113635.100.3.2.2");
536 const CFStringRef kSecOIDDOTMAC_CERT_EXTENSION
= CFSTR("1.2.840.113635.100.3.2");
537 const CFStringRef kSecOIDDOTMAC_CERT_IDENTITY
= CFSTR("1.2.840.113635.100.3.2.1");
538 const CFStringRef kSecOIDDOTMAC_CERT_POLICY
= CFSTR("1.2.840.113635.100.5.2");
539 const CFStringRef kSecOIDDeltaCrlIndicator
= CFSTR("2.5.29.27");
540 const CFStringRef kSecOIDDescription
= CFSTR("2.5.4.13");
541 const CFStringRef kSecOIDEKU_IPSec
= CFSTR("1.3.6.1.5.5.8.2.2");
542 const CFStringRef kSecOIDEmailAddress
= CFSTR("1.2.840.113549.1.9.1");
543 const CFStringRef kSecOIDEmailProtection
= CFSTR("1.3.6.1.5.5.7.3.4");
544 const CFStringRef kSecOIDExtendedKeyUsage
= CFSTR("2.5.29.37");
545 const CFStringRef kSecOIDExtendedKeyUsageAny
= CFSTR("2.5.29.37.0");
546 const CFStringRef kSecOIDExtendedUseCodeSigning
= CFSTR("1.3.6.1.5.5.7.3.3");
547 const CFStringRef kSecOIDGivenName
= CFSTR("2.5.4.42");
548 const CFStringRef kSecOIDHoldInstructionCode
= CFSTR("2.5.29.23");
549 const CFStringRef kSecOIDInvalidityDate
= CFSTR("2.5.29.24");
550 const CFStringRef kSecOIDIssuerAltName
= CFSTR("2.5.29.18");
551 const CFStringRef kSecOIDIssuingDistributionPoint
= CFSTR("2.5.29.28");
552 const CFStringRef kSecOIDIssuingDistributionPoints
= CFSTR("2.5.29.28");
553 const CFStringRef kSecOIDKERBv5_PKINIT_KP_CLIENT_AUTH
= CFSTR("1.3.6.1.5.2.3.4");
554 const CFStringRef kSecOIDKERBv5_PKINIT_KP_KDC
= CFSTR("1.3.6.1.5.2.3.5");
555 const CFStringRef kSecOIDKeyUsage
= CFSTR("2.5.29.15");
556 const CFStringRef kSecOIDLocalityName
= CFSTR("2.5.4.7");
557 const CFStringRef kSecOIDMS_NTPrincipalName
= CFSTR("1.3.6.1.4.1.311.20.2.3");
558 const CFStringRef kSecOIDMicrosoftSGC
= CFSTR("1.3.6.1.4.1.311.10.3.3");
559 const CFStringRef kSecOIDNameConstraints
= CFSTR("2.5.29.30");
560 const CFStringRef kSecOIDNetscapeCertSequence
= CFSTR("2.16.840.1.113730.2.5");
561 const CFStringRef kSecOIDNetscapeCertType
= CFSTR("2.16.840.1.113730.1.1");
562 const CFStringRef kSecOIDNetscapeSGC
= CFSTR("2.16.840.1.113730.4.1");
563 const CFStringRef kSecOIDOCSPSigning
= CFSTR("1.3.6.1.5.5.7.3.9");
564 const CFStringRef kSecOIDOrganizationName
= CFSTR("2.5.4.10");
565 const CFStringRef kSecOIDOrganizationalUnitName
= CFSTR("2.5.4.11");
566 const CFStringRef kSecOIDPolicyConstraints
= CFSTR("2.5.29.36");
567 const CFStringRef kSecOIDPolicyMappings
= CFSTR("2.5.29.33");
568 const CFStringRef kSecOIDPrivateKeyUsagePeriod
= CFSTR("2.5.29.16");
569 const CFStringRef kSecOIDQC_Statements
= CFSTR("1.3.6.1.5.5.7.1.3");
570 const CFStringRef kSecOIDSerialNumber
= CFSTR("2.5.4.5");
571 const CFStringRef kSecOIDServerAuth
= CFSTR("1.3.6.1.5.5.7.3.1");
572 const CFStringRef kSecOIDStateProvinceName
= CFSTR("2.5.4.8");
573 const CFStringRef kSecOIDStreetAddress
= CFSTR("2.5.4.9");
574 const CFStringRef kSecOIDSubjectAltName
= CFSTR("2.5.29.17");
575 const CFStringRef kSecOIDSubjectDirectoryAttributes
= CFSTR("2.5.29.9");
576 const CFStringRef kSecOIDSubjectEmailAddress
= CFSTR("2.16.840.1.113741.2.1.1.1.50.3");
577 const CFStringRef kSecOIDSubjectInfoAccess
= CFSTR("1.3.6.1.5.5.7.1.11");
578 const CFStringRef kSecOIDSubjectKeyIdentifier
= CFSTR("2.5.29.14");
579 const CFStringRef kSecOIDSubjectPicture
= CFSTR("2.16.840.1.113741.2.1.1.1.50.2");
580 const CFStringRef kSecOIDSubjectSignatureBitmap
= CFSTR("2.16.840.1.113741.2.1.1.1.50.1");
581 const CFStringRef kSecOIDSurname
= CFSTR("2.5.4.4");
582 const CFStringRef kSecOIDTimeStamping
= CFSTR("1.3.6.1.5.5.7.3.8");
583 const CFStringRef kSecOIDTitle
= CFSTR("2.5.4.12");
584 const CFStringRef kSecOIDUseExemptions
= CFSTR("2.16.840.1.113741.2.1.1.1.50.4");
585 const CFStringRef kSecOIDX509V1CertificateIssuerUniqueId
= CFSTR("2.16.840.1.113741.2.1.1.1.11");
586 const CFStringRef kSecOIDX509V1CertificateSubjectUniqueId
= CFSTR("2.16.840.1.113741.2.1.1.1.12");
587 const CFStringRef kSecOIDX509V1IssuerName
= CFSTR("2.16.840.1.113741.2.1.1.1.5");
588 const CFStringRef kSecOIDX509V1IssuerNameCStruct
= CFSTR("2.16.840.1.113741.2.1.1.1.5.1");
589 const CFStringRef kSecOIDX509V1IssuerNameLDAP
= CFSTR("2.16.840.1.113741.2.1.1.1.5.2");
590 const CFStringRef kSecOIDX509V1IssuerNameStd
= CFSTR("2.16.840.1.113741.2.1.1.1.23");
591 const CFStringRef kSecOIDX509V1SerialNumber
= CFSTR("2.16.840.1.113741.2.1.1.1.3");
592 const CFStringRef kSecOIDX509V1Signature
= CFSTR("2.16.840.1.113741.2.1.3.2.2");
593 const CFStringRef kSecOIDX509V1SignatureAlgorithm
= CFSTR("2.16.840.1.113741.2.1.3.2.1");
594 const CFStringRef kSecOIDX509V1SignatureAlgorithmParameters
= CFSTR("2.16.840.1.113741.2.1.3.2.3");
595 const CFStringRef kSecOIDX509V1SignatureAlgorithmTBS
= CFSTR("2.16.840.1.113741.2.1.3.2.10");
596 const CFStringRef kSecOIDX509V1SignatureCStruct
= CFSTR("2.16.840.1.113741.2.1.3.2.0.1");
597 const CFStringRef kSecOIDX509V1SignatureStruct
= CFSTR("2.16.840.1.113741.2.1.3.2.0");
598 const CFStringRef kSecOIDX509V1SubjectName
= CFSTR("2.16.840.1.113741.2.1.1.1.8");
599 const CFStringRef kSecOIDX509V1SubjectNameCStruct
= CFSTR("2.16.840.1.113741.2.1.1.1.8.1");
600 const CFStringRef kSecOIDX509V1SubjectNameLDAP
= CFSTR("2.16.840.1.113741.2.1.1.1.8.2");
601 const CFStringRef kSecOIDX509V1SubjectNameStd
= CFSTR("2.16.840.1.113741.2.1.1.1.22");
602 const CFStringRef kSecOIDX509V1SubjectPublicKey
= CFSTR("2.16.840.1.113741.2.1.1.1.10");
603 const CFStringRef kSecOIDX509V1SubjectPublicKeyAlgorithm
= CFSTR("2.16.840.1.113741.2.1.1.1.9");
604 const CFStringRef kSecOIDX509V1SubjectPublicKeyAlgorithmParameters
= CFSTR("2.16.840.1.113741.2.1.1.1.18");
605 const CFStringRef kSecOIDX509V1SubjectPublicKeyCStruct
= CFSTR("2.16.840.1.113741.2.1.1.1.20.1");
606 const CFStringRef kSecOIDX509V1ValidityNotAfter
= CFSTR("2.16.840.1.113741.2.1.1.1.7");
607 const CFStringRef kSecOIDX509V1ValidityNotBefore
= CFSTR("2.16.840.1.113741.2.1.1.1.6");
608 const CFStringRef kSecOIDX509V1Version
= CFSTR("2.16.840.1.113741.2.1.1.1.2");
609 const CFStringRef kSecOIDX509V3Certificate
= CFSTR("2.16.840.1.113741.2.1.1.1.1");
610 const CFStringRef kSecOIDX509V3CertificateCStruct
= CFSTR("2.16.840.1.113741.2.1.1.1.1.1");
611 const CFStringRef kSecOIDX509V3CertificateExtensionCStruct
= CFSTR("2.16.840.1.113741.2.1.1.1.13.1");
612 const CFStringRef kSecOIDX509V3CertificateExtensionCritical
= CFSTR("2.16.840.1.113741.2.1.1.1.16");
613 const CFStringRef kSecOIDX509V3CertificateExtensionId
= CFSTR("2.16.840.1.113741.2.1.1.1.15");
614 const CFStringRef kSecOIDX509V3CertificateExtensionStruct
= CFSTR("2.16.840.1.113741.2.1.1.1.13");
615 const CFStringRef kSecOIDX509V3CertificateExtensionType
= CFSTR("2.16.840.1.113741.2.1.1.1.19");
616 const CFStringRef kSecOIDX509V3CertificateExtensionValue
= CFSTR("2.16.840.1.113741.2.1.1.1.17");
617 const CFStringRef kSecOIDX509V3CertificateExtensionsCStruct
= CFSTR("2.16.840.1.113741.2.1.1.1.21.1");
618 const CFStringRef kSecOIDX509V3CertificateExtensionsStruct
= CFSTR("2.16.840.1.113741.2.1.1.1.21");
619 const CFStringRef kSecOIDX509V3CertificateNumberOfExtensions
= CFSTR("2.16.840.1.113741.2.1.1.1.14");
620 const CFStringRef kSecOIDX509V3SignedCertificate
= CFSTR("2.16.840.1.113741.2.1.1.1.0");
621 const CFStringRef kSecOIDX509V3SignedCertificateCStruct
= CFSTR("2.16.840.1.113741.2.1.1.1.0.1");
622 const CFStringRef kSecOIDSRVName
= CFSTR("1.3.6.1.5.5.7.8.7");