2 * Copyright (c) 2003-2017 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@
26 The functions provided in SecPolicyPriv provide an interface to various
27 X.509 certificate trust policies.
30 #ifndef _SECURITY_SECPOLICYPRIV_H_
31 #define _SECURITY_SECPOLICYPRIV_H_
33 #include <Security/SecBase.h>
34 #include <Security/SecPolicy.h>
35 #include <Security/SecCertificate.h>
36 #include <CoreFoundation/CFArray.h>
37 #include <CoreFoundation/CFString.h>
38 #include <Availability.h>
43 CF_ASSUME_NONNULL_BEGIN
44 CF_IMPLICIT_BRIDGING_ENABLED
47 @enum Policy Constants (Private)
48 @discussion Predefined constants used to specify a policy.
50 extern const CFStringRef kSecPolicyAppleMobileStore
51 __OSX_AVAILABLE_STARTING(__MAC_10_9
, __IPHONE_7_0
);
52 extern const CFStringRef kSecPolicyAppleTestMobileStore
53 __OSX_AVAILABLE_STARTING(__MAC_10_9
, __IPHONE_7_0
);
54 extern const CFStringRef kSecPolicyAppleEscrowService
55 __OSX_AVAILABLE_STARTING(__MAC_10_9
, __IPHONE_7_0
);
56 extern const CFStringRef kSecPolicyAppleProfileSigner
57 __OSX_AVAILABLE_STARTING(__MAC_10_9
, __IPHONE_7_0
);
58 extern const CFStringRef kSecPolicyAppleQAProfileSigner
59 __OSX_AVAILABLE_STARTING(__MAC_10_9
, __IPHONE_7_0
);
60 extern const CFStringRef kSecPolicyAppleServerAuthentication
61 __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_8_0
);
62 extern const CFStringRef kSecPolicyAppleOTAPKISigner
63 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12
, __MAC_10_13_4
, __IPHONE_7_0
, __IPHONE_11_3
);
64 extern const CFStringRef kSecPolicyAppleTestOTAPKISigner
65 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12
, __MAC_10_13_4
, __IPHONE_7_0
, __IPHONE_11_3
);
66 extern const CFStringRef kSecPolicyAppleIDValidationRecordSigningPolicy
67 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA
, __MAC_NA
, __IPHONE_7_0
, __IPHONE_10_0
);
68 extern const CFStringRef kSecPolicyAppleIDValidationRecordSigning
69 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
70 extern const CFStringRef kSecPolicyAppleSMPEncryption
71 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_8_0
);
72 extern const CFStringRef kSecPolicyAppleTestSMPEncryption
73 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_8_0
);
74 extern const CFStringRef kSecPolicyApplePCSEscrowService
75 __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
76 extern const CFStringRef kSecPolicyApplePPQSigning
77 __OSX_AVAILABLE_STARTING(__MAC_10_11
, __IPHONE_9_0
);
78 extern const CFStringRef kSecPolicyAppleTestPPQSigning
79 __OSX_AVAILABLE_STARTING(__MAC_10_11
, __IPHONE_9_0
);
80 extern const CFStringRef kSecPolicyAppleSWUpdateSigning
81 __OSX_AVAILABLE_STARTING(__MAC_10_11
, __IPHONE_9_0
);
82 extern const CFStringRef kSecPolicyApplePackageSigning
83 __OSX_AVAILABLE_STARTING(__MAC_10_11
, __IPHONE_9_0
);
84 extern const CFStringRef kSecPolicyAppleOSXProvisioningProfileSigning
85 __OSX_AVAILABLE_STARTING(__MAC_10_11
, __IPHONE_9_0
);
86 extern const CFStringRef kSecPolicyAppleATVVPNProfileSigning
87 __OSX_AVAILABLE_STARTING(__MAC_10_11
, __IPHONE_9_0
);
88 extern const CFStringRef kSecPolicyAppleAST2DiagnosticsServerAuth
89 __OSX_AVAILABLE_STARTING(__MAC_10_11_4
, __IPHONE_9_3
);
90 extern const CFStringRef kSecPolicyAppleEscrowProxyServerAuth
91 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
92 extern const CFStringRef kSecPolicyAppleFMiPServerAuth
93 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
94 extern const CFStringRef kSecPolicyAppleMMCService
95 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
96 extern const CFStringRef kSecPolicyAppleGSService
97 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
98 extern const CFStringRef kSecPolicyApplePPQService
99 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
100 extern const CFStringRef kSecPolicyAppleHomeKitServerAuth
101 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
102 extern const CFStringRef kSecPolicyAppleiPhoneActivation
103 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
104 extern const CFStringRef kSecPolicyAppleiPhoneDeviceCertificate
105 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
106 extern const CFStringRef kSecPolicyAppleFactoryDeviceCertificate
107 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
108 extern const CFStringRef kSecPolicyAppleiAP
109 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
110 extern const CFStringRef kSecPolicyAppleiTunesStoreURLBag
111 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
112 extern const CFStringRef kSecPolicyAppleiPhoneApplicationSigning
113 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
114 extern const CFStringRef kSecPolicyAppleiPhoneProfileApplicationSigning
115 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
116 extern const CFStringRef kSecPolicyAppleiPhoneProvisioningProfileSigning
117 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
118 extern const CFStringRef kSecPolicyAppleLockdownPairing
119 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
120 extern const CFStringRef kSecPolicyAppleURLBag
121 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
122 extern const CFStringRef kSecPolicyAppleOTATasking
123 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
124 extern const CFStringRef kSecPolicyAppleMobileAsset
125 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
126 extern const CFStringRef kSecPolicyAppleIDAuthority
127 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
128 extern const CFStringRef kSecPolicyAppleGenericApplePinned
129 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
130 extern const CFStringRef kSecPolicyAppleGenericAppleSSLPinned
131 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
132 extern const CFStringRef kSecPolicyAppleSoftwareSigning
133 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
134 extern const CFStringRef kSecPolicyAppleExternalDeveloper
135 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
136 extern const CFStringRef kSecPolicyAppleOCSPSigner
137 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
138 extern const CFStringRef kSecPolicyAppleIDSService
139 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
140 extern const CFStringRef kSecPolicyAppleIDSServiceContext
141 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
142 extern const CFStringRef kSecPolicyApplePushService
143 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
144 extern const CFStringRef kSecPolicyAppleLegacyPushService
145 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
146 extern const CFStringRef kSecPolicyAppleTVOSApplicationSigning
147 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
148 extern const CFStringRef kSecPolicyAppleUniqueDeviceIdentifierCertificate
149 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
150 extern const CFStringRef kSecPolicyAppleEscrowProxyCompatibilityServerAuth
151 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
152 extern const CFStringRef kSecPolicyAppleMMCSCompatibilityServerAuth
153 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
154 extern const CFStringRef kSecPolicyAppleSecureIOStaticAsset
155 __OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) __TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1);
156 extern const CFStringRef kSecPolicyAppleWarsaw
157 __OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) __TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1);
158 extern const CFStringRef kSecPolicyAppleiCloudSetupServerAuth
159 __OSX_AVAILABLE(10.12.4) __IOS_AVAILABLE(10.3) __TVOS_AVAILABLE(10.2) __WATCHOS_AVAILABLE(3.2);
160 extern const CFStringRef kSecPolicyAppleiCloudSetupCompatibilityServerAuth
161 __OSX_AVAILABLE(10.12.4) __IOS_AVAILABLE(10.3) __TVOS_AVAILABLE(10.2) __WATCHOS_AVAILABLE(3.2);
162 extern const CFStringRef kSecPolicyAppleAppTransportSecurity
163 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
164 extern const CFStringRef kSecPolicyAppleMobileSoftwareUpdate
165 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
166 extern const CFStringRef kSecPolicyAppleMobileAssetDevelopment
167 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
168 extern const CFStringRef kSecPolicyAppleMacOSProfileApplicationSigning
169 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
170 extern const CFStringRef kSecPolicyAppleBasicAttestationSystem
171 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
172 extern const CFStringRef kSecPolicyAppleBasicAttestationUser
173 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
174 extern const CFStringRef kSecPolicyAppleiPhoneVPNApplicationSigning
175 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
178 @enum Policy Name Constants (Private)
179 @discussion Predefined constants used to specify a SSL Pinning policy.
180 To be used with SecTrustSetPolicyName.
181 @constant kSecPolicyNameAppleAST2Service
182 @constant kSecPolicyNameAppleEscrowProxyService
183 @constant kSecPolicyNameAppleFMiPService
184 @constant kSecPolicyNameAppleGSService
185 @constant kSecPolicyNameAppleHomeKitService
186 @constant kSecPolicyNameAppleiCloudSetupService
187 @constant kSecPolicyNameAppleIDSService
188 @constant kSecPolicyNameAppleMMCSService
189 @constant kSecPolicyNameApplePPQService
190 @constant kSecPolicyNameApplePushService
191 @constant kSecPolicyNameAppleAIDCService
192 @constant kSecPolicyNameAppleMapsService
193 @constant kSecPolicyNameAppleHealthProviderService
194 @constant kSecPolicyNameAppleParsecService
196 extern const CFStringRef kSecPolicyNameAppleAST2Service
197 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
198 extern const CFStringRef kSecPolicyNameAppleEscrowProxyService
199 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
200 extern const CFStringRef kSecPolicyNameAppleFMiPService
201 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
202 extern const CFStringRef kSecPolicyNameAppleGSService
203 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
204 extern const CFStringRef kSecPolicyNameAppleHomeKitService
205 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
206 extern const CFStringRef kSecPolicyNameAppleiCloudSetupService
207 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
208 extern const CFStringRef kSecPolicyNameAppleIDSService
209 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
210 extern const CFStringRef kSecPolicyNameAppleMMCSService
211 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
212 extern const CFStringRef kSecPolicyNameApplePPQService
213 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
214 extern const CFStringRef kSecPolicyNameApplePushService
215 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
216 extern const CFStringRef kSecPolicyNameAppleAIDCService
217 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
218 extern const CFStringRef kSecPolicyNameAppleMapsService
219 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
220 extern const CFStringRef kSecPolicyNameAppleHealthProviderService
221 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
222 extern const CFStringRef kSecPolicyNameAppleParsecService
223 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
226 @enum Policy Value Constants
227 @abstract Predefined property key constants used to get or set values in
228 a dictionary for a policy instance.
230 All policies will have the following read-only value:
231 kSecPolicyOid (the policy object identifier)
233 Additional policy values which your code can optionally set:
234 kSecPolicyName (name which must be matched)
235 kSecPolicyClient (evaluate for client, rather than server)
236 kSecPolicyRevocationFlags (only valid for a revocation policy)
237 kSecPolicyRevocationFlags (only valid for a revocation policy)
238 kSecPolicyTeamIdentifier (only valid for a Passbook signing policy)
239 kSecPolicyContext (valid for policies below that take a context parameter)
240 kSecPolicyPolicyName (only valid for GenericApplePinned or
241 GenericAppleSSLPinned policies)
242 kSecPolicyIntermediateMarkerOid (only valid for GenericApplePinned or
243 GenericAppleSSLPinned policies)
244 kSecPolicyLeafMarkerOid (only valid for GenericApplePinned or
245 GenericAppleSSLPinned policies)
246 kSecPolicyRootDigest (only valid for the UniqueDeviceCertificate policy)
248 @constant kSecPolicyContext Specifies a CFDictionaryRef with keys and values
249 specified by the particular SecPolicyCreate function.
250 @constant kSecPolicyPolicyName Specifies a CFStringRef of the name of the
251 desired policy result.
252 @constant kSecPolicyIntermediateMarkerOid Specifies a CFStringRef of the
253 marker OID (in decimal format) required in the intermediate certificate.
254 @constant kSecPolicyLeafMarkerOid Specifies a CFStringRef of the
255 marker OID (in decimal format) required in the leaf certificate.
256 @constant kSecPolicyRootDigest Specifies a CFDataRef of digest required to
257 match the SHA-256 of the root certificate.
259 extern const CFStringRef kSecPolicyContext
260 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
261 extern const CFStringRef kSecPolicyPolicyName
262 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
263 extern const CFStringRef kSecPolicyIntermediateMarkerOid
264 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
265 extern const CFStringRef kSecPolicyLeafMarkerOid
266 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
267 extern const CFStringRef kSecPolicyRootDigest
268 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
271 @enum Revocation Policy Constants
272 @abstract Predefined constants which allow you to specify how revocation
273 checking will be performed for a trust evaluation.
274 @constant kSecRevocationOnlineCheck If this flag is set, perform an online
275 revocation check, ignoring cached revocation results. This flag will not force
276 an online check if an online check was done within the last 5 minutes. Online
277 checks are only applicable to OCSP; this constant will not force a fresh
280 CF_ENUM(CFOptionFlags
) {
281 kSecRevocationOnlineCheck
= (1 << 5)
285 @function SecPolicyCreateApplePinned
286 @abstract Returns a policy object for verifying Apple certificates.
287 @param policyName A string that identifies the policy name.
288 @param intermediateMarkerOID A string containing the decimal representation of the
289 extension OID in the intermediate certificate.
290 @param leafMarkerOID A string containing the decimal representation of the extension OID
291 in the leaf certificate.
292 @discussion The resulting policy uses the Basic X.509 policy with validity check and
294 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
295 the chain to be anchored to Test Apple Root CAs if the value true is set for the key
296 "ApplePinningAllowTestCerts%@" (where %@ is the policyName parameter) in the
297 com.apple.security preferences for the user of the calling application.
298 * There are exactly 3 certs in the chain.
299 * The intermediate has a marker extension with OID matching the intermediateMarkerOID
301 * The leaf has a marker extension with OID matching the leafMarkerOID parameter.
302 * Revocation is checked via any available method.
303 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
304 @result A policy object. The caller is responsible for calling CFRelease on this when
305 it is no longer needed.
307 __nullable CF_RETURNS_RETAINED
308 SecPolicyRef
SecPolicyCreateApplePinned(CFStringRef policyName
,
309 CFStringRef intermediateMarkerOID
, CFStringRef leafMarkerOID
)
310 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
313 @function SecPolicyCreateAppleSSLPinned
314 @abstract Returns a policy object for verifying Apple SSL certificates.
315 @param policyName A string that identifies the service/policy name.
316 @param hostname hostname to verify the certificate name against.
317 @param intermediateMarkerOID A string containing the decimal representation of the
318 extension OID in the intermediate certificate. If NULL is passed, the default OID of
319 1.2.840.113635.100.6.2.12 is checked.
320 @param leafMarkerOID A string containing the decimal representation of the extension OID
321 in the leaf certificate.
322 @discussion The resulting policy uses the Basic X.509 policy with validity check and
324 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
325 the chain to be anchored to Test Apple Root CAs if the value true is set for the key
326 "ApplePinningAllowTestCerts%@" (where %@ is the policyName parameter) in the
327 com.apple.security preferences for the user of the calling application.
328 * There are exactly 3 certs in the chain.
329 * The intermediate has a marker extension with OID matching the intermediateMarkerOID
330 parameter, or 1.2.840.113635.100.6.2.12 if NULL is passed.
331 * The leaf has a marker extension with OID matching the leafMarkerOID parameter.
332 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
333 extension or Common Name.
334 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
335 * Revocation is checked via any available method.
336 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
337 @result A policy object. The caller is responsible for calling CFRelease on this when
338 it is no longer needed.
340 __nullable CF_RETURNS_RETAINED
341 SecPolicyRef
SecPolicyCreateAppleSSLPinned(CFStringRef policyName
, CFStringRef hostname
,
342 CFStringRef __nullable intermediateMarkerOID
, CFStringRef leafMarkerOID
)
343 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
346 @function SecPolicyCreateiPhoneActivation
347 @abstract Returns a policy object for verifying iPhone Activation
349 @discussion This policy uses the Basic X.509 policy with no validity check
351 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
352 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
353 * There are exactly 3 certs in chain.
354 * The intermediate has Common Name "Apple iPhone Certification Authority".
355 * The leaf has Common Name "iPhone Activation".
356 @result A policy object. The caller is responsible for calling CFRelease
357 on this when it is no longer needed.
359 __nullable CF_RETURNS_RETAINED
360 SecPolicyRef
SecPolicyCreateiPhoneActivation(void);
363 @function SecPolicyCreateiPhoneDeviceCertificate
364 @abstract Returns a policy object for verifying iPhone Device certificate
366 @discussion This policy uses the Basic X.509 policy with no validity check
368 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
369 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
370 * There are exactly 4 certs in chain.
371 * The first intermediate has Common Name "Apple iPhone Device CA".
372 @result A policy object. The caller is responsible for calling CFRelease
373 on this when it is no longer needed.
375 __nullable CF_RETURNS_RETAINED
376 SecPolicyRef
SecPolicyCreateiPhoneDeviceCertificate(void);
379 @function SecPolicyCreateFactoryDeviceCertificate
380 @abstract Returns a policy object for verifying Factory Device certificate
382 @discussion This policy uses the Basic X.509 policy with no validity check
384 * The chain is anchored to the Factory Device CA.
385 @result A policy object. The caller is responsible for calling CFRelease
386 on this when it is no longer needed.
388 __nullable CF_RETURNS_RETAINED
389 SecPolicyRef
SecPolicyCreateFactoryDeviceCertificate(void);
392 @function SecPolicyCreateiAP
393 @abstract Returns a policy object for verifying iAP certificate chains.
394 @discussion This policy uses the Basic X.509 policy with no validity check
396 * The leaf has notBefore date after 5/31/2006 midnight GMT.
397 * The leaf has Common Name beginning with "IPA_".
398 The intended use of this policy is that the caller pass in the
399 intermediates for iAP1 and iAP2 to SecTrustSetAnchorCertificates().
400 @result A policy object. The caller is responsible for calling CFRelease
401 on this when it is no longer needed.
403 __nullable CF_RETURNS_RETAINED
404 SecPolicyRef
SecPolicyCreateiAP(void);
407 @function SecPolicyCreateiTunesStoreURLBag
408 @abstract Returns a policy object for verifying iTunes Store URL bag
410 @discussion This policy uses the Basic X.509 policy with no validity check
412 * The chain is anchored to the iTMS CA.
413 * There are exactly 2 certs in the chain.
414 * The leaf has Organization "Apple Inc.".
415 * The leaf has Common Name "iTunes Store URL Bag".
416 @result A policy object. The caller is responsible for calling CFRelease
417 on this when it is no longer needed.
419 __nullable CF_RETURNS_RETAINED
420 SecPolicyRef
SecPolicyCreateiTunesStoreURLBag(void);
423 @function SecPolicyCreateEAP
424 @abstract Returns a policy object for verifying for 802.1x/EAP certificates.
425 @param server Passing true for this parameter create a policy for EAP
427 @param trustedServerNames Optional; if present, the hostname in the leaf
428 certificate must be in the trustedServerNames list. Note that contrary
429 to all other policies the trustedServerNames list entries can have wildcards
430 whilst the certificate cannot. This matches the existing deployments.
431 @discussion This policy uses the Basic X.509 policy with validity check but
432 disallowing network fetching. If trustedServerNames param is non-null, the
433 ExtendedKeyUsage extension, if present, of the leaf certificate is verified
434 to contain either the ServerAuth OID, if the server param is true or
435 ClientAuth OID, otherwise.
436 @result A policy object. The caller is responsible for calling CFRelease
437 on this when it is no longer needed.
439 __nullable CF_RETURNS_RETAINED
440 SecPolicyRef
SecPolicyCreateEAP(Boolean server
, CFArrayRef __nullable trustedServerNames
);
443 @function SecPolicyCreateIPSec
444 @abstract Returns a policy object for evaluating IPSec certificate chains.
445 @param server Passing true for this parameter create a policy for IPSec
447 @param hostname Optional; if present, the policy will require the specified
448 hostname or ip address to match the hostname in the leaf certificate.
449 @discussion This policy uses the Basic X.509 policy with validity check.
450 @result A policy object. The caller is responsible for calling CFRelease
451 on this when it is no longer needed.
453 __nullable CF_RETURNS_RETAINED
454 SecPolicyRef
SecPolicyCreateIPSec(Boolean server
, CFStringRef __nullable hostname
);
457 @function SecPolicyCreateAppleSWUpdateSigning
458 @abstract Returns a policy object for evaluating SW update signing certs.
459 @discussion This policy uses the Basic X.509 policy with no validity check
461 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
462 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
463 * There are exactly 3 certs in the chain.
464 * The intermediate ExtendedKeyUsage Extension contains 1.2.840.113635.100.4.1.
465 * The leaf ExtendedKeyUsage extension contains 1.2.840.113635.100.4.1.
466 @result A policy object. The caller is responsible for calling CFRelease
467 on this when it is no longer needed.
469 __nullable CF_RETURNS_RETAINED
470 SecPolicyRef
SecPolicyCreateAppleSWUpdateSigning(void);
473 @function SecPolicyCreateApplePackageSigning
474 @abstract Returns a policy object for evaluating installer package signing certs.
475 @discussion This policy uses the Basic X.509 policy with no validity check
477 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
478 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
479 * There are exactly 3 certs in the chain.
480 * The leaf KeyUsage extension has the digital signature bit set.
481 * The leaf ExtendedKeyUsage extension has the CodeSigning OID.
482 @result A policy object. The caller is responsible for calling CFRelease
483 on this when it is no longer needed.
485 __nullable CF_RETURNS_RETAINED
486 SecPolicyRef
SecPolicyCreateApplePackageSigning(void);
489 @function SecPolicyCreateiPhoneApplicationSigning
490 @abstract Returns a policy object for evaluating signed application
491 signatures. This is for apps signed directly by the app store.
492 @discussion This policy uses the Basic X.509 policy with no validity check
494 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
495 the chain to be anchored to Test Apple Root CAs.
496 * There are exactly 3 certs in the chain.
497 * The intermediate has Common Name "Apple iPhone Certification Authority".
498 * The leaf has Common Name "Apple iPhone OS Application Signing".
499 * The leaf has a marker extension with OID 1.2.840.113635.100.6.1.3 or OID
500 1.2.840.113635.100.6.1.6.
501 * The leaf has ExtendedKeyUsage, if any, with the AnyExtendedKeyUsage OID
502 or the CodeSigning OID.
503 @result A policy object. The caller is responsible for calling CFRelease
504 on this when it is no longer needed.
506 __nullable CF_RETURNS_RETAINED
507 SecPolicyRef
SecPolicyCreateiPhoneApplicationSigning(void);
510 @function SecPolicyCreateiPhoneVPNApplicationSigning
511 @abstract Returns a policy object for evaluating signed VPN application
512 signatures. This is for VPN plugins signed directly by the VPN team.
513 @discussion This policy uses the Basic X.509 policy with no validity check
515 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
516 the chain to be anchored to Test Apple Root CAs.
517 * There are exactly 3 certs in the chain.
518 * The intermediate has Common Name "Apple iPhone Certification Authority".
519 * The leaf has Common Name "Apple iPhone OS Application Signing".
520 * The leaf has a marker extension with 1.2.840.113635.100.6.1.6.
521 * The leaf has ExtendedKeyUsage, if any, with the AnyExtendedKeyUsage OID
522 or the CodeSigning OID.
523 @result A policy object. The caller is responsible for calling CFRelease
524 on this when it is no longer needed.
526 __nullable CF_RETURNS_RETAINED
527 SecPolicyRef
SecPolicyCreateiPhoneVPNApplicationSigning(void)
528 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
531 @function SecPolicyCreateiPhoneProfileApplicationSigning
532 @abstract Returns a policy object for evaluating signed application
533 signatures. This policy is for certificates inside a UPP or regular
535 @discussion This policy uses the Basic X.509 policy with validity check and
537 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
538 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
539 * There are exactly 3 certs in the chain.
540 * The intermediate has a marker extension with OID matching 1.2.840.113635.100.6.2.1 (WWDR CA).
541 * The leaf has a marker extension with OID matching one of the following:
542 * 1.2.840.113635.100.6.1.2 ("iPhone Developer" leaf)
543 * 1.2.840.113635.100.6.1.4 ("iPhone Distribution" leaf)
544 * 1.2.840.113635.100.6.1.25.1 ("TestFlight" leaf)
545 * On internal releases, 1.2.840.113635.100.6.1.25.2
546 * The leaf has an ExtendedKeyUsage OID matching 1.3.6.1.5.5.7.3.3 (CodeSigning EKU).
547 * Revocation is checked via any available method.
548 @result A policy object. The caller is responsible for calling CFRelease
549 on this when it is no longer needed.
551 __nullable CF_RETURNS_RETAINED
552 SecPolicyRef
SecPolicyCreateiPhoneProfileApplicationSigning(void);
555 @function SecPolicyCreateMacOSProfileApplicationSigning
556 @abstract Returns a policy object for evaluating signed application
557 signatures. This policy is for certificates inside a UPP or regular
559 @discussion This policy uses the Basic X.509 policy with no validity check
561 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
562 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
563 * There are exactly 3 certs in the chain.
564 * The leaf has a marker extension with OID matching one of the following:
565 * 1.2.840.113635.100.6.1.7 ("3rd Party Mac Developer Application" leaf)
566 * 1.2.840.113635.100.6.1.12 ("Mac Developer" leaf)
567 * 1.2.840.113635.100.6.1.13 ("Developer ID Application" leaf)
568 * 1.2.840.113635.100.6.22 ("Software Signing" leaf
569 * The leaf has an ExtendedKeyUsage OID matching 1.3.6.1.5.5.7.3.3 (CodeSigning EKU).
570 * Revocation is checked via any available method.
571 @result A policy object. The caller is responsible for calling CFRelease
572 on this when it is no longer needed.
574 __nullable CF_RETURNS_RETAINED
575 SecPolicyRef
SecPolicyCreateMacOSProfileApplicationSigning(void)
576 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
579 @function SecPolicyCreateiPhoneProvisioningProfileSigning
580 @abstract Returns a policy object for evaluating provisioning profile signatures.
581 @discussion This policy uses the Basic X.509 policy with no validity check
583 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
584 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
585 * There are exactly 3 certs in the chain.
586 * The intermediate has Common Name "Apple iPhone Certification Authority".
587 * The leaf has Common Name "Apple iPhone OS Provisioning Profile Signing".
588 * If the device is not a production device and is running an internal
589 release, the leaf may have the Common Name "TEST Apple iPhone OS
590 Provisioning Profile Signing TEST".
591 @result A policy object. The caller is responsible for calling CFRelease
592 on this when it is no longer needed.
594 __nullable CF_RETURNS_RETAINED
595 SecPolicyRef
SecPolicyCreateiPhoneProvisioningProfileSigning(void);
598 @function SecPolicyCreateAppleTVOSApplicationSigning
599 @abstract Returns a policy object for evaluating signed application
600 signatures. This is for apps signed directly by the Apple TV app store,
601 and allows for both the prod and the dev/test certs.
602 @discussion This policy uses the Basic X.509 policy with no validity check
604 * The chain is anchored to any of the production Apple Root CAs.
605 Test roots are never permitted.
606 * There are exactly 3 certs in the chain.
607 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.1.
608 * The leaf has ExtendedKeyUsage, if any, with the AnyExtendedKeyUsage OID or
610 * The leaf has a marker extension with OID 1.2.840.113635.100.6.1.24 or OID
611 1.2.840.113635.100.6.1.24.1.
612 @result A policy object. The caller is responsible for calling CFRelease
613 on this when it is no longer needed.
615 __nullable CF_RETURNS_RETAINED
616 SecPolicyRef
SecPolicyCreateAppleTVOSApplicationSigning(void);
619 @function SecPolicyCreateOCSPSigner
620 @abstract Returns a policy object for evaluating ocsp response signers.
621 @discussion This policy uses the Basic X.509 policy with validity check and
622 requires the leaf to have an ExtendedKeyUsage of OCSPSigning.
623 @result A policy object. The caller is responsible for calling CFRelease
624 on this when it is no longer needed.
626 __nullable CF_RETURNS_RETAINED
627 SecPolicyRef
SecPolicyCreateOCSPSigner(void);
631 kSecSignSMIMEUsage
= (1 << 0),
632 kSecKeyEncryptSMIMEUsage
= (1 << 1),
633 kSecDataEncryptSMIMEUsage
= (1 << 2),
634 kSecKeyExchangeDecryptSMIMEUsage
= (1 << 3),
635 kSecKeyExchangeEncryptSMIMEUsage
= (1 << 4),
636 kSecKeyExchangeBothSMIMEUsage
= (1 << 5),
637 kSecAnyEncryptSMIME
= kSecKeyEncryptSMIMEUsage
| kSecDataEncryptSMIMEUsage
|
638 kSecKeyExchangeDecryptSMIMEUsage
| kSecKeyExchangeEncryptSMIMEUsage
,
639 kSecIgnoreExpirationSMIMEUsage
= (1 << 6)
643 @function SecPolicyCreateSMIME
644 @abstract Returns a policy object for evaluating S/MIME certificate chains.
645 @param smimeUsage Pass the bitwise or of one or more kSecXXXSMIMEUsage
646 flags, to indicate the intended usage of this certificate.
647 @param email Optional; if present, the policy will require the specified
648 email to match the email in the leaf certificate.
649 @discussion This policy uses the Basic X.509 policy with validity check and
650 requires the leaf to have
651 * a KeyUsage matching the smimeUsage,
652 * an ExtendedKeyUsage, if any, with the AnyExtendedKeyUsage OID or the
653 EmailProtection OID, and
654 * if the email param is specified, the email address in the RFC822Name in the
655 SubjectAlternativeName extension or in the Email Address field of the
657 Note that temporal validity checking can be disabled with kSecIgnoreExpirationSMIMEUsage
658 @result A policy object. The caller is responsible for calling CFRelease
659 on this when it is no longer needed.
661 __nullable CF_RETURNS_RETAINED
662 SecPolicyRef
SecPolicyCreateSMIME(CFIndex smimeUsage
, CFStringRef __nullable email
);
665 @function SecPolicyCreateCodeSigning
666 @abstract Returns a policy object for evaluating code signing certificate chains.
667 @discussion This policy uses the Basic X.509 policy with validity check and
668 requires the leaf to have
669 * a KeyUsage with both the DigitalSignature and NonRepudiation bits set, and
670 * an ExtendedKeyUsage with the AnyExtendedKeyUsage OID or the CodeSigning OID.
671 @result A policy object. The caller is responsible for calling CFRelease
672 on this when it is no longer needed.
674 __nullable CF_RETURNS_RETAINED
675 SecPolicyRef
SecPolicyCreateCodeSigning(void);
678 @function SecPolicyCreateLockdownPairing
679 @abstract basic x509 policy for checking lockdown pairing certificate chains.
680 @disucssion This policy checks some of the Basic X.509 policy options with no
681 validity check. It explicitly allows for empty subjects.
682 @result A policy object. The caller is responsible for calling CFRelease
683 on this when it is no longer needed.
685 __nullable CF_RETURNS_RETAINED
686 SecPolicyRef
SecPolicyCreateLockdownPairing(void);
689 @function SecPolicyCreateURLBag
690 @abstract Returns a policy object for evaluating certificate chains for signing URL bags.
691 @discussion This policy uses the Basic X.509 policy with no validity check and requires
692 that the leaf has ExtendedKeyUsage extension with the CodeSigning OID.
693 @result A policy object. The caller is responsible for calling CFRelease
694 on this when it is no longer needed.
696 __nullable CF_RETURNS_RETAINED
697 SecPolicyRef
SecPolicyCreateURLBag(void);
700 @function SecPolicyCreateOTATasking
701 @abstract Returns a policy object for evaluating certificate chains for signing OTA Tasking.
702 @discussion This policy uses the Basic X.509 policy with validity check and
704 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
705 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
706 * There are exactly 3 certs in the chain.
707 * The intermediate has Common Name "Apple iPhone Certification Authority".
708 * The leaf has Common Name "OTA Task Signing".
709 @result A policy object. The caller is responsible for calling CFRelease
710 on this when it is no longer needed.
712 __nullable CF_RETURNS_RETAINED
713 SecPolicyRef
SecPolicyCreateOTATasking(void);
716 @function SecPolicyCreateMobileAsset
717 @abstract Returns a policy object for evaluating certificate chains for signing Mobile Assets.
718 @discussion This policy uses the Basic X.509 policy with no validity check
720 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
721 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
722 * There are exactly 3 certs in the chain.
723 * The intermediate has Common Name "Apple iPhone Certification Authority".
724 * The leaf has Common Name "Asset Manifest Signing".
725 @result A policy object. The caller is responsible for calling CFRelease
726 on this when it is no longer needed.
728 __nullable CF_RETURNS_RETAINED
729 SecPolicyRef
SecPolicyCreateMobileAsset(void);
732 @function SecPolicyCreateMobileAssetDevelopment
733 @abstract Returns a policy object for evaluating certificate chains for signing development
735 @discussion This policy uses the Basic X.509 policy with no validity check
737 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
738 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
739 * There are exactly 3 certs in the chain.
740 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.18.
741 * The leaf has a marker extension with OID 1.2.840.113635.100.6.55.1.
742 @result A policy object. The caller is responsible for calling CFRelease
743 on this when it is no longer needed.
745 __nullable CF_RETURNS_RETAINED
746 SecPolicyRef
SecPolicyCreateMobileAssetDevelopment(void)
747 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
750 @function SecPolicyCreateAppleIDAuthorityPolicy
751 @abstract Returns a policy object for evaluating certificate chains for Apple ID Authority.
752 @discussion This policy uses the Basic X.509 policy with validity check
754 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
755 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
756 * The intermediate(s) has(have) a marker extension with OID 1.2.840.113635.100.6.2.3
757 or OID 1.2.840.113635.100.6.2.7.
758 * The leaf has a marker extension with OID 1.2.840.113635.100.4.7.
759 * Revocation is checked via any available method.
760 @result A policy object. The caller is responsible for calling CFRelease
761 on this when it is no longer needed.
763 __nullable CF_RETURNS_RETAINED
764 SecPolicyRef
SecPolicyCreateAppleIDAuthorityPolicy(void);
767 @function SecPolicyCreateMacAppStoreReceipt
768 @abstract Returns a policy object for evaluating certificate chains for signing
769 Mac App Store Receipts.
770 @discussion This policy uses the Basic X.509 policy with validity check
772 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
773 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
774 * There are exactly 3 certs in the chain.
775 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.1.
776 * The leaf has CertificatePolicy extension with OID 1.2.840.113635.100.5.6.1.
777 * The leaf has a marker extension with OID 1.2.840.113635.100.6.11.1.
778 * Revocation is checked via any available method.
779 @result A policy object. The caller is responsible for calling CFRelease
780 on this when it is no longer needed.
782 __nullable CF_RETURNS_RETAINED
783 SecPolicyRef
SecPolicyCreateMacAppStoreReceipt(void);
786 @function SecPolicyCreatePassbookCardSigner
787 @abstract Returns a policy object for evaluating certificate chains for signing Passbook cards.
788 @param cardIssuer Required; must match name in marker extension.
789 @param teamIdentifier Optional; if present, the policy will require the specified
790 team ID to match the organizationalUnit field in the leaf certificate's subject.
791 @discussion This policy uses the Basic X.509 policy with validity check
793 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
794 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
795 * The leaf has a marker extension with OID 1.2.840.113635.100.6.1.16 and containing the
797 * The leaf has ExtendedKeyUsage with OID 1.2.840.113635.100.4.14.
798 * The leaf has a Organizational Unit matching the TeamID.
799 @result A policy object. The caller is responsible for calling CFRelease
800 on this when it is no longer needed.
802 __nullable CF_RETURNS_RETAINED
803 SecPolicyRef
SecPolicyCreatePassbookCardSigner(CFStringRef cardIssuer
,
804 CFStringRef __nullable teamIdentifier
);
807 @function SecPolicyCreateMobileStoreSigner
808 @abstract Returns a policy object for evaluating Mobile Store certificate chains.
809 @discussion This policy uses the Basic X.509 policy with validity check
811 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
812 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
813 * There are exactly 3 certs in the chain.
814 * The intermediate has Common Name "Apple System Integration 2 Certification Authority".
815 * The leaf has KeyUsage with the DigitalSignature bit set.
816 * The leaf has CertificatePolicy extension with OID 1.2.840.113635.100.5.12.
817 @result A policy object. The caller is responsible for calling CFRelease
818 on this when it is no longer needed.
820 __nullable CF_RETURNS_RETAINED
821 SecPolicyRef
SecPolicyCreateMobileStoreSigner(void);
824 @function SecPolicyCreateTestMobileStoreSigner
825 @abstract Returns a policy object for evaluating Test Mobile Store certificate chains.
826 @discussion This policy uses the Basic X.509 policy with validity check
828 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
829 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
830 * There are exactly 3 certs in the chain.
831 * The intermediate has Common Name "Apple System Integration 2 Certification Authority".
832 * The leaf has KeyUsage with the DigitalSignature bit set.
833 * The leaf has CertificatePolicy extension with OID 1.2.840.113635.100.5.12.1.
834 @result A policy object. The caller is responsible for calling CFRelease
835 on this when it is no longer needed.
837 __nullable CF_RETURNS_RETAINED
838 SecPolicyRef
SecPolicyCreateTestMobileStoreSigner(void);
841 @function SecPolicyCreateEscrowServiceSigner
842 @abstract Returns a policy object for evaluating Escrow Service certificate chains.
843 @discussion This policy uses the Basic X.509 policy with no validity check
845 * The chain is anchored to the current Escrow Roots in the OTAPKI asset.
846 * There are exactly 2 certs in the chain.
847 * The leaf has KeyUsage with the KeyEncipherment bit set.
848 @result A policy object. The caller is responsible for calling CFRelease
849 on this when it is no longer needed.
851 __nullable CF_RETURNS_RETAINED
852 SecPolicyRef
SecPolicyCreateEscrowServiceSigner(void);
855 @function SecPolicyCreatePCSEscrowServiceSigner
856 @abstract Returns a policy object for evaluating PCS Escrow Service certificate chains.
857 @discussion This policy uses the Basic X.509 policy with validity check
859 * The chain is anchored to the current PCS Escrow Roots in the OTAPKI asset.
860 * There are exactly 2 certs in the chain.
861 * The leaf has KeyUsage with the KeyEncipherment bit set.
862 @result A policy object. The caller is responsible for calling CFRelease
863 on this when it is no longer needed.
865 __nullable CF_RETURNS_RETAINED
866 SecPolicyRef
SecPolicyCreatePCSEscrowServiceSigner(void);
869 @function SecPolicyCreateOSXProvisioningProfileSigning
870 @abstract Returns a policy object for evaluating certificate chains for signing OS X
871 Provisioning Profiles.
872 @discussion This policy uses the Basic X.509 policy with validity check
874 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
875 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
876 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.1.
877 * The leaf has KeyUsage with the DigitalSignature bit set.
878 * The leaf has a marker extension with OID 1.2.840.113635.100.4.11.
879 * Revocation is checked via OCSP.
880 @result A policy object. The caller is responsible for calling CFRelease
881 on this when it is no longer needed.
883 __nullable CF_RETURNS_RETAINED
884 SecPolicyRef
SecPolicyCreateOSXProvisioningProfileSigning(void);
887 @function SecPolicyCreateConfigurationProfileSigner
888 @abstract Returns a policy object for evaluating certificate chains for signing
889 Configuration Profiles.
890 @discussion This policy uses the Basic X.509 policy with validity check
892 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
893 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
894 * There are exactly 3 certs in the chain.
895 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.3.
896 * The leaf has ExtendedKeyUsage with OID 1.2.840.113635.100.4.16.
897 @result A policy object. The caller is responsible for calling CFRelease
898 on this when it is no longer needed.
900 __nullable CF_RETURNS_RETAINED
901 SecPolicyRef
SecPolicyCreateConfigurationProfileSigner(void);
904 @function SecPolicyCreateQAConfigurationProfileSigner
905 @abstract Returns a policy object for evaluating certificate chains for signing
906 QA Configuration Profiles. On customer builds, this function returns the same
907 policy as SecPolicyCreateConfigurationProfileSigner.
908 @discussion This policy uses the Basic X.509 policy with validity check
910 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
911 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
912 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.3.
913 * The leaf has ExtendedKeyUsage with OID 1.2.840.113635.100.4.17.
914 @result A policy object. The caller is responsible for calling CFRelease
915 on this when it is no longer needed.
917 __nullable CF_RETURNS_RETAINED
918 SecPolicyRef
SecPolicyCreateQAConfigurationProfileSigner(void);
921 @function SecPolicyCreateOTAPKISigner
922 @abstract Returns a policy object for evaluating OTA PKI certificate chains.
923 @discussion This policy uses the Basic X.509 policy with validity check
925 * The chain is anchored to Apple PKI Settings CA.
926 * There are exactly 2 certs in the chain.
927 @result A policy object. The caller is responsible for calling CFRelease
928 on this when it is no longer needed.
930 __nullable CF_RETURNS_RETAINED
931 SecPolicyRef
SecPolicyCreateOTAPKISigner(void)
932 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12
, __MAC_10_13_4
, __IPHONE_7_0
, __IPHONE_11_3
);
935 @function SecPolicyCreateTestOTAPKISigner
936 @abstract Returns a policy object for evaluating OTA PKI certificate chains.
937 @discussion This policy uses the Basic X.509 policy with validity check
939 * The chain is anchored to Apple Test PKI Settings CA.
940 * There are exactly 2 certs in the chain.
941 @result A policy object. The caller is responsible for calling CFRelease
942 on this when it is no longer needed.
944 __nullable CF_RETURNS_RETAINED
945 SecPolicyRef
SecPolicyCreateTestOTAPKISigner(void)
946 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12
, __MAC_10_13_4
, __IPHONE_7_0
, __IPHONE_11_3
);
949 @function SecPolicyCreateAppleIDValidationRecordSigningPolicy
950 @abstract Returns a policy object for evaluating certificate chains for signing
951 Apple ID Validation Records.
952 @discussion This policy uses the Basic X.509 policy with validity check
954 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
955 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
956 * The intermediate(s) has(have) a marker extension with OID 1.2.840.113635.100.6.2.3
957 or OID 1.2.840.113635.100.6.2.10.
958 * The leaf has a marker extension with OID 1.2.840.113635.100.6.25.
959 * Revocation is checked via OCSP.
960 @result A policy object. The caller is responsible for calling CFRelease
961 on this when it is no longer needed.
963 __nullable CF_RETURNS_RETAINED
964 SecPolicyRef
SecPolicyCreateAppleIDValidationRecordSigningPolicy(void);
967 @function SecPolicyCreateAppleSMPEncryption
968 @abstract Returns a policy object for evaluating SMP certificate chains.
969 @discussion This policy uses the Basic X.509 policy with no validity check
971 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
972 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
973 * There are exactly 3 certs in the chain.
974 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.13.
975 * The leaf has KeyUsage with the KeyEncipherment bit set.
976 * The leaf has a marker extension with OID 1.2.840.113635.100.6.30.
977 * Revocation is checked via OCSP.
978 @result A policy object. The caller is responsible for calling CFRelease
979 on this when it is no longer needed.
981 __nullable CF_RETURNS_RETAINED
982 SecPolicyRef
SecPolicyCreateAppleSMPEncryption(void);
985 @function SecPolicyCreateTestAppleSMPEncryption
986 @abstract Returns a policy object for evaluating Test SMP certificate chains.
987 @discussion This policy uses the Basic X.509 policy with no validity check
989 * The chain is anchored to a Test Apple Root with ECC public key certificate.
990 * There are exactly 3 certs in the chain.
991 * The intermediate has Common Name "Test Apple System Integration CA - ECC".
992 * The leaf has KeyUsage with the KeyEncipherment bit set.
993 * Revocation is checked via OCSP.
994 @result A policy object. The caller is responsible for calling CFRelease
995 on this when it is no longer needed.
997 __nullable CF_RETURNS_RETAINED
998 SecPolicyRef
SecPolicyCreateTestAppleSMPEncryption(void);
1001 @function SecPolicyCreateApplePPQSigning
1002 @abstract Returns a policy object for verifying production PPQ Signing certificates.
1003 @discussion This policy uses the Basic X.509 policy with no validity check
1004 and pinning options:
1005 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1006 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1007 * There are exactly 3 certs in the chain.
1008 * The intermediate has Common Name "Apple System Integration 2 Certification
1010 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.10.
1011 * The leaf has KeyUsage with the DigitalSignature bit set.
1012 * The leaf has a marker extension with OID 1.2.840.113635.100.6.38.2.
1013 @result A policy object. The caller is responsible for calling CFRelease
1014 on this when it is no longer needed.
1016 __nullable CF_RETURNS_RETAINED
1017 SecPolicyRef
SecPolicyCreateApplePPQSigning(void);
1020 @function SecPolicyCreateTestApplePPQSigning
1021 @abstract Returns a policy object for verifying test PPQ Signing certificates. On
1022 customer builds, this function returns the same policy as SecPolicyCreateApplePPQSigning.
1023 @discussion This policy uses the Basic X.509 policy with no validity check
1024 and pinning options:
1025 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1026 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1027 * There are exactly 3 certs in the chain.
1028 * The intermediate has Common Name "Apple System Integration 2 Certification
1030 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.10.
1031 * The leaf has KeyUsage with the DigitalSignature bit set.
1032 * The leaf has a marker extension with OID 1.2.840.113635.100.6.38.1.
1033 @result A policy object. The caller is responsible for calling CFRelease
1034 on this when it is no longer needed.
1036 __nullable CF_RETURNS_RETAINED
1037 SecPolicyRef
SecPolicyCreateTestApplePPQSigning(void);
1040 @function SecPolicyCreateAppleIDSService
1041 @abstract Ensure we're appropriately pinned to the IDS service (SSL + Apple restrictions)
1042 @discussion This policy uses the SSL server policy.
1043 @result A policy object. The caller is responsible for calling CFRelease
1044 on this when it is no longer needed.
1046 __nullable CF_RETURNS_RETAINED
1047 SecPolicyRef
SecPolicyCreateAppleIDSService(CFStringRef __nullable hostname
);
1050 @function SecPolicyCreateAppleIDSServiceContext
1051 @abstract Ensure we're appropriately pinned to the IDS service (SSL + Apple restrictions)
1052 @param hostname Required; hostname to verify the certificate name against.
1053 @param context Optional; if present, "AppleServerAuthenticationAllowUATIDS" with value
1054 Boolean true will allow Test Apple roots on internal releases.
1055 @discussion This policy uses the Basic X.509 policy with validity check
1056 and pinning options:
1057 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1058 are permitted only on internal releases either using the context dictionary or with
1060 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1061 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.4.2 or,
1062 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.4.1.
1063 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1064 extension or Common Name.
1065 * The leaf is checked against the Black and Gray lists.
1066 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1067 * Revocation is checked via any available method.
1068 @result A policy object. The caller is responsible for calling CFRelease
1069 on this when it is no longer needed.
1071 __nullable CF_RETURNS_RETAINED
1072 SecPolicyRef
SecPolicyCreateAppleIDSServiceContext(CFStringRef hostname
, CFDictionaryRef __nullable context
);
1075 @function SecPolicyCreateApplePushService
1076 @abstract Ensure we're appropriately pinned to the Apple Push service (SSL + Apple restrictions)
1077 @param hostname Required; hostname to verify the certificate name against.
1078 @param context Optional; if present, "AppleServerAuthenticationAllowUATAPN" with value
1079 Boolean true will allow Test Apple roots on internal releases.
1080 @discussion This policy uses the Basic X.509 policy with validity check
1081 and pinning options:
1082 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1083 are permitted only on internal releases either using the context dictionary or with
1085 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1086 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.5.2 or,
1087 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.5.1.
1088 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1089 extension or Common Name.
1090 * The leaf is checked against the Black and Gray lists.
1091 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1092 * Revocation is checked via any available method.
1093 @result A policy object. The caller is responsible for calling CFRelease
1094 on this when it is no longer needed.
1096 __nullable CF_RETURNS_RETAINED
1097 SecPolicyRef
SecPolicyCreateApplePushService(CFStringRef hostname
, CFDictionaryRef __nullable context
);
1100 @function SecPolicyCreateApplePushServiceLegacy
1101 @abstract Ensure we're appropriately pinned to the Push service (via Entrust)
1102 @param hostname Required; hostname to verify the certificate name against.
1103 @discussion This policy uses the Basic X.509 policy with validity check
1104 and pinning options:
1105 * The chain is anchored to an Entrust Intermediate.
1106 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1107 extension or Common Name.
1108 * The leaf is checked against the Black and Gray lists.
1109 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1110 * Revocation is checked via any available method.
1111 @result A policy object. The caller is responsible for calling CFRelease
1112 on this when it is no longer needed.
1114 __nullable CF_RETURNS_RETAINED
1115 SecPolicyRef
SecPolicyCreateApplePushServiceLegacy(CFStringRef hostname
);
1118 @function SecPolicyCreateAppleMMCSService
1119 @abstract Ensure we're appropriately pinned to the MMCS service (SSL + Apple restrictions)
1120 @param hostname Required; hostname to verify the certificate name against.
1121 @param context Optional; if present, "AppleServerAuthenticationAllowUATMMCS" with value
1122 Boolean true will allow Test Apple roots and test OIDs on internal releases.
1123 @discussion This policy uses the Basic X.509 policy with validity check
1124 and pinning options:
1125 * The chain is anchored to any of the production Apple Root CAs.
1126 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1127 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.11.2 or, if
1128 enabled, OID 1.2.840.113635.100.6.27.11.1.
1129 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1130 extension or Common Name.
1131 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1132 * Revocation is checked via any available method.
1133 @result A policy object. The caller is responsible for calling CFRelease
1134 on this when it is no longer needed.
1136 __nullable CF_RETURNS_RETAINED
1137 SecPolicyRef
SecPolicyCreateAppleMMCSService(CFStringRef hostname
, CFDictionaryRef __nullable context
);
1140 @function SecPolicyCreateAppleCompatibilityMMCSService
1141 @abstract Ensure we're appropriately pinned to the MMCS service using compatibility certs
1142 @param hostname Required; hostname to verify the certificate name against.
1143 @discussion This policy uses the Basic X.509 policy with validity check
1144 and pinning options:
1145 * The chain is anchored to the GeoTrust Global CA
1146 * The intermediate has a subject public key info hash matching the public key of
1147 the Apple IST CA G1 intermediate.
1148 * The chain length is 3.
1149 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.11.2 or
1150 OID 1.2.840.113635.100.6.27.11.1.
1151 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1152 extension or Common Name.
1153 * The leaf is checked against the Black and Gray lists.
1154 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1155 @result A policy object. The caller is responsible for calling CFRelease
1156 on this when it is no longer needed.
1158 __nullable CF_RETURNS_RETAINED
1159 SecPolicyRef
SecPolicyCreateAppleCompatibilityMMCSService(CFStringRef hostname
)
1160 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
1163 @function SecPolicyCreateAppleGSService
1164 @abstract Ensure we're appropriately pinned to the GS service (SSL + Apple restrictions)
1165 @param hostname Required; hostname to verify the certificate name against.
1166 @param context Optional; if present, "AppleServerAuthenticationAllowUATGS" with value
1167 Boolean true will allow Test Apple roots on internal releases.
1168 @discussion This policy uses the Basic X.509 policy with validity check
1169 and pinning options:
1170 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1171 are permitted only on internal releases either using the context dictionary or with
1173 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1174 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.2.
1175 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1176 extension or Common Name.
1177 * The leaf is checked against the Black and Gray lists.
1178 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1179 * Revocation is checked via any available method.
1180 @result A policy object. The caller is responsible for calling CFRelease
1181 on this when it is no longer needed.
1183 __nullable CF_RETURNS_RETAINED
1184 SecPolicyRef
SecPolicyCreateAppleGSService(CFStringRef hostname
, CFDictionaryRef __nullable context
)
1185 __OSX_AVAILABLE_STARTING(__MAC_10_11
, __IPHONE_9_0
);
1188 @function SecPolicyCreateApplePPQService
1189 @abstract Ensure we're appropriately pinned to the PPQ service (SSL + Apple restrictions)
1190 @param hostname Required; hostname to verify the certificate name against.
1191 @param context Optional; if present, "AppleServerAuthenticationAllowUATPPQ" with value
1192 Boolean true will allow Test Apple roots on internal releases.
1193 @discussion This policy uses the Basic X.509 policy with validity check
1194 and pinning options:
1195 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1196 are permitted only on internal releases either using the context dictionary or with
1198 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1199 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.3.2 or,
1200 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.3.1.
1201 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1202 extension or Common Name.
1203 * The leaf is checked against the Black and Gray lists.
1204 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1205 * Revocation is checked via any available method.
1206 @result A policy object. The caller is responsible for calling CFRelease
1207 on this when it is no longer needed.
1209 __nullable CF_RETURNS_RETAINED
1210 SecPolicyRef
SecPolicyCreateApplePPQService(CFStringRef hostname
, CFDictionaryRef __nullable context
)
1211 __OSX_AVAILABLE_STARTING(__MAC_10_11
, __IPHONE_9_0
);
1214 @function SecPolicyCreateAppleAST2Service
1215 @abstract Ensure we're appropriately pinned to the AST2 Diagnostic service (SSL + Apple restrictions)
1216 @param hostname Required; hostname to verify the certificate name against.
1217 @param context Optional; if present, "AppleServerAuthenticationAllowUATAST2" with value
1218 Boolean true will allow Test Apple roots on internal releases.
1219 @discussion This policy uses the Basic X.509 policy with validity check
1220 and pinning options:
1221 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1222 are permitted either using the context dictionary or with defaults write.
1223 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1224 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.8.2 or,
1225 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.8.1.
1226 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1227 extension or Common Name.
1228 * The leaf is checked against the Black and Gray lists.
1229 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1230 * Revocation is checked via any available method.
1231 @result A policy object. The caller is responsible for calling CFRelease
1232 on this when it is no longer needed.
1234 __nullable CF_RETURNS_RETAINED
1235 SecPolicyRef
SecPolicyCreateAppleAST2Service(CFStringRef hostname
, CFDictionaryRef __nullable context
)
1236 __OSX_AVAILABLE_STARTING(__MAC_10_11_4
, __IPHONE_9_3
);
1239 @function SecPolicyCreateAppleEscrowProxyService
1240 @abstract Ensure we're appropriately pinned to the iCloud Escrow Proxy service (SSL + Apple restrictions)
1241 @param hostname Required; hostname to verify the certificate name against.
1242 @param context Optional; if present, "AppleServerAuthenticationAllowUATEscrow" with value
1243 Boolean true will allow Test Apple roots on internal releases.
1244 @discussion This policy uses the Basic X.509 policy with validity check
1245 and pinning options:
1246 * The chain is anchored to any of the production Apple Root CAs via full certificate
1247 comparison. Test Apple Root CAs are permitted only on internal releases either
1248 using the context dictionary or with defaults write.
1249 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1250 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.7.2 or,
1251 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.7.1.
1252 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1253 extension or Common Name.
1254 * The leaf is checked against the Black and Gray lists.
1255 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1256 * Revocation is checked via any available method.
1257 @result A policy object. The caller is responsible for calling CFRelease
1258 on this when it is no longer needed.
1260 __nullable CF_RETURNS_RETAINED
1261 SecPolicyRef
SecPolicyCreateAppleEscrowProxyService(CFStringRef hostname
, CFDictionaryRef __nullable context
)
1262 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
1265 @function SecPolicyCreateAppleCompatibilityEscrowProxyService
1266 @abstract Ensure we're appropriately pinned to the iCloud Escrow Proxy service using compatibility certs
1267 @param hostname Required; hostname to verify the certificate name against.
1268 @discussion This policy uses the Basic X.509 policy with validity check
1269 and pinning options:
1270 * The chain is anchored to the GeoTrust Global CA
1271 * The intermediate has a subject public key info hash matching the public key of
1272 the Apple IST CA G1 intermediate.
1273 * The chain length is 3.
1274 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.7.2 or,
1275 if UAT is enabled with a defaults write (internal devices only),
1276 OID 1.2.840.113635.100.6.27.7.1.
1277 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1278 extension or Common Name.
1279 * The leaf is checked against the Black and Gray lists.
1280 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1281 @result A policy object. The caller is responsible for calling CFRelease
1282 on this when it is no longer needed.
1284 __nullable CF_RETURNS_RETAINED
1285 SecPolicyRef
SecPolicyCreateAppleCompatibilityEscrowProxyService(CFStringRef hostname
)
1286 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
1289 @function SecPolicyCreateAppleFMiPService
1290 @abstract Ensure we're appropriately pinned to the Find My iPhone service (SSL + Apple restrictions)
1291 @param hostname Required; hostname to verify the certificate name against.
1292 @param context Optional; if present, "AppleServerAuthenticationAllowUATFMiP" with value
1293 Boolean true will allow Test Apple roots on internal releases.
1294 @discussion This policy uses the Basic X.509 policy with validity check
1295 and pinning options:
1296 * The chain is anchored to any of the production Apple Root CAs via full certificate
1297 comparison. Test Apple Root CAs are permitted only on internal releases either
1298 using the context dictionary or with defaults write.
1299 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1300 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.6.2 or,
1301 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.6.1.
1302 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1303 extension or Common Name.
1304 * The leaf is checked against the Black and Gray lists.
1305 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1306 * Revocation is checked via any available method.
1307 @result A policy object. The caller is responsible for calling CFRelease
1308 on this when it is no longer needed.
1310 __nullable CF_RETURNS_RETAINED
1311 SecPolicyRef
SecPolicyCreateAppleFMiPService(CFStringRef hostname
, CFDictionaryRef __nullable context
)
1312 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
);
1315 @function SecPolicyCreateAppleSSLService
1316 @abstract Ensure we're appropriately pinned to an Apple server (SSL + Apple restrictions)
1317 @param hostname Optional; hostname to verify the certificate name against.
1318 @discussion This policy uses the Basic X.509 policy with validity check
1319 and pinning options:
1320 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1321 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1322 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1323 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.1
1324 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1325 extension or Common Name.
1326 * The leaf is checked against the Black and Gray lists.
1327 * The leaf has ExtendedKeyUsage, if any, with the ServerAuth OID.
1328 * Revocation is checked via any available method.
1329 @result A policy object. The caller is responsible for calling CFRelease
1330 on this when it is no longer needed.
1332 __nullable CF_RETURNS_RETAINED
1333 SecPolicyRef
SecPolicyCreateAppleSSLService(CFStringRef __nullable hostname
);
1336 @function SecPolicyCreateAppleTimeStamping
1337 @abstract Returns a policy object for evaluating time stamping certificate chains.
1338 @discussion This policy uses the Basic X.509 policy with validity check
1339 and requires the leaf has ExtendedKeyUsage with the TimeStamping OID.
1340 @result A policy object. The caller is responsible for calling CFRelease
1341 on this when it is no longer needed.
1343 __nullable CF_RETURNS_RETAINED
1344 SecPolicyRef
SecPolicyCreateAppleTimeStamping(void);
1347 @function SecPolicyCreateApplePayIssuerEncryption
1348 @abstract Returns a policy object for evaluating Apple Pay Issuer Encryption certificate chains.
1349 @discussion This policy uses the Basic X.509 policy with no validity check
1350 and pinning options:
1351 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1352 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1353 * There are exactly 3 certs in the chain.
1354 * The intermediate has Common Name "Apple Worldwide Developer Relations CA - G2".
1355 * The leaf has KeyUsage with the KeyEncipherment bit set.
1356 * The leaf has a marker extension with OID 1.2.840.113635.100.6.39.
1357 @result A policy object. The caller is responsible for calling CFRelease
1358 on this when it is no longer needed.
1360 __nullable CF_RETURNS_RETAINED
1361 SecPolicyRef
SecPolicyCreateApplePayIssuerEncryption(void)
1362 __OSX_AVAILABLE_STARTING(__MAC_10_11
, __IPHONE_9_0
);
1365 @function SecPolicyCreateAppleATVVPNProfileSigning
1366 @abstract Returns a policy object for evaluating Apple TV VPN Profile certificate chains.
1367 @discussion This policy uses the Basic X.509 policy with no validity check
1368 and pinning options:
1369 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1370 are permitted only on internal releases.
1371 * There are exactly 3 certs in the chain.
1372 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.10.
1373 * The leaf has a marker extension with OID 1.2.840.113635.100.6.43.
1374 * Revocation is checked via OCSP.
1375 @result A policy object. The caller is responsible for calling CFRelease
1376 on this when it is no longer needed.
1378 __nullable CF_RETURNS_RETAINED
1379 SecPolicyRef
SecPolicyCreateAppleATVVPNProfileSigning(void)
1380 __OSX_AVAILABLE_STARTING(__MAC_10_11
, __IPHONE_9_0
);
1383 @function SecPolicyCreateAppleHomeKitServerAuth
1384 @abstract Ensure we're appropriately pinned to the HomeKit service (SSL + Apple restrictions)
1385 @param hostname Required; hostname to verify the certificate name against.
1386 @discussion This policy uses the Basic X.509 policy with validity check
1387 and pinning options:
1388 * The chain is anchored to any of the production Apple Root CAs via full certificate
1389 comparison. Test Apple Root CAs are permitted only on internal releases with defaults write.
1390 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.16
1391 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.9.
1392 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1393 extension or Common Name.
1394 * The leaf is checked against the Black and Gray lists.
1395 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1396 * Revocation is checked via any available method.
1397 @result A policy object. The caller is responsible for calling CFRelease
1398 on this when it is no longer needed.
1400 __nullable CF_RETURNS_RETAINED
1401 SecPolicyRef
SecPolicyCreateAppleHomeKitServerAuth(CFStringRef hostname
)
1402 __OSX_AVAILABLE_STARTING(__MAC_10_11_4
, __IPHONE_9_3
);
1405 @function SecPolicyCreateAppleExternalDeveloper
1406 @abstract Returns a policy object for verifying Apple-issued external developer
1408 @discussion The resulting policy uses the Basic X.509 policy with validity check and
1410 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1411 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1412 * There are exactly 3 certs in the chain.
1413 * The intermediate has a marker extension with OID matching 1.2.840.113635.100.6.2.1
1414 (WWDR CA) or 1.2.840.113635.100.6.2.6 (Developer ID CA).
1415 * The leaf has a marker extension with OID matching one of the following:
1416 * 1.2.840.113635.100.6.1.2 ("iPhone Developer" leaf)
1417 * 1.2.840.113635.100.6.1.4 ("iPhone Distribution" leaf)
1418 * 1.2.840.113635.100.6.1.5 ("Safari Developer" leaf)
1419 * 1.2.840.113635.100.6.1.7 ("3rd Party Mac Developer Application" leaf)
1420 * 1.2.840.113635.100.6.1.8 ("3rd Party Mac Developer Installer" leaf)
1421 * 1.2.840.113635.100.6.1.12 ("Mac Developer" leaf)
1422 * 1.2.840.113635.100.6.1.13 ("Developer ID Application" leaf)
1423 * 1.2.840.113635.100.6.1.14 ("Developer ID Installer" leaf)
1424 * The leaf has an ExtendedKeyUsage OID matching one of the following:
1425 * 1.3.6.1.5.5.7.3.3 (CodeSigning EKU)
1426 * 1.2.840.113635.100.4.8 ("Safari Developer" EKU)
1427 * 1.2.840.113635.100.4.9 ("3rd Party Mac Developer Installer" EKU)
1428 * 1.2.840.113635.100.4.13 ("Developer ID Installer" EKU)
1429 * Revocation is checked via any available method.
1430 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1431 @result A policy object. The caller is responsible for calling CFRelease on this when
1432 it is no longer needed.
1434 __nullable CF_RETURNS_RETAINED
1435 SecPolicyRef
SecPolicyCreateAppleExternalDeveloper(void)
1436 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
1439 @function SecPolicyCreateAppleSoftwareSigning
1440 @abstract Returns a policy object for verifying the Apple Software Signing certificate.
1441 @discussion The resulting policy uses the Basic X.509 policy with no validity check and
1443 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1444 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1445 * There are exactly 3 certs in the chain.
1446 * The intermediate has the Common Name "Apple Code Signing Certification Authority".
1447 * The leaf has a marker extension with OID matching 1.2.840.113635.100.6.22.
1448 * The leaf has an ExtendedKeyUsage OID matching 1.3.6.1.5.5.7.3.3 (Code Signing).
1449 * Revocation is checked via any available method.
1450 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1451 @result A policy object. The caller is responsible for calling CFRelease on this when
1452 it is no longer needed.
1454 __nullable CF_RETURNS_RETAINED
1455 SecPolicyRef
SecPolicyCreateAppleSoftwareSigning(void)
1456 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
1459 @function SecPolicyGetName
1460 @abstract Returns a policy's name.
1461 @param policy A policy reference.
1462 @result A policy name.
1464 __nullable CFStringRef
SecPolicyGetName(SecPolicyRef policy
)
1465 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
1468 @function SecPolicyGetOidString
1469 @abstract Returns a policy's oid in string decimal format.
1470 @param policy A policy reference.
1471 @result A policy oid.
1473 CFStringRef
SecPolicyGetOidString(SecPolicyRef policy
)
1474 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
1477 @function SecPolicyCreateAppleUniqueDeviceCertificate
1478 @abstract Returns a policy object for verifying Unique Device Identifier Certificates.
1479 @param testRootHash Optional; The SHA-256 fingerprint of a test root for pinning.
1480 @discussion The resulting policy uses the Basic X.509 policy with no validity check and
1482 * The chain is anchored to the SEP Root CA. Internal releases allow the chain to be
1483 anchored to the testRootHash input if the value true is set for the key
1484 "ApplePinningAllowTestCertsUCRT" in the com.apple.security preferences for the user
1485 of the calling application.
1486 * There are exactly 3 certs in the chain.
1487 * The intermediate has an extension with OID matching 1.2.840.113635.100.6.44 and value
1489 * The leaf has a marker extension with OID matching 1.2.840.113635.100.10.1.
1490 * RSA key sizes are disallowed. EC key sizes are P-256 or larger.
1491 @result A policy object. The caller is responsible for calling CFRelease on this when
1492 it is no longer needed.
1494 __nullable CF_RETURNS_RETAINED
1495 SecPolicyRef
SecPolicyCreateAppleUniqueDeviceCertificate(CFDataRef __nullable testRootHash
)
1496 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
1499 @function SecPolicyCreateAppleWarsaw
1500 @abstract Returns a policy object for verifying signed Warsaw assets.
1501 @discussion The resulting policy uses the Basic X.509 policy with validity check and
1503 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1504 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1505 * There are exactly 3 certs in the chain.
1506 * The intermediate has an extension with OID matching 1.2.840.113635.100.6.2.14.
1507 * The leaf has a marker extension with OID matching 1.2.840.113635.100.6.29.
1508 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1509 @result A policy object. The caller is responsible for calling CFRelease on this when
1510 it is no longer needed.
1512 __nullable CF_RETURNS_RETAINED
1513 SecPolicyRef
SecPolicyCreateAppleWarsaw(void)
1514 __OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) __TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1);
1517 @function SecPolicyCreateAppleSecureIOStaticAsset
1518 @abstract Returns a policy object for verifying signed static assets for Secure IO.
1519 @discussion The resulting policy uses the Basic X.509 policy with no validity check and
1521 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1522 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1523 * There are exactly 3 certs in the chain.
1524 * The intermediate has an extension with OID matching 1.2.840.113635.100.6.2.10.
1525 * The leaf has a marker extension with OID matching 1.2.840.113635.100.6.50.
1526 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1527 @result A policy object. The caller is responsible for calling CFRelease on this when
1528 it is no longer needed.
1530 __nullable CF_RETURNS_RETAINED
1531 SecPolicyRef
SecPolicyCreateAppleSecureIOStaticAsset(void)
1532 __OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) __TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1);
1535 @function SecPolicyCreateAppleiCloudSetupService
1536 @abstract Ensure we're appropriately pinned to the iCloud Setup service (SSL + Apple restrictions)
1537 @param hostname Required; hostname to verify the certificate name against.
1538 @param context Optional; if present, "AppleServerAuthenticationAllowUATiCloudSetup" with value
1539 Boolean true will allow Test Apple roots and test OIDs on internal releases.
1540 @discussion This policy uses the Basic X.509 policy with validity check
1541 and pinning options:
1542 * The chain is anchored to any of the production Apple Root CAs.
1543 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1544 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.15.2 or, if
1545 enabled, OID 1.2.840.113635.100.6.27.15.1.
1546 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1547 extension or Common Name.
1548 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1549 * Revocation is checked via any available method.
1550 @result A policy object. The caller is responsible for calling CFRelease
1551 on this when it is no longer needed.
1553 __nullable CF_RETURNS_RETAINED
1554 SecPolicyRef
SecPolicyCreateAppleiCloudSetupService(CFStringRef hostname
, CFDictionaryRef __nullable context
)
1555 __OSX_AVAILABLE(10.12.4) __IOS_AVAILABLE(10.3) __TVOS_AVAILABLE(10.2) __WATCHOS_AVAILABLE(3.2);
1558 @function SecPolicyCreateAppleCompatibilityiCloudSetupService
1559 @abstract Ensure we're appropriately pinned to the iCloud Setup service using compatibility certs
1560 @param hostname Required; hostname to verify the certificate name against.
1561 @discussion This policy uses the Basic X.509 policy with validity check
1562 and pinning options:
1563 * The chain is anchored to the GeoTrust Global CA
1564 * The intermediate has a subject public key info hash matching the public key of
1565 the Apple IST CA G1 intermediate.
1566 * The chain length is 3.
1567 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.15.2 or
1568 OID 1.2.840.113635.100.6.27.15.1.
1569 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1570 extension or Common Name.
1571 * The leaf is checked against the Black and Gray lists.
1572 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1573 @result A policy object. The caller is responsible for calling CFRelease
1574 on this when it is no longer needed.
1576 __nullable CF_RETURNS_RETAINED
1577 SecPolicyRef
SecPolicyCreateAppleCompatibilityiCloudSetupService(CFStringRef hostname
)
1578 __OSX_AVAILABLE(10.12.4) __IOS_AVAILABLE(10.3) __TVOS_AVAILABLE(10.2) __WATCHOS_AVAILABLE(3.2);
1581 @function SecPolicyCreateAppleAppTransportSecurity
1582 @abstract Ensure all certs in the evaluation meet ATS minimums
1583 @discussion This policy is meant to be used alongside an SSL policy in order to enforce App Transport Security certificate rules:
1584 * All certificates use either RSA key sizes of 2048-bits or larger or EC key sizes of 256-bits or larger.
1585 * All certificates use SHA-256 or better for signature hash algorithms.
1586 @result A policy object. The caller is responsible for calling CFRelease
1587 on this when it is no longer needed.
1589 __nullable CF_RETURNS_RETAINED
1590 SecPolicyRef
SecPolicyCreateAppleAppTransportSecurity(void)
1591 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
1594 @function SecPolicyCreateMobileSoftwareUpdate
1595 @abstract Returns a policy object for evaluating certificate chains for signing Mobile Software Updates.
1596 @discussion This policy uses the Basic X.509 policy with no validity check
1597 and pinning options:
1598 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1599 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1600 * There are exactly 3 certs in the chain.
1601 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.18.
1602 * The leaf has a marker extension with OID 1.2.840.113635.100.6.57.2, or on internal releases,
1603 1.2.840.113635.100.6.57.1.
1604 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1605 @result A policy object. The caller is responsible for calling CFRelease
1606 on this when it is no longer needed.
1608 __nullable CF_RETURNS_RETAINED
1609 SecPolicyRef
SecPolicyCreateMobileSoftwareUpdate(void)
1610 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
1613 @function SecPolicyCreateAppleBasicAttestationSystem
1614 @abstract Returns a policy object for verifying Basic Attestation Authority SCRT-attested certs
1615 @param testRootHash Optional; The SHA-256 fingerprint of a test root for pinning.
1616 @discussion The resulting policy uses the Basic X.509 policy with validity check and
1618 * The chain is anchored to the Basic Attestation System Root CA.
1619 * There are exactly 3 certs in the chain.
1620 @result A policy object. The caller is responsible for calling CFRelease on this when
1621 it is no longer needed.
1623 __nullable CF_RETURNS_RETAINED
1624 SecPolicyRef
SecPolicyCreateAppleBasicAttestationSystem(CFDataRef __nullable testRootHash
)
1625 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
1628 @function SecPolicyCreateAppleBasicAttestationUser
1629 @abstract Returns a policy object for verifying Basic Attestation Authority UCRT-attested certs
1630 @param testRootHash Optional; The SHA-256 fingerprint of a test root for pinning.
1631 @discussion The resulting policy uses the Basic X.509 policy with validity check and
1633 * The chain is anchored to the Basic Attestation User Root CA.
1634 * There are exactly 3 certs in the chain.
1635 @result A policy object. The caller is responsible for calling CFRelease on this when
1636 it is no longer needed.
1638 __nullable CF_RETURNS_RETAINED
1639 SecPolicyRef
SecPolicyCreateAppleBasicAttestationUser(CFDataRef __nullable testRootHash
)
1640 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
1643 @function SecPolicyCreateDemoDigitalCatalog
1644 @abstract Returns a policy object for evaluating certificate chains for signing Digital
1645 Catalog manifests for Demo units.
1646 @discussion This policy uses the Basic X.509 policy with validity check and
1648 * There are exactly 3 certs in the chain.
1649 * The intermediate has common name "DemoUnit CA"
1650 * The leaf has a marker extension with OID 1.2.840.113635.100.6.60
1651 @result A policy object. The caller is responsible for calling CFRelease
1652 on this when it is no longer needed.
1654 __nullable CF_RETURNS_RETAINED
1655 SecPolicyRef
SecPolicyCreateDemoDigitalCatalogSigning(void)
1656 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
1659 * Legacy functions (OS X only)
1661 #if TARGET_OS_MAC && !TARGET_OS_IPHONE
1664 @function SecPolicyCopy
1665 @abstract Returns a copy of a policy reference based on certificate type and OID.
1666 @param certificateType A certificate type.
1667 @param policyOID The OID of the policy you want to find. This is a required parameter. See oidsalg.h to see a list of policy OIDs.
1668 @param policy The returned policy reference. This is a required parameter.
1669 @result A result code. See "Security Error Codes" (SecBase.h).
1670 @discussion This function is deprecated in Mac OS X 10.7 and later;
1671 to obtain a policy reference, use one of the SecPolicyCreate* functions in SecPolicy.h.
1673 OSStatus
SecPolicyCopy(CSSM_CERT_TYPE certificateType
, const CSSM_OID
*policyOID
, SecPolicyRef
* __nonnull CF_RETURNS_RETAINED policy
)
1674 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3
, __MAC_10_7
, __IPHONE_NA
, __IPHONE_NA
);
1677 @function SecPolicyCopyAll
1678 @abstract Returns an array of all known policies based on certificate type.
1679 @param certificateType A certificate type. This is a optional parameter. Pass CSSM_CERT_UNKNOWN if the certificate type is unknown.
1680 @param policies The returned array of policies. This is a required parameter.
1681 @result A result code. See "Security Error Codes" (SecBase.h).
1682 @discussion This function is deprecated in Mac OS X 10.7 and later;
1683 to obtain a policy reference, use one of the SecPolicyCreate* functions in SecPolicy.h. (Note: there is normally
1684 no reason to iterate over multiple disjointed policies, except to provide a way to edit trust settings for each
1685 policy, as is done in certain certificate UI views. In that specific case, your code should call SecPolicyCreateWithOID
1686 for each desired policy from the list of supported OID constants in SecPolicy.h.)
1688 OSStatus
SecPolicyCopyAll(CSSM_CERT_TYPE certificateType
, CFArrayRef
* __nonnull CF_RETURNS_RETAINED policies
)
1689 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3
, __MAC_10_7
, __IPHONE_NA
, __IPHONE_NA
);
1691 /* Given a unified SecPolicyRef, return a copy with a legacy
1692 C++ ItemImpl-based Policy instance. Only for internal use;
1693 legacy references cannot be used by SecPolicy API functions. */
1694 __nullable CF_RETURNS_RETAINED
1695 SecPolicyRef
SecPolicyCreateItemImplInstance(SecPolicyRef policy
);
1697 /* Given a CSSM_OID pointer, return a string which can be passed
1698 to SecPolicyCreateWithProperties. The return value can be NULL
1699 if no supported policy was found for the OID argument. */
1701 CFStringRef
SecPolicyGetStringForOID(CSSM_OID
* oid
);
1704 @function SecPolicyCreateAppleTimeStampingAndRevocationPolicies
1705 @abstract Create timeStamping policy array from a given set of policies by applying identical revocation behavior
1706 @param policyOrArray can be a SecPolicyRef or a CFArray of SecPolicyRef
1707 @discussion This function is deprecated in macOS 10.13 and later. Your code should call SecPolicyCreateAppleTimeStamping
1708 and SecPolicyCreateRevocation instead to obtain these policies, then insert them into an array as needed.
1710 __nullable CF_RETURNS_RETAINED
1711 CFArrayRef
SecPolicyCreateAppleTimeStampingAndRevocationPolicies(CFTypeRef policyOrArray
)
1712 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10
, __MAC_10_13
, __IPHONE_NA
, __IPHONE_NA
);
1714 #endif /* TARGET_OS_MAC && !TARGET_OS_IPHONE */
1716 /* MARK: WARNING: The following constants and functions are for project use
1717 * within the Security project and are subject to change without warning */
1720 @enum Policy Check Keys
1721 @discussion Keys that represent various checks that can be done in a trust
1722 policy. Use outside of the Security project at your own peril.
1724 extern const CFStringRef kSecPolicyCheckAnchorApple
;
1725 extern const CFStringRef kSecPolicyCheckAnchorSHA1
;
1726 extern const CFStringRef kSecPolicyCheckAnchorSHA256
;
1727 extern const CFStringRef kSecPolicyCheckAnchorTrusted
;
1728 extern const CFStringRef kSecPolicyCheckBasicCertificateProcessing
;
1729 extern const CFStringRef kSecPolicyCheckBasicConstraints
;
1730 extern const CFStringRef kSecPolicyCheckBasicConstraintsCA
;
1731 extern const CFStringRef kSecPolicyCheckBasicConstraintsPathLen
;
1732 extern const CFStringRef kSecPolicyCheckBlackListedKey
;
1733 extern const CFStringRef kSecPolicyCheckBlackListedLeaf
;
1734 extern const CFStringRef kSecPolicyCheckCertificatePolicy
;
1735 extern const CFStringRef kSecPolicyCheckChainLength
;
1736 extern const CFStringRef kSecPolicyCheckCriticalExtensions
;
1737 extern const CFStringRef kSecPolicyCheckEAPTrustedServerNames
;
1738 extern const CFStringRef kSecPolicyCheckEmail
;
1739 extern const CFStringRef kSecPolicyCheckExtendedKeyUsage
;
1740 extern const CFStringRef kSecPolicyCheckExtendedValidation
;
1741 extern const CFStringRef kSecPolicyCheckGrayListedKey
;
1742 extern const CFStringRef kSecPolicyCheckGrayListedLeaf
;
1743 extern const CFStringRef kSecPolicyCheckIdLinkage
;
1744 extern const CFStringRef kSecPolicyCheckIntermediateCountry
;
1745 extern const CFStringRef kSecPolicyCheckIntermediateEKU
;
1746 extern const CFStringRef kSecPolicyCheckIntermediateMarkerOid
;
1747 extern const CFStringRef kSecPolicyCheckIntermediateOrganization
;
1748 extern const CFStringRef kSecPolicyCheckIntermediateSPKISHA256
;
1749 extern const CFStringRef kSecPolicyCheckIssuerCommonName
;
1750 extern const CFStringRef kSecPolicyCheckKeySize
;
1751 extern const CFStringRef kSecPolicyCheckKeyUsage
;
1752 extern const CFStringRef kSecPolicyCheckLeafMarkerOid
;
1753 extern const CFStringRef kSecPolicyCheckLeafMarkerOidWithoutValueCheck
;
1754 extern const CFStringRef kSecPolicyCheckLeafMarkersProdAndQA
;
1755 extern const CFStringRef kSecPolicyCheckMissingIntermediate
;
1756 extern const CFStringRef kSecPolicyCheckNameConstraints
;
1757 extern const CFStringRef kSecPolicyCheckNoNetworkAccess
;
1758 extern const CFStringRef kSecPolicyCheckNonEmptySubject
;
1759 extern const CFStringRef kSecPolicyCheckNotValidBefore
;
1760 extern const CFStringRef kSecPolicyCheckPinningRequired
;
1761 extern const CFStringRef kSecPolicyCheckPolicyConstraints
;
1762 extern const CFStringRef kSecPolicyCheckRevocation
;
1763 extern const CFStringRef kSecPolicyCheckRevocationOnline
;
1764 extern const CFStringRef kSecPolicyCheckRevocationResponseRequired
;
1765 extern const CFStringRef kSecPolicyCheckSSLHostname
;
1766 extern const CFStringRef kSecPolicyCheckSignatureHashAlgorithms
;
1767 extern const CFStringRef kSecPolicyCheckSubjectCommonName
;
1768 extern const CFStringRef kSecPolicyCheckSubjectCommonNamePrefix
;
1769 extern const CFStringRef kSecPolicyCheckSubjectCommonNameTEST
;
1770 extern const CFStringRef kSecPolicyCheckSubjectOrganization
;
1771 extern const CFStringRef kSecPolicyCheckSubjectOrganizationalUnit
;
1772 extern const CFStringRef kSecPolicyCheckSystemTrustedWeakHash
;
1773 extern const CFStringRef kSecPolicyCheckSystemTrustedWeakKey
;
1774 extern const CFStringRef kSecPolicyCheckTemporalValidity
;
1775 extern const CFStringRef kSecPolicyCheckUsageConstraints
;
1776 extern const CFStringRef kSecPolicyCheckValidRoot
;
1777 extern const CFStringRef kSecPolicyCheckWeakKeySize
;
1778 extern const CFStringRef kSecPolicyCheckWeakSignature
;
1779 extern const CFStringRef kSecPolicyCheckCTRequired
;
1781 /* Special option for checking Apple Anchors */
1782 extern const CFStringRef kSecPolicyAppleAnchorIncludeTestRoots
;
1784 /* Special option for checking Prod and QA Markers */
1785 extern const CFStringRef kSecPolicyLeafMarkerProd
;
1786 extern const CFStringRef kSecPolicyLeafMarkerQA
;
1788 /* Special option for checking Revocation */
1789 extern const CFStringRef kSecPolicyCheckRevocationOCSP
;
1790 extern const CFStringRef kSecPolicyCheckRevocationCRL
;
1791 extern const CFStringRef kSecPolicyCheckRevocationAny
;
1794 extern const CFStringRef kSecPolicyNameX509Basic
;
1795 extern const CFStringRef kSecPolicyNameSSLServer
;
1796 extern const CFStringRef kSecPolicyNameSSLClient
;
1797 extern const CFStringRef kSecPolicyNameEAPServer
;
1798 extern const CFStringRef kSecPolicyNameEAPClient
;
1799 extern const CFStringRef kSecPolicyNameIPSecServer
;
1800 extern const CFStringRef kSecPolicyNameIPSecClient
;
1801 extern const CFStringRef kSecPolicyNameSMIME
;
1802 extern const CFStringRef kSecPolicyNameCodeSigning
;
1803 extern const CFStringRef kSecPolicyNameTimeStamping
;
1804 extern const CFStringRef kSecPolicyNameOCSPSigner
;
1807 * MARK: SecPolicyCheckCert functions
1809 bool SecPolicyCheckCertSSLHostname(SecCertificateRef cert
, CFTypeRef pvcValue
);
1810 bool SecPolicyCheckCertEmail(SecCertificateRef cert
, CFTypeRef pvcValue
);
1811 bool SecPolicyCheckCertTemporalValidity(SecCertificateRef cert
, CFTypeRef pvcValue
);
1812 bool SecPolicyCheckCertWeakKeySize(SecCertificateRef cert
, CFTypeRef __nullable pvcValue
);
1813 bool SecPolicyCheckCertKeyUsage(SecCertificateRef cert
, CFTypeRef pvcValue
);
1814 bool SecPolicyCheckCertExtendedKeyUsage(SecCertificateRef cert
, CFTypeRef pvcValue
);
1815 bool SecPolicyCheckCertSubjectCommonName(SecCertificateRef cert
, CFTypeRef pvcValue
);
1816 bool SecPolicyCheckCertSubjectCommonNamePrefix(SecCertificateRef cert
, CFTypeRef pvcValue
);
1817 bool SecPolicyCheckCertSubjectCommonNameTEST(SecCertificateRef cert
, CFTypeRef pvcValue
);
1818 bool SecPolicyCheckCertSubjectOrganization(SecCertificateRef cert
, CFTypeRef pvcValue
);
1819 bool SecPolicyCheckCertSubjectOrganizationalUnit(SecCertificateRef cert
, CFTypeRef pvcValue
);
1820 bool SecPolicyCheckCertNotValidBefore(SecCertificateRef cert
, CFTypeRef pvcValue
);
1821 bool SecPolicyCheckCertEAPTrustedServerNames(SecCertificateRef cert
, CFTypeRef pvcValue
);
1822 bool SecPolicyCheckCertLeafMarkerOid(SecCertificateRef cert
, CFTypeRef pvcValue
);
1823 bool SecPolicyCheckCertLeafMarkerOidWithoutValueCheck(SecCertificateRef cert
, CFTypeRef pvcValue
);
1824 bool SecPolicyCheckCertLeafMarkersProdAndQA(SecCertificateRef cert
, CFTypeRef pvcValue
);
1825 bool SecPolicyCheckCertNonEmptySubject(SecCertificateRef cert
, CFTypeRef __nullable pvcValue
);
1826 bool SecPolicyCheckCertKeySize(SecCertificateRef cert
, CFTypeRef pvcValue
);
1827 bool SecPolicyCheckCertWeakSignature(SecCertificateRef cert
, CFTypeRef __nullable pvcValue
);
1828 bool SecPolicyCheckCertSignatureHashAlgorithms(SecCertificateRef cert
, CFTypeRef pvcValue
);
1829 bool SecPolicyCheckCertCertificatePolicy(SecCertificateRef cert
, CFTypeRef pvcValue
);
1830 bool SecPolicyCheckCertCriticalExtensions(SecCertificateRef cert
, CFTypeRef __nullable pvcValue
);
1831 bool SecPolicyCheckCertSubjectCountry(SecCertificateRef cert
, CFTypeRef pvcValue
);
1833 void SecPolicySetName(SecPolicyRef policy
, CFStringRef policyName
);
1834 __nullable CFArrayRef
SecPolicyXPCArrayCopyArray(xpc_object_t xpc_policies
, CFErrorRef
*error
);
1836 void SecPolicySetOptionsValue(SecPolicyRef policy
, CFStringRef key
, CFTypeRef value
);
1838 CF_IMPLICIT_BRIDGING_DISABLED
1839 CF_ASSUME_NONNULL_END
1843 #endif /* !_SECURITY_SECPOLICYPRIV_H_ */