]> git.saurik.com Git - apple/security.git/blob - trust/headers/SecPolicyPriv.h
Security-59306.41.2.tar.gz
[apple/security.git] / trust / headers / SecPolicyPriv.h
1 /*
2 * Copyright (c) 2003-2017 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 /*!
25 @header SecPolicyPriv
26 The functions provided in SecPolicyPriv provide an interface to various
27 X.509 certificate trust policies.
28 */
29
30 #ifndef _SECURITY_SECPOLICYPRIV_H_
31 #define _SECURITY_SECPOLICYPRIV_H_
32
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>
39 #include <xpc/xpc.h>
40
41 __BEGIN_DECLS
42
43 CF_ASSUME_NONNULL_BEGIN
44 CF_IMPLICIT_BRIDGING_ENABLED
45
46 /*!
47 @enum Policy Constants (Private)
48 @discussion Predefined constants used to specify a policy.
49 */
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 API_DEPRECATED_WITH_REPLACEMENT("kSecPolicyAppleIDValidationRecordSigning", ios(7.0,10.0), macos(10.9,10.12));
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);
176 extern const CFStringRef kSecPolicyAppleiAPSWAuth
177 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0));
178 extern const CFStringRef kSecPolicyAppleDemoDigitalCatalog
179 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0));
180 extern const CFStringRef kSecPolicyAppleAssetReceipt
181 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0));
182 extern const CFStringRef kSecPolicyAppleDeveloperIDPlusTicket
183 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0));
184 extern const CFStringRef kSecPolicyAppleComponentCertificate
185 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
186 extern const CFStringRef kSecPolicyAppleKeyTransparency
187 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
188 extern const CFStringRef kSecPolicyAppleLegacySSL
189 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
190
191 /*!
192 @enum Policy Name Constants (Private)
193 @discussion Predefined constants used to specify a SSL Pinning policy.
194 To be used with SecTrustSetPolicyName.
195 @constant kSecPolicyNameAppleAST2Service
196 @constant kSecPolicyNameAppleEscrowProxyService
197 @constant kSecPolicyNameAppleFMiPService
198 @constant kSecPolicyNameAppleGSService
199 @constant kSecPolicyNameAppleHomeKitService
200 @constant kSecPolicyNameAppleiCloudSetupService
201 @constant kSecPolicyNameAppleIDSService
202 @constant kSecPolicyNameAppleMMCSService
203 @constant kSecPolicyNameApplePPQService
204 @constant kSecPolicyNameApplePushService
205 @constant kSecPolicyNameAppleAIDCService
206 @constant kSecPolicyNameAppleMapsService
207 @constant kSecPolicyNameAppleHealthProviderService
208 @constant kSecPolicyNameAppleParsecService
209 @constant kSecPolicyNameAppleAMPService
210 @constant kSecPolicyNameAppleSiriService
211 @constant kSecPolicyNameAppleHomeAppClipUploadService
212 */
213 extern const CFStringRef kSecPolicyNameAppleAST2Service
214 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
215 extern const CFStringRef kSecPolicyNameAppleEscrowProxyService
216 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
217 extern const CFStringRef kSecPolicyNameAppleFMiPService
218 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
219 extern const CFStringRef kSecPolicyNameAppleGSService
220 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
221 extern const CFStringRef kSecPolicyNameAppleHomeKitService
222 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
223 extern const CFStringRef kSecPolicyNameAppleiCloudSetupService
224 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
225 extern const CFStringRef kSecPolicyNameAppleIDSService
226 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
227 extern const CFStringRef kSecPolicyNameAppleMMCSService
228 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
229 extern const CFStringRef kSecPolicyNameApplePPQService
230 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
231 extern const CFStringRef kSecPolicyNameApplePushService
232 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
233 extern const CFStringRef kSecPolicyNameAppleAIDCService
234 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
235 extern const CFStringRef kSecPolicyNameAppleMapsService
236 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
237 extern const CFStringRef kSecPolicyNameAppleHealthProviderService
238 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
239 extern const CFStringRef kSecPolicyNameAppleParsecService
240 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
241 extern const CFStringRef kSecPolicyNameAppleAMPService
242 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
243 extern const CFStringRef kSecPolicyNameAppleSiriService
244 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
245 extern const CFStringRef kSecPolicyNameAppleHomeAppClipUploadService
246 API_AVAILABLE(macos(10.15.1), ios(13.2), watchos(6.1), tvos(13.1));
247
248 /*!
249 @enum Policy Value Constants
250 @abstract Predefined property key constants used to get or set values in
251 a dictionary for a policy instance.
252 @discussion
253 All policies will have the following read-only value:
254 kSecPolicyOid (the policy object identifier)
255
256 Additional policy values which your code can optionally set:
257 kSecPolicyName (name which must be matched)
258 kSecPolicyClient (evaluate for client, rather than server)
259 kSecPolicyRevocationFlags (only valid for a revocation policy)
260 kSecPolicyRevocationFlags (only valid for a revocation policy)
261 kSecPolicyTeamIdentifier (only valid for a Passbook signing policy)
262 kSecPolicyContext (valid for policies below that take a context parameter)
263 kSecPolicyPolicyName (only valid for GenericApplePinned or
264 GenericAppleSSLPinned policies)
265 kSecPolicyIntermediateMarkerOid (only valid for GenericApplePinned or
266 GenericAppleSSLPinned policies)
267 kSecPolicyLeafMarkerOid (only valid for GenericApplePinned or
268 GenericAppleSSLPinned policies)
269 kSecPolicyRootDigest (only valid for the UniqueDeviceCertificate policy)
270
271 @constant kSecPolicyContext Specifies a CFDictionaryRef with keys and values
272 specified by the particular SecPolicyCreate function.
273 @constant kSecPolicyPolicyName Specifies a CFStringRef of the name of the
274 desired policy result.
275 @constant kSecPolicyIntermediateMarkerOid Specifies a CFStringRef of the
276 marker OID (in decimal format) required in the intermediate certificate.
277 @constant kSecPolicyLeafMarkerOid Specifies a CFStringRef of the
278 marker OID (in decimal format) required in the leaf certificate.
279 @constant kSecPolicyRootDigest Specifies a CFDataRef of digest required to
280 match the SHA-256 of the root certificate.
281 */
282 extern const CFStringRef kSecPolicyContext
283 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0);
284 extern const CFStringRef kSecPolicyPolicyName
285 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0);
286 extern const CFStringRef kSecPolicyIntermediateMarkerOid
287 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0);
288 extern const CFStringRef kSecPolicyLeafMarkerOid
289 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0);
290 extern const CFStringRef kSecPolicyRootDigest
291 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0);
292
293 /*!
294 @enum Revocation Policy Constants
295 @abstract Predefined constants which allow you to specify how revocation
296 checking will be performed for a trust evaluation.
297 @constant kSecRevocationOnlineCheck If this flag is set, perform an online
298 revocation check, ignoring cached revocation results. This flag will not force
299 an online check if an online check was done within the last 5 minutes. Online
300 checks are only applicable to OCSP; this constant will not force a fresh
301 CRL download.
302 @constant kSecRevocationCheckIfTrusted If this flag is set, perform network-based
303 revocation checks only if the chain has no other validation errors. This flag
304 overrides SecTrustSetNetworkFetchAllowed and kSecRevocationNetworkAccessDisabled
305 for revocation checking (but not for intermediate fetching).
306 Note that this flag's behavior is not default because revoked certs produce Fatal
307 trust results, whereas most checks produce Recoverable trust results. If we skip
308 revocation checks on untrusted chains, the user may be able to ignore the failures
309 of a revoked cert.
310 */
311 CF_ENUM(CFOptionFlags) {
312 kSecRevocationOnlineCheck = (1 << 5),
313 kSecRevocationCheckIfTrusted = (1 << 6),
314 };
315
316 /*!
317 @function SecPolicyCreateApplePinned
318 @abstract Returns a policy object for verifying Apple certificates.
319 @param policyName A string that identifies the policy name.
320 @param intermediateMarkerOID A string containing the decimal representation of the
321 extension OID in the intermediate certificate.
322 @param leafMarkerOID A string containing the decimal representation of the extension OID
323 in the leaf certificate.
324 @discussion The resulting policy uses the Basic X.509 policy with validity check and
325 pinning options:
326 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
327 the chain to be anchored to Test Apple Root CAs if the value true is set for the key
328 "ApplePinningAllowTestCerts%@" (where %@ is the policyName parameter) in the
329 com.apple.security preferences for the user of the calling application.
330 * There are exactly 3 certs in the chain.
331 * The intermediate has a marker extension with OID matching the intermediateMarkerOID
332 parameter.
333 * The leaf has a marker extension with OID matching the leafMarkerOID parameter.
334 * Revocation is checked via any available method.
335 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
336 @result A policy object. The caller is responsible for calling CFRelease on this when
337 it is no longer needed.
338 */
339 __nullable CF_RETURNS_RETAINED
340 SecPolicyRef SecPolicyCreateApplePinned(CFStringRef policyName,
341 CFStringRef intermediateMarkerOID, CFStringRef leafMarkerOID)
342 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
343
344 /*!
345 @function SecPolicyCreateAppleSSLPinned
346 @abstract Returns a policy object for verifying Apple SSL certificates.
347 @param policyName A string that identifies the service/policy name.
348 @param hostname hostname to verify the certificate name against.
349 @param intermediateMarkerOID A string containing the decimal representation of the
350 extension OID in the intermediate certificate. If NULL is passed, the default OID of
351 1.2.840.113635.100.6.2.12 is checked.
352 @param leafMarkerOID A string containing the decimal representation of the extension OID
353 in the leaf certificate.
354 @discussion The resulting policy uses the Basic X.509 policy with validity check and
355 pinning options:
356 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
357 the chain to be anchored to Test Apple Root CAs if the value true is set for the key
358 "ApplePinningAllowTestCerts%@" (where %@ is the policyName parameter) in the
359 com.apple.security preferences for the user of the calling application.
360 * There are exactly 3 certs in the chain.
361 * The intermediate has a marker extension with OID matching the intermediateMarkerOID
362 parameter, or 1.2.840.113635.100.6.2.12 if NULL is passed.
363 * The leaf has a marker extension with OID matching the leafMarkerOID parameter.
364 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
365 extension or Common Name.
366 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
367 * Revocation is checked via any available method.
368 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
369 @result A policy object. The caller is responsible for calling CFRelease on this when
370 it is no longer needed.
371 */
372 __nullable CF_RETURNS_RETAINED
373 SecPolicyRef SecPolicyCreateAppleSSLPinned(CFStringRef policyName, CFStringRef hostname,
374 CFStringRef __nullable intermediateMarkerOID, CFStringRef leafMarkerOID)
375 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
376
377 /*!
378 @function SecPolicyCreateiPhoneActivation
379 @abstract Returns a policy object for verifying iPhone Activation
380 certificate chains.
381 @discussion This policy uses the Basic X.509 policy with no validity check
382 and pinning options:
383 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
384 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
385 * There are exactly 3 certs in chain.
386 * The intermediate has Common Name "Apple iPhone Certification Authority".
387 * The leaf has Common Name "iPhone Activation".
388 @result A policy object. The caller is responsible for calling CFRelease
389 on this when it is no longer needed.
390 */
391 __nullable CF_RETURNS_RETAINED
392 SecPolicyRef SecPolicyCreateiPhoneActivation(void);
393
394 /*!
395 @function SecPolicyCreateiPhoneDeviceCertificate
396 @abstract Returns a policy object for verifying iPhone Device certificate
397 chains.
398 @discussion This policy uses the Basic X.509 policy with no validity check
399 and pinning options:
400 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
401 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
402 * There are exactly 4 certs in chain.
403 * The first intermediate has Common Name "Apple iPhone Device CA".
404 @result A policy object. The caller is responsible for calling CFRelease
405 on this when it is no longer needed.
406 */
407 __nullable CF_RETURNS_RETAINED
408 SecPolicyRef SecPolicyCreateiPhoneDeviceCertificate(void);
409
410 /*!
411 @function SecPolicyCreateFactoryDeviceCertificate
412 @abstract Returns a policy object for verifying Factory Device certificate
413 chains.
414 @discussion This policy uses the Basic X.509 policy with no validity check
415 and pinning options:
416 * The chain is anchored to the Factory Device CA.
417 @result A policy object. The caller is responsible for calling CFRelease
418 on this when it is no longer needed.
419 */
420 __nullable CF_RETURNS_RETAINED
421 SecPolicyRef SecPolicyCreateFactoryDeviceCertificate(void);
422
423 /*!
424 @function SecPolicyCreateiAP
425 @abstract Returns a policy object for verifying iAP certificate chains.
426 @discussion This policy uses the Basic X.509 policy with no validity check
427 and pinning options:
428 * The leaf has notBefore date after 5/31/2006 midnight GMT.
429 * The leaf has Common Name beginning with "IPA_".
430 The intended use of this policy is that the caller pass in the
431 intermediates for iAP1 and iAP2 to SecTrustSetAnchorCertificates().
432 @result A policy object. The caller is responsible for calling CFRelease
433 on this when it is no longer needed.
434 */
435 __nullable CF_RETURNS_RETAINED
436 SecPolicyRef SecPolicyCreateiAP(void);
437
438 /*!
439 @function SecPolicyCreateiTunesStoreURLBag
440 @abstract Returns a policy object for verifying iTunes Store URL bag
441 certificates.
442 @discussion This policy uses the Basic X.509 policy with no validity check
443 and pinning options:
444 * The chain is anchored to the iTMS CA.
445 * There are exactly 2 certs in the chain.
446 * The leaf has Organization "Apple Inc.".
447 * The leaf has Common Name "iTunes Store URL Bag".
448 @result A policy object. The caller is responsible for calling CFRelease
449 on this when it is no longer needed.
450 */
451 __nullable CF_RETURNS_RETAINED
452 SecPolicyRef SecPolicyCreateiTunesStoreURLBag(void);
453
454 /*!
455 @function SecPolicyCreateEAP
456 @abstract Returns a policy object for verifying for 802.1x/EAP certificates.
457 @param server Passing true for this parameter create a policy for EAP
458 server certificates.
459 @param trustedServerNames Optional; if present, the hostname in the leaf
460 certificate must be in the trustedServerNames list. Note that contrary
461 to all other policies the trustedServerNames list entries can have wildcards
462 whilst the certificate cannot. This matches the existing deployments.
463 @discussion This policy uses the Basic X.509 policy with validity check but
464 disallowing network fetching. If trustedServerNames param is non-null, the
465 ExtendedKeyUsage extension, if present, of the leaf certificate is verified
466 to contain either the ServerAuth OID, if the server param is true or
467 ClientAuth OID, otherwise.
468 @result A policy object. The caller is responsible for calling CFRelease
469 on this when it is no longer needed.
470 */
471 __nullable CF_RETURNS_RETAINED
472 SecPolicyRef SecPolicyCreateEAP(Boolean server, CFArrayRef __nullable trustedServerNames);
473
474 /*!
475 @function SecPolicyCreateIPSec
476 @abstract Returns a policy object for evaluating IPSec certificate chains.
477 @param server Passing true for this parameter create a policy for IPSec
478 server certificates.
479 @param hostname Optional; if present, the policy will require the specified
480 hostname or ip address to match the hostname in the leaf certificate.
481 @discussion This policy uses the Basic X.509 policy with validity check.
482 @result A policy object. The caller is responsible for calling CFRelease
483 on this when it is no longer needed.
484 */
485 __nullable CF_RETURNS_RETAINED
486 SecPolicyRef SecPolicyCreateIPSec(Boolean server, CFStringRef __nullable hostname);
487
488 /*!
489 @function SecPolicyCreateAppleSWUpdateSigning
490 @abstract Returns a policy object for evaluating SW update signing certs.
491 @discussion This policy uses the Basic X.509 policy with no validity check
492 and pinning options:
493 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
494 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
495 * There are exactly 3 certs in the chain.
496 * The intermediate ExtendedKeyUsage Extension contains 1.2.840.113635.100.4.1.
497 * The leaf ExtendedKeyUsage extension contains 1.2.840.113635.100.4.1.
498 @result A policy object. The caller is responsible for calling CFRelease
499 on this when it is no longer needed.
500 */
501 __nullable CF_RETURNS_RETAINED
502 SecPolicyRef SecPolicyCreateAppleSWUpdateSigning(void);
503
504 /*!
505 @function SecPolicyCreateApplePackageSigning
506 @abstract Returns a policy object for evaluating installer package signing certs.
507 @discussion This policy uses the Basic X.509 policy with no validity check
508 and pinning options:
509 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
510 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
511 * There are exactly 3 certs in the chain.
512 * The leaf KeyUsage extension has the digital signature bit set.
513 * The leaf ExtendedKeyUsage extension has the CodeSigning OID.
514 @result A policy object. The caller is responsible for calling CFRelease
515 on this when it is no longer needed.
516 */
517 __nullable CF_RETURNS_RETAINED
518 SecPolicyRef SecPolicyCreateApplePackageSigning(void);
519
520 /*!
521 @function SecPolicyCreateiPhoneApplicationSigning
522 @abstract Returns a policy object for evaluating signed application
523 signatures. This is for apps signed directly by the app store.
524 @discussion This policy uses the Basic X.509 policy with no validity check
525 and pinning options:
526 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
527 the chain to be anchored to Test Apple Root CAs.
528 * There are exactly 3 certs in the chain.
529 * The intermediate has Common Name "Apple iPhone Certification Authority".
530 * The leaf has Common Name "Apple iPhone OS Application Signing".
531 * The leaf has a marker extension with OID 1.2.840.113635.100.6.1.3 or OID
532 1.2.840.113635.100.6.1.6.
533 * The leaf has ExtendedKeyUsage, if any, with the AnyExtendedKeyUsage OID
534 or the CodeSigning OID.
535 @result A policy object. The caller is responsible for calling CFRelease
536 on this when it is no longer needed.
537 */
538 __nullable CF_RETURNS_RETAINED
539 SecPolicyRef SecPolicyCreateiPhoneApplicationSigning(void);
540
541 /*!
542 @function SecPolicyCreateiPhoneVPNApplicationSigning
543 @abstract Returns a policy object for evaluating signed VPN application
544 signatures. This is for VPN plugins signed directly by the VPN team.
545 @discussion This policy uses the Basic X.509 policy with no validity check
546 and pinning options:
547 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
548 the chain to be anchored to Test Apple Root CAs.
549 * There are exactly 3 certs in the chain.
550 * The intermediate has Common Name "Apple iPhone Certification Authority".
551 * The leaf has Common Name "Apple iPhone OS Application Signing".
552 * The leaf has a marker extension with 1.2.840.113635.100.6.1.6.
553 * The leaf has ExtendedKeyUsage, if any, with the AnyExtendedKeyUsage OID
554 or the CodeSigning OID.
555 @result A policy object. The caller is responsible for calling CFRelease
556 on this when it is no longer needed.
557 */
558 __nullable CF_RETURNS_RETAINED
559 SecPolicyRef SecPolicyCreateiPhoneVPNApplicationSigning(void)
560 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
561
562 /*!
563 @function SecPolicyCreateiPhoneProfileApplicationSigning
564 @abstract Returns a policy object for evaluating signed application
565 signatures. This policy is for certificates inside a UPP or regular
566 profile.
567 @discussion This policy uses the Basic X.509 policy with validity check and
568 pinning options:
569 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
570 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
571 * There are exactly 3 certs in the chain.
572 * The intermediate has a marker extension with OID matching 1.2.840.113635.100.6.2.1 (WWDR CA).
573 * The leaf has a marker extension with OID matching one of the following:
574 * 1.2.840.113635.100.6.1.2 ("iPhone Developer" leaf)
575 * 1.2.840.113635.100.6.1.4 ("iPhone Distribution" leaf)
576 * 1.2.840.113635.100.6.1.25.1 ("TestFlight" leaf)
577 * On internal releases, 1.2.840.113635.100.6.1.25.2
578 * The leaf has an ExtendedKeyUsage OID matching 1.3.6.1.5.5.7.3.3 (CodeSigning EKU).
579 * Revocation is checked via any available method.
580 @result A policy object. The caller is responsible for calling CFRelease
581 on this when it is no longer needed.
582 */
583 __nullable CF_RETURNS_RETAINED
584 SecPolicyRef SecPolicyCreateiPhoneProfileApplicationSigning(void);
585
586 /*!
587 @function SecPolicyCreateMacOSProfileApplicationSigning
588 @abstract Returns a policy object for evaluating signed application
589 signatures. This policy is for certificates inside a UPP or regular
590 profile.
591 @discussion This policy uses the Basic X.509 policy with no validity check
592 and pinning options:
593 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
594 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
595 * There are exactly 3 certs in the chain.
596 * The leaf has a marker extension with OID matching one of the following:
597 * 1.2.840.113635.100.6.1.7 ("3rd Party Mac Developer Application" leaf)
598 * 1.2.840.113635.100.6.1.12 ("Mac Developer" leaf)
599 * 1.2.840.113635.100.6.1.13 ("Developer ID Application" leaf)
600 * 1.2.840.113635.100.6.22 ("Software Signing" leaf
601 * The leaf has an ExtendedKeyUsage OID matching 1.3.6.1.5.5.7.3.3 (CodeSigning EKU).
602 * Revocation is checked via any available method.
603 @result A policy object. The caller is responsible for calling CFRelease
604 on this when it is no longer needed.
605 */
606 __nullable CF_RETURNS_RETAINED
607 SecPolicyRef SecPolicyCreateMacOSProfileApplicationSigning(void)
608 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
609
610 /*!
611 @function SecPolicyCreateiPhoneProvisioningProfileSigning
612 @abstract Returns a policy object for evaluating provisioning profile signatures.
613 @discussion This policy uses the Basic X.509 policy with no validity check
614 and pinning options:
615 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
616 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
617 * There are exactly 3 certs in the chain.
618 * The intermediate has Common Name "Apple iPhone Certification Authority".
619 * The leaf has Common Name "Apple iPhone OS Provisioning Profile Signing".
620 * If the device is not a production device and is running an internal
621 release, the leaf may have the Common Name "TEST Apple iPhone OS
622 Provisioning Profile Signing TEST".
623 @result A policy object. The caller is responsible for calling CFRelease
624 on this when it is no longer needed.
625 */
626 __nullable CF_RETURNS_RETAINED
627 SecPolicyRef SecPolicyCreateiPhoneProvisioningProfileSigning(void);
628
629 /*!
630 @function SecPolicyCreateAppleTVOSApplicationSigning
631 @abstract Returns a policy object for evaluating signed application
632 signatures. This is for apps signed directly by the Apple TV app store,
633 and allows for both the prod and the dev/test certs.
634 @discussion This policy uses the Basic X.509 policy with no validity check
635 and pinning options:
636 * The chain is anchored to any of the production Apple Root CAs.
637 Test roots are never permitted.
638 * There are exactly 3 certs in the chain.
639 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.1.
640 * The leaf has ExtendedKeyUsage, if any, with the AnyExtendedKeyUsage OID or
641 the CodeSigning OID.
642 * The leaf has a marker extension with OID 1.2.840.113635.100.6.1.24 or OID
643 1.2.840.113635.100.6.1.24.1.
644 @result A policy object. The caller is responsible for calling CFRelease
645 on this when it is no longer needed.
646 */
647 __nullable CF_RETURNS_RETAINED
648 SecPolicyRef SecPolicyCreateAppleTVOSApplicationSigning(void);
649
650 /*!
651 @function SecPolicyCreateOCSPSigner
652 @abstract Returns a policy object for evaluating ocsp response signers.
653 @discussion This policy uses the Basic X.509 policy with validity check and
654 requires the leaf to have an ExtendedKeyUsage of OCSPSigning.
655 @result A policy object. The caller is responsible for calling CFRelease
656 on this when it is no longer needed.
657 */
658 __nullable CF_RETURNS_RETAINED
659 SecPolicyRef SecPolicyCreateOCSPSigner(void);
660
661
662 enum {
663 kSecSignSMIMEUsage = (1 << 0),
664 kSecKeyEncryptSMIMEUsage = (1 << 1),
665 kSecDataEncryptSMIMEUsage = (1 << 2),
666 kSecKeyExchangeDecryptSMIMEUsage = (1 << 3),
667 kSecKeyExchangeEncryptSMIMEUsage = (1 << 4),
668 kSecKeyExchangeBothSMIMEUsage = (1 << 5),
669 kSecAnyEncryptSMIME = kSecKeyEncryptSMIMEUsage | kSecDataEncryptSMIMEUsage |
670 kSecKeyExchangeDecryptSMIMEUsage | kSecKeyExchangeEncryptSMIMEUsage,
671 kSecIgnoreExpirationSMIMEUsage = (1 << 6)
672 };
673
674 /*!
675 @function SecPolicyCreateSMIME
676 @abstract Returns a policy object for evaluating S/MIME certificate chains.
677 @param smimeUsage Pass the bitwise or of one or more kSecXXXSMIMEUsage
678 flags, to indicate the intended usage of this certificate.
679 @param email Optional; if present, the policy will require the specified
680 email to match the email in the leaf certificate.
681 @discussion This policy uses the Basic X.509 policy with validity check and
682 requires the leaf to have
683 * a KeyUsage matching the smimeUsage,
684 * an ExtendedKeyUsage, if any, with the AnyExtendedKeyUsage OID or the
685 EmailProtection OID, and
686 * if the email param is specified, the email address in the RFC822Name in the
687 SubjectAlternativeName extension or in the Email Address field of the
688 Subject Name.
689 Note that temporal validity checking can be disabled with kSecIgnoreExpirationSMIMEUsage
690 @result A policy object. The caller is responsible for calling CFRelease
691 on this when it is no longer needed.
692 */
693 __nullable CF_RETURNS_RETAINED
694 SecPolicyRef SecPolicyCreateSMIME(CFIndex smimeUsage, CFStringRef __nullable email);
695
696 /*!
697 @function SecPolicyCreateCodeSigning
698 @abstract Returns a policy object for evaluating code signing certificate chains.
699 @discussion This policy uses the Basic X.509 policy with validity check and
700 requires the leaf to have
701 * a KeyUsage with both the DigitalSignature and NonRepudiation bits set, and
702 * an ExtendedKeyUsage with the AnyExtendedKeyUsage OID or the CodeSigning OID.
703 @result A policy object. The caller is responsible for calling CFRelease
704 on this when it is no longer needed.
705 */
706 __nullable CF_RETURNS_RETAINED
707 SecPolicyRef SecPolicyCreateCodeSigning(void);
708
709 /*!
710 @function SecPolicyCreateLockdownPairing
711 @abstract basic x509 policy for checking lockdown pairing certificate chains.
712 @discussion This policy checks some of the Basic X.509 policy options with no
713 validity check. It explicitly allows for empty subjects.
714 @result A policy object. The caller is responsible for calling CFRelease
715 on this when it is no longer needed.
716 */
717 __nullable CF_RETURNS_RETAINED
718 SecPolicyRef SecPolicyCreateLockdownPairing(void);
719
720 /*!
721 @function SecPolicyCreateURLBag
722 @abstract Returns a policy object for evaluating certificate chains for signing URL bags.
723 @discussion This policy uses the Basic X.509 policy with no validity check and requires
724 that the leaf has ExtendedKeyUsage extension with the CodeSigning OID.
725 @result A policy object. The caller is responsible for calling CFRelease
726 on this when it is no longer needed.
727 */
728 __nullable CF_RETURNS_RETAINED
729 SecPolicyRef SecPolicyCreateURLBag(void);
730
731 /*!
732 @function SecPolicyCreateOTATasking
733 @abstract Returns a policy object for evaluating certificate chains for signing OTA Tasking.
734 @discussion This policy uses the Basic X.509 policy with validity check and
735 pinning options:
736 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
737 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
738 * There are exactly 3 certs in the chain.
739 * The intermediate has Common Name "Apple iPhone Certification Authority".
740 * The leaf has Common Name "OTA Task Signing".
741 @result A policy object. The caller is responsible for calling CFRelease
742 on this when it is no longer needed.
743 */
744 __nullable CF_RETURNS_RETAINED
745 SecPolicyRef SecPolicyCreateOTATasking(void);
746
747 /*!
748 @function SecPolicyCreateMobileAsset
749 @abstract Returns a policy object for evaluating certificate chains for signing Mobile Assets.
750 @discussion This policy uses the Basic X.509 policy with no validity check
751 and pinning options:
752 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
753 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
754 * There are exactly 3 certs in the chain.
755 * The intermediate has Common Name "Apple iPhone Certification Authority".
756 * The leaf has Common Name "Asset Manifest Signing".
757 @result A policy object. The caller is responsible for calling CFRelease
758 on this when it is no longer needed.
759 */
760 __nullable CF_RETURNS_RETAINED
761 SecPolicyRef SecPolicyCreateMobileAsset(void);
762
763 /*!
764 @function SecPolicyCreateMobileAssetDevelopment
765 @abstract Returns a policy object for evaluating certificate chains for signing development
766 Mobile Assets.
767 @discussion This policy uses the Basic X.509 policy with no validity check
768 and pinning options:
769 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
770 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
771 * There are exactly 3 certs in the chain.
772 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.18.
773 * The leaf has a marker extension with OID 1.2.840.113635.100.6.55.1.
774 @result A policy object. The caller is responsible for calling CFRelease
775 on this when it is no longer needed.
776 */
777 __nullable CF_RETURNS_RETAINED
778 SecPolicyRef SecPolicyCreateMobileAssetDevelopment(void)
779 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
780
781 /*!
782 @function SecPolicyCreateAppleIDAuthorityPolicy
783 @abstract Returns a policy object for evaluating certificate chains for Apple ID Authority.
784 @discussion This policy uses the Basic X.509 policy with validity check
785 and pinning options:
786 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
787 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
788 * The intermediate(s) has(have) a marker extension with OID 1.2.840.113635.100.6.2.3
789 or OID 1.2.840.113635.100.6.2.7.
790 * The leaf has a marker extension with OID 1.2.840.113635.100.4.7.
791 * Revocation is checked via any available method.
792 @result A policy object. The caller is responsible for calling CFRelease
793 on this when it is no longer needed.
794 */
795 __nullable CF_RETURNS_RETAINED
796 SecPolicyRef SecPolicyCreateAppleIDAuthorityPolicy(void);
797
798 /*!
799 @function SecPolicyCreateMacAppStoreReceipt
800 @abstract Returns a policy object for evaluating certificate chains for signing
801 Mac App Store Receipts.
802 @discussion This policy uses the Basic X.509 policy with validity check
803 and pinning options:
804 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
805 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
806 * There are exactly 3 certs in the chain.
807 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.1.
808 * The leaf has CertificatePolicy extension with OID 1.2.840.113635.100.5.6.1.
809 * The leaf has a marker extension with OID 1.2.840.113635.100.6.11.1.
810 * Revocation is checked via any available method.
811 @result A policy object. The caller is responsible for calling CFRelease
812 on this when it is no longer needed.
813 */
814 __nullable CF_RETURNS_RETAINED
815 SecPolicyRef SecPolicyCreateMacAppStoreReceipt(void);
816
817 /*!
818 @function SecPolicyCreatePassbookCardSigner
819 @abstract Returns a policy object for evaluating certificate chains for signing Passbook cards.
820 @param cardIssuer Required; must match name in marker extension.
821 @param teamIdentifier Optional; if present, the policy will require the specified
822 team ID to match the organizationalUnit field in the leaf certificate's subject.
823 @discussion This policy uses the Basic X.509 policy with validity check
824 and pinning options:
825 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
826 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
827 * The leaf has a marker extension with OID 1.2.840.113635.100.6.1.16 and containing the
828 cardIssuer.
829 * The leaf has ExtendedKeyUsage with OID 1.2.840.113635.100.4.14.
830 * The leaf has a Organizational Unit matching the TeamID.
831 @result A policy object. The caller is responsible for calling CFRelease
832 on this when it is no longer needed.
833 */
834 __nullable CF_RETURNS_RETAINED
835 SecPolicyRef SecPolicyCreatePassbookCardSigner(CFStringRef cardIssuer,
836 CFStringRef __nullable teamIdentifier);
837
838 /*!
839 @function SecPolicyCreateMobileStoreSigner
840 @abstract Returns a policy object for evaluating Mobile Store certificate chains.
841 @discussion This policy uses the Basic X.509 policy with validity check
842 and pinning options:
843 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
844 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
845 * There are exactly 3 certs in the chain.
846 * The intermediate has Common Name "Apple System Integration 2 Certification Authority".
847 * The leaf has KeyUsage with the DigitalSignature bit set.
848 * The leaf has CertificatePolicy extension with OID 1.2.840.113635.100.5.12.
849 @result A policy object. The caller is responsible for calling CFRelease
850 on this when it is no longer needed.
851 */
852 __nullable CF_RETURNS_RETAINED
853 SecPolicyRef SecPolicyCreateMobileStoreSigner(void);
854
855 /*!
856 @function SecPolicyCreateTestMobileStoreSigner
857 @abstract Returns a policy object for evaluating Test Mobile Store certificate chains.
858 @discussion This policy uses the Basic X.509 policy with validity check
859 and pinning options:
860 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
861 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
862 * There are exactly 3 certs in the chain.
863 * The intermediate has Common Name "Apple System Integration 2 Certification Authority".
864 * The leaf has KeyUsage with the DigitalSignature bit set.
865 * The leaf has CertificatePolicy extension with OID 1.2.840.113635.100.5.12.1.
866 @result A policy object. The caller is responsible for calling CFRelease
867 on this when it is no longer needed.
868 */
869 __nullable CF_RETURNS_RETAINED
870 SecPolicyRef SecPolicyCreateTestMobileStoreSigner(void);
871
872 /*!
873 @function SecPolicyCreateEscrowServiceSigner
874 @abstract Returns a policy object for evaluating Escrow Service certificate chains.
875 @discussion This policy uses the Basic X.509 policy with no validity check
876 and pinning options:
877 * The chain is anchored to the current Escrow Roots in the OTAPKI asset.
878 * There are exactly 2 certs in the chain.
879 * The leaf has KeyUsage with the KeyEncipherment bit set.
880 @result A policy object. The caller is responsible for calling CFRelease
881 on this when it is no longer needed.
882 */
883 __nullable CF_RETURNS_RETAINED
884 SecPolicyRef SecPolicyCreateEscrowServiceSigner(void);
885
886 /*!
887 @function SecPolicyCreatePCSEscrowServiceSigner
888 @abstract Returns a policy object for evaluating PCS Escrow Service certificate chains.
889 @discussion This policy uses the Basic X.509 policy with validity check
890 and pinning options:
891 * The chain is anchored to the current PCS Escrow Roots in the OTAPKI asset.
892 * There are exactly 2 certs in the chain.
893 * The leaf has KeyUsage with the KeyEncipherment bit set.
894 @result A policy object. The caller is responsible for calling CFRelease
895 on this when it is no longer needed.
896 */
897 __nullable CF_RETURNS_RETAINED
898 SecPolicyRef SecPolicyCreatePCSEscrowServiceSigner(void);
899
900 /*!
901 @function SecPolicyCreateOSXProvisioningProfileSigning
902 @abstract Returns a policy object for evaluating certificate chains for signing OS X
903 Provisioning Profiles.
904 @discussion This policy uses the Basic X.509 policy with validity check
905 and pinning options:
906 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
907 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
908 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.1.
909 * The leaf has KeyUsage with the DigitalSignature bit set.
910 * The leaf has a marker extension with OID 1.2.840.113635.100.4.11.
911 * Revocation is checked via OCSP.
912 @result A policy object. The caller is responsible for calling CFRelease
913 on this when it is no longer needed.
914 */
915 __nullable CF_RETURNS_RETAINED
916 SecPolicyRef SecPolicyCreateOSXProvisioningProfileSigning(void);
917
918 /*!
919 @function SecPolicyCreateConfigurationProfileSigner
920 @abstract Returns a policy object for evaluating certificate chains for signing
921 Configuration Profiles.
922 @discussion This policy uses the Basic X.509 policy with validity check
923 and pinning options:
924 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
925 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
926 * There are exactly 3 certs in the chain.
927 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.3.
928 * The leaf has ExtendedKeyUsage with OID 1.2.840.113635.100.4.16.
929 @result A policy object. The caller is responsible for calling CFRelease
930 on this when it is no longer needed.
931 */
932 __nullable CF_RETURNS_RETAINED
933 SecPolicyRef SecPolicyCreateConfigurationProfileSigner(void);
934
935 /*!
936 @function SecPolicyCreateQAConfigurationProfileSigner
937 @abstract Returns a policy object for evaluating certificate chains for signing
938 QA Configuration Profiles. On customer builds, this function returns the same
939 policy as SecPolicyCreateConfigurationProfileSigner.
940 @discussion This policy uses the Basic X.509 policy with validity check
941 and pinning options:
942 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
943 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
944 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.3.
945 * The leaf has ExtendedKeyUsage with OID 1.2.840.113635.100.4.17.
946 @result A policy object. The caller is responsible for calling CFRelease
947 on this when it is no longer needed.
948 */
949 __nullable CF_RETURNS_RETAINED
950 SecPolicyRef SecPolicyCreateQAConfigurationProfileSigner(void);
951
952 /*!
953 @function SecPolicyCreateOTAPKISigner
954 @abstract Returns a policy object for evaluating OTA PKI certificate chains.
955 @discussion This policy uses the Basic X.509 policy with validity check
956 and pinning options:
957 * The chain is anchored to Apple PKI Settings CA.
958 * There are exactly 2 certs in the chain.
959 @result A policy object. The caller is responsible for calling CFRelease
960 on this when it is no longer needed.
961 */
962 __nullable CF_RETURNS_RETAINED
963 SecPolicyRef SecPolicyCreateOTAPKISigner(void)
964 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12, __MAC_10_13_4, __IPHONE_7_0, __IPHONE_11_3);
965
966 /*!
967 @function SecPolicyCreateTestOTAPKISigner
968 @abstract Returns a policy object for evaluating OTA PKI certificate chains.
969 @discussion This policy uses the Basic X.509 policy with validity check
970 and pinning options:
971 * The chain is anchored to Apple Test PKI Settings CA.
972 * There are exactly 2 certs in the chain.
973 @result A policy object. The caller is responsible for calling CFRelease
974 on this when it is no longer needed.
975 */
976 __nullable CF_RETURNS_RETAINED
977 SecPolicyRef SecPolicyCreateTestOTAPKISigner(void)
978 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12, __MAC_10_13_4, __IPHONE_7_0, __IPHONE_11_3);
979
980 /*!
981 @function SecPolicyCreateAppleIDValidationRecordSigningPolicy
982 @abstract Returns a policy object for evaluating certificate chains for signing
983 Apple ID Validation Records.
984 @discussion This policy uses the Basic X.509 policy with validity check
985 and pinning options:
986 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
987 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
988 * The intermediate(s) has(have) a marker extension with OID 1.2.840.113635.100.6.2.3
989 or OID 1.2.840.113635.100.6.2.10.
990 * The leaf has a marker extension with OID 1.2.840.113635.100.6.25.
991 * Revocation is checked via OCSP.
992 @result A policy object. The caller is responsible for calling CFRelease
993 on this when it is no longer needed.
994 */
995 __nullable CF_RETURNS_RETAINED
996 SecPolicyRef SecPolicyCreateAppleIDValidationRecordSigningPolicy(void);
997
998 /*!
999 @function SecPolicyCreateAppleSMPEncryption
1000 @abstract Returns a policy object for evaluating SMP certificate chains.
1001 @discussion This policy uses the Basic X.509 policy with no validity check
1002 and pinning options:
1003 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1004 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1005 * There are exactly 3 certs in the chain.
1006 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.13.
1007 * The leaf has KeyUsage with the KeyEncipherment bit set.
1008 * The leaf has a marker extension with OID 1.2.840.113635.100.6.30.
1009 * Revocation is checked via OCSP.
1010 @result A policy object. The caller is responsible for calling CFRelease
1011 on this when it is no longer needed.
1012 */
1013 __nullable CF_RETURNS_RETAINED
1014 SecPolicyRef SecPolicyCreateAppleSMPEncryption(void);
1015
1016 /*!
1017 @function SecPolicyCreateTestAppleSMPEncryption
1018 @abstract Returns a policy object for evaluating Test SMP certificate chains.
1019 @discussion This policy uses the Basic X.509 policy with no validity check
1020 and pinning options:
1021 * The chain is anchored to a Test Apple Root with ECC public key certificate.
1022 * There are exactly 3 certs in the chain.
1023 * The intermediate has Common Name "Test Apple System Integration CA - ECC".
1024 * The leaf has KeyUsage with the KeyEncipherment bit set.
1025 * Revocation is checked via OCSP.
1026 @result A policy object. The caller is responsible for calling CFRelease
1027 on this when it is no longer needed.
1028 */
1029 __nullable CF_RETURNS_RETAINED
1030 SecPolicyRef SecPolicyCreateTestAppleSMPEncryption(void);
1031
1032 /*!
1033 @function SecPolicyCreateApplePPQSigning
1034 @abstract Returns a policy object for verifying production PPQ Signing certificates.
1035 @discussion This policy uses the Basic X.509 policy with no validity check
1036 and pinning options:
1037 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1038 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1039 * There are exactly 3 certs in the chain.
1040 * The intermediate has Common Name "Apple System Integration 2 Certification
1041 Authority".
1042 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.10.
1043 * The leaf has KeyUsage with the DigitalSignature bit set.
1044 * The leaf has a marker extension with OID 1.2.840.113635.100.6.38.2.
1045 @result A policy object. The caller is responsible for calling CFRelease
1046 on this when it is no longer needed.
1047 */
1048 __nullable CF_RETURNS_RETAINED
1049 SecPolicyRef SecPolicyCreateApplePPQSigning(void);
1050
1051 /*!
1052 @function SecPolicyCreateTestApplePPQSigning
1053 @abstract Returns a policy object for verifying test PPQ Signing certificates. On
1054 customer builds, this function returns the same policy as SecPolicyCreateApplePPQSigning.
1055 @discussion This policy uses the Basic X.509 policy with no validity check
1056 and pinning options:
1057 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1058 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1059 * There are exactly 3 certs in the chain.
1060 * The intermediate has Common Name "Apple System Integration 2 Certification
1061 Authority".
1062 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.10.
1063 * The leaf has KeyUsage with the DigitalSignature bit set.
1064 * The leaf has a marker extension with OID 1.2.840.113635.100.6.38.1.
1065 @result A policy object. The caller is responsible for calling CFRelease
1066 on this when it is no longer needed.
1067 */
1068 __nullable CF_RETURNS_RETAINED
1069 SecPolicyRef SecPolicyCreateTestApplePPQSigning(void);
1070
1071 /*!
1072 @function SecPolicyCreateAppleIDSService
1073 @abstract Ensure we're appropriately pinned to the IDS service (SSL + Apple restrictions)
1074 @discussion This policy uses the SSL server policy.
1075 @result A policy object. The caller is responsible for calling CFRelease
1076 on this when it is no longer needed.
1077 */
1078 __nullable CF_RETURNS_RETAINED
1079 SecPolicyRef SecPolicyCreateAppleIDSService(CFStringRef __nullable hostname);
1080
1081 /*!
1082 @function SecPolicyCreateAppleIDSServiceContext
1083 @abstract Ensure we're appropriately pinned to the IDS service (SSL + Apple restrictions)
1084 @param hostname Required; hostname to verify the certificate name against.
1085 @param context Optional; if present, "AppleServerAuthenticationAllowUATIDS" with value
1086 Boolean true will allow Test Apple roots on internal releases.
1087 @discussion This policy uses the Basic X.509 policy with validity check
1088 and pinning options:
1089 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1090 are permitted only on internal releases either using the context dictionary or with
1091 defaults write.
1092 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1093 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.4.2 or,
1094 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.4.1.
1095 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1096 extension or Common Name.
1097 * The leaf is checked against the Black and Gray lists.
1098 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1099 * Revocation is checked via any available method.
1100 @result A policy object. The caller is responsible for calling CFRelease
1101 on this when it is no longer needed.
1102 */
1103 __nullable CF_RETURNS_RETAINED
1104 SecPolicyRef SecPolicyCreateAppleIDSServiceContext(CFStringRef hostname, CFDictionaryRef __nullable context);
1105
1106 /*!
1107 @function SecPolicyCreateApplePushService
1108 @abstract Ensure we're appropriately pinned to the Apple Push service (SSL + Apple restrictions)
1109 @param hostname Required; hostname to verify the certificate name against.
1110 @param context Optional; if present, "AppleServerAuthenticationAllowUATAPN" with value
1111 Boolean true will allow Test Apple roots on internal releases.
1112 @discussion This policy uses the Basic X.509 policy with validity check
1113 and pinning options:
1114 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1115 are permitted only on internal releases either using the context dictionary or with
1116 defaults write.
1117 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1118 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.5.2 or,
1119 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.5.1.
1120 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1121 extension or Common Name.
1122 * The leaf is checked against the Black and Gray lists.
1123 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1124 * Revocation is checked via any available method.
1125 @result A policy object. The caller is responsible for calling CFRelease
1126 on this when it is no longer needed.
1127 */
1128 __nullable CF_RETURNS_RETAINED
1129 SecPolicyRef SecPolicyCreateApplePushService(CFStringRef hostname, CFDictionaryRef __nullable context);
1130
1131 /*!
1132 @function SecPolicyCreateApplePushServiceLegacy
1133 @abstract Ensure we're appropriately pinned to the Push service (via Entrust)
1134 @param hostname Required; hostname to verify the certificate name against.
1135 @discussion This policy uses the Basic X.509 policy with validity check
1136 and pinning options:
1137 * The chain is anchored to an Entrust Intermediate.
1138 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1139 extension or Common Name.
1140 * The leaf is checked against the Black and Gray lists.
1141 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1142 * Revocation is checked via any available method.
1143 @result A policy object. The caller is responsible for calling CFRelease
1144 on this when it is no longer needed.
1145 */
1146 __nullable CF_RETURNS_RETAINED
1147 SecPolicyRef SecPolicyCreateApplePushServiceLegacy(CFStringRef hostname);
1148
1149 /*!
1150 @function SecPolicyCreateAppleMMCSService
1151 @abstract Ensure we're appropriately pinned to the MMCS service (SSL + Apple restrictions)
1152 @param hostname Required; hostname to verify the certificate name against.
1153 @param context Optional; if present, "AppleServerAuthenticationAllowUATMMCS" with value
1154 Boolean true will allow Test Apple roots and test OIDs on internal releases.
1155 @discussion This policy uses the Basic X.509 policy with validity check
1156 and pinning options:
1157 * The chain is anchored to any of the production Apple Root CAs.
1158 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1159 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.11.2 or, if
1160 enabled, OID 1.2.840.113635.100.6.27.11.1.
1161 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1162 extension or Common Name.
1163 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1164 * Revocation is checked via any available method.
1165 @result A policy object. The caller is responsible for calling CFRelease
1166 on this when it is no longer needed.
1167 */
1168 __nullable CF_RETURNS_RETAINED
1169 SecPolicyRef SecPolicyCreateAppleMMCSService(CFStringRef hostname, CFDictionaryRef __nullable context);
1170
1171 /*!
1172 @function SecPolicyCreateAppleCompatibilityMMCSService
1173 @abstract Ensure we're appropriately pinned to the MMCS service using compatibility certs
1174 @param hostname Required; hostname to verify the certificate name against.
1175 @discussion This policy uses the Basic X.509 policy with validity check
1176 and pinning options:
1177 * The chain is anchored to the GeoTrust Global CA
1178 * The intermediate has a subject public key info hash matching the public key of
1179 the Apple IST CA G1 intermediate.
1180 * The chain length is 3.
1181 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.11.2 or
1182 OID 1.2.840.113635.100.6.27.11.1.
1183 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1184 extension or Common Name.
1185 * The leaf is checked against the Black and Gray lists.
1186 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1187 @result A policy object. The caller is responsible for calling CFRelease
1188 on this when it is no longer needed.
1189 */
1190 __nullable CF_RETURNS_RETAINED
1191 SecPolicyRef SecPolicyCreateAppleCompatibilityMMCSService(CFStringRef hostname)
1192 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0);
1193
1194 /*!
1195 @function SecPolicyCreateAppleGSService
1196 @abstract Ensure we're appropriately pinned to the GS service (SSL + Apple restrictions)
1197 @param hostname Required; hostname to verify the certificate name against.
1198 @param context Optional; if present, "AppleServerAuthenticationAllowUATGS" with value
1199 Boolean true will allow Test Apple roots on internal releases.
1200 @discussion This policy uses the Basic X.509 policy with validity check
1201 and pinning options:
1202 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1203 are permitted only on internal releases either using the context dictionary or with
1204 defaults write.
1205 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1206 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.2.
1207 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1208 extension or Common Name.
1209 * The leaf is checked against the Black and Gray lists.
1210 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1211 * Revocation is checked via any available method.
1212 @result A policy object. The caller is responsible for calling CFRelease
1213 on this when it is no longer needed.
1214 */
1215 __nullable CF_RETURNS_RETAINED
1216 SecPolicyRef SecPolicyCreateAppleGSService(CFStringRef hostname, CFDictionaryRef __nullable context)
1217 __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
1218
1219 /*!
1220 @function SecPolicyCreateApplePPQService
1221 @abstract Ensure we're appropriately pinned to the PPQ service (SSL + Apple restrictions)
1222 @param hostname Required; hostname to verify the certificate name against.
1223 @param context Optional; if present, "AppleServerAuthenticationAllowUATPPQ" with value
1224 Boolean true will allow Test Apple roots on internal releases.
1225 @discussion This policy uses the Basic X.509 policy with validity check
1226 and pinning options:
1227 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1228 are permitted only on internal releases either using the context dictionary or with
1229 defaults write.
1230 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1231 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.3.2 or,
1232 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.3.1.
1233 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1234 extension or Common Name.
1235 * The leaf is checked against the Black and Gray lists.
1236 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1237 * Revocation is checked via any available method.
1238 @result A policy object. The caller is responsible for calling CFRelease
1239 on this when it is no longer needed.
1240 */
1241 __nullable CF_RETURNS_RETAINED
1242 SecPolicyRef SecPolicyCreateApplePPQService(CFStringRef hostname, CFDictionaryRef __nullable context)
1243 __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
1244
1245 /*!
1246 @function SecPolicyCreateAppleAST2Service
1247 @abstract Ensure we're appropriately pinned to the AST2 Diagnostic service (SSL + Apple restrictions)
1248 @param hostname Required; hostname to verify the certificate name against.
1249 @param context Optional; if present, "AppleServerAuthenticationAllowUATAST2" with value
1250 Boolean true will allow Test Apple roots on internal releases.
1251 @discussion This policy uses the Basic X.509 policy with validity check
1252 and pinning options:
1253 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1254 are permitted either using the context dictionary or with defaults write.
1255 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1256 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.8.2 or,
1257 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.8.1.
1258 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1259 extension or Common Name.
1260 * The leaf is checked against the Black and Gray lists.
1261 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1262 * Revocation is checked via any available method.
1263 @result A policy object. The caller is responsible for calling CFRelease
1264 on this when it is no longer needed.
1265 */
1266 __nullable CF_RETURNS_RETAINED
1267 SecPolicyRef SecPolicyCreateAppleAST2Service(CFStringRef hostname, CFDictionaryRef __nullable context)
1268 __OSX_AVAILABLE_STARTING(__MAC_10_11_4, __IPHONE_9_3);
1269
1270 /*!
1271 @function SecPolicyCreateAppleEscrowProxyService
1272 @abstract Ensure we're appropriately pinned to the iCloud Escrow Proxy service (SSL + Apple restrictions)
1273 @param hostname Required; hostname to verify the certificate name against.
1274 @param context Optional; if present, "AppleServerAuthenticationAllowUATEscrow" with value
1275 Boolean true will allow Test Apple roots on internal releases.
1276 @discussion This policy uses the Basic X.509 policy with validity check
1277 and pinning options:
1278 * The chain is anchored to any of the production Apple Root CAs via full certificate
1279 comparison. Test Apple Root CAs are permitted only on internal releases either
1280 using the context dictionary or with defaults write.
1281 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1282 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.7.2 or,
1283 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.7.1.
1284 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1285 extension or Common Name.
1286 * The leaf is checked against the Black and Gray lists.
1287 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1288 * Revocation is checked via any available method.
1289 @result A policy object. The caller is responsible for calling CFRelease
1290 on this when it is no longer needed.
1291 */
1292 __nullable CF_RETURNS_RETAINED
1293 SecPolicyRef SecPolicyCreateAppleEscrowProxyService(CFStringRef hostname, CFDictionaryRef __nullable context)
1294 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0);
1295
1296 /*!
1297 @function SecPolicyCreateAppleCompatibilityEscrowProxyService
1298 @abstract Ensure we're appropriately pinned to the iCloud Escrow Proxy service using compatibility certs
1299 @param hostname Required; hostname to verify the certificate name against.
1300 @discussion This policy uses the Basic X.509 policy with validity check
1301 and pinning options:
1302 * The chain is anchored to the GeoTrust Global CA
1303 * The intermediate has a subject public key info hash matching the public key of
1304 the Apple IST CA G1 intermediate.
1305 * The chain length is 3.
1306 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.7.2 or,
1307 if UAT is enabled with a defaults write (internal devices only),
1308 OID 1.2.840.113635.100.6.27.7.1.
1309 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1310 extension or Common Name.
1311 * The leaf is checked against the Black and Gray lists.
1312 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1313 @result A policy object. The caller is responsible for calling CFRelease
1314 on this when it is no longer needed.
1315 */
1316 __nullable CF_RETURNS_RETAINED
1317 SecPolicyRef SecPolicyCreateAppleCompatibilityEscrowProxyService(CFStringRef hostname)
1318 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0);
1319
1320 /*!
1321 @function SecPolicyCreateAppleFMiPService
1322 @abstract Ensure we're appropriately pinned to the Find My iPhone service (SSL + Apple restrictions)
1323 @param hostname Required; hostname to verify the certificate name against.
1324 @param context Optional; if present, "AppleServerAuthenticationAllowUATFMiP" with value
1325 Boolean true will allow Test Apple roots on internal releases.
1326 @discussion This policy uses the Basic X.509 policy with validity check
1327 and pinning options:
1328 * The chain is anchored to any of the production Apple Root CAs via full certificate
1329 comparison. Test Apple Root CAs are permitted only on internal releases either
1330 using the context dictionary or with defaults write.
1331 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1332 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.6.2 or,
1333 if Test Roots are allowed, OID 1.2.840.113635.100.6.27.6.1.
1334 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1335 extension or Common Name.
1336 * The leaf is checked against the Black and Gray lists.
1337 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1338 * Revocation is checked via any available method.
1339 @result A policy object. The caller is responsible for calling CFRelease
1340 on this when it is no longer needed.
1341 */
1342 __nullable CF_RETURNS_RETAINED
1343 SecPolicyRef SecPolicyCreateAppleFMiPService(CFStringRef hostname, CFDictionaryRef __nullable context)
1344 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0);
1345
1346 /*!
1347 @function SecPolicyCreateAppleSSLService
1348 @abstract Ensure we're appropriately pinned to an Apple server (SSL + Apple restrictions)
1349 @param hostname Optional; hostname to verify the certificate name against.
1350 @discussion This policy uses the Basic X.509 policy with validity check
1351 and pinning options:
1352 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1353 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1354 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1355 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.1
1356 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1357 extension or Common Name.
1358 * The leaf is checked against the Black and Gray lists.
1359 * The leaf has ExtendedKeyUsage, if any, with the ServerAuth OID.
1360 * Revocation is checked via any available method.
1361 @result A policy object. The caller is responsible for calling CFRelease
1362 on this when it is no longer needed.
1363 */
1364 __nullable CF_RETURNS_RETAINED
1365 SecPolicyRef SecPolicyCreateAppleSSLService(CFStringRef __nullable hostname);
1366
1367 /*!
1368 @function SecPolicyCreateAppleTimeStamping
1369 @abstract Returns a policy object for evaluating time stamping certificate chains.
1370 @discussion This policy uses the Basic X.509 policy with validity check
1371 and requires the leaf has ExtendedKeyUsage with the TimeStamping OID.
1372 @result A policy object. The caller is responsible for calling CFRelease
1373 on this when it is no longer needed.
1374 */
1375 __nullable CF_RETURNS_RETAINED
1376 SecPolicyRef SecPolicyCreateAppleTimeStamping(void);
1377
1378 /*!
1379 @function SecPolicyCreateApplePayIssuerEncryption
1380 @abstract Returns a policy object for evaluating Apple Pay Issuer Encryption certificate chains.
1381 @discussion This policy uses the Basic X.509 policy with no validity check
1382 and pinning options:
1383 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1384 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1385 * There are exactly 3 certs in the chain.
1386 * The intermediate has Common Name "Apple Worldwide Developer Relations CA - G2".
1387 * The leaf has KeyUsage with the KeyEncipherment bit set.
1388 * The leaf has a marker extension with OID 1.2.840.113635.100.6.39.
1389 @result A policy object. The caller is responsible for calling CFRelease
1390 on this when it is no longer needed.
1391 */
1392 __nullable CF_RETURNS_RETAINED
1393 SecPolicyRef SecPolicyCreateApplePayIssuerEncryption(void)
1394 __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
1395
1396 /*!
1397 @function SecPolicyCreateAppleATVVPNProfileSigning
1398 @abstract Returns a policy object for evaluating Apple TV VPN Profile certificate chains.
1399 @discussion This policy uses the Basic X.509 policy with no validity check
1400 and pinning options:
1401 * The chain is anchored to any of the production Apple Root CAs. Test Apple Root CAs
1402 are permitted only on internal releases.
1403 * There are exactly 3 certs in the chain.
1404 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.10.
1405 * The leaf has a marker extension with OID 1.2.840.113635.100.6.43.
1406 * Revocation is checked via OCSP.
1407 @result A policy object. The caller is responsible for calling CFRelease
1408 on this when it is no longer needed.
1409 */
1410 __nullable CF_RETURNS_RETAINED
1411 SecPolicyRef SecPolicyCreateAppleATVVPNProfileSigning(void)
1412 __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
1413
1414 /*!
1415 @function SecPolicyCreateAppleHomeKitServerAuth
1416 @abstract Ensure we're appropriately pinned to the HomeKit service (SSL + Apple restrictions)
1417 @param hostname Required; hostname to verify the certificate name against.
1418 @discussion This policy uses the Basic X.509 policy with validity check
1419 and pinning options:
1420 * The chain is anchored to any of the production Apple Root CAs via full certificate
1421 comparison. Test Apple Root CAs are permitted only on internal releases with defaults write.
1422 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.16
1423 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.9.
1424 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1425 extension or Common Name.
1426 * The leaf is checked against the Black and Gray lists.
1427 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1428 * Revocation is checked via any available method.
1429 @result A policy object. The caller is responsible for calling CFRelease
1430 on this when it is no longer needed.
1431 */
1432 __nullable CF_RETURNS_RETAINED
1433 SecPolicyRef SecPolicyCreateAppleHomeKitServerAuth(CFStringRef hostname)
1434 __OSX_AVAILABLE_STARTING(__MAC_10_11_4, __IPHONE_9_3);
1435
1436 /*!
1437 @function SecPolicyCreateAppleExternalDeveloper
1438 @abstract Returns a policy object for verifying Apple-issued external developer
1439 certificates.
1440 @discussion The resulting policy uses the Basic X.509 policy with validity check and
1441 pinning options:
1442 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1443 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1444 * There are exactly 3 certs in the chain.
1445 * The intermediate has a marker extension with OID matching 1.2.840.113635.100.6.2.1
1446 (WWDR CA) or 1.2.840.113635.100.6.2.6 (Developer ID CA).
1447 * The leaf has a marker extension with OID matching one of the following:
1448 * 1.2.840.113635.100.6.1.2 ("iPhone Developer" leaf)
1449 * 1.2.840.113635.100.6.1.4 ("iPhone Distribution" leaf)
1450 * 1.2.840.113635.100.6.1.5 ("Safari Developer" leaf)
1451 * 1.2.840.113635.100.6.1.7 ("3rd Party Mac Developer Application" leaf)
1452 * 1.2.840.113635.100.6.1.8 ("3rd Party Mac Developer Installer" leaf)
1453 * 1.2.840.113635.100.6.1.12 ("Mac Developer" leaf)
1454 * 1.2.840.113635.100.6.1.13 ("Developer ID Application" leaf)
1455 * 1.2.840.113635.100.6.1.14 ("Developer ID Installer" leaf)
1456 * The leaf has an ExtendedKeyUsage OID matching one of the following:
1457 * 1.3.6.1.5.5.7.3.3 (CodeSigning EKU)
1458 * 1.2.840.113635.100.4.8 ("Safari Developer" EKU)
1459 * 1.2.840.113635.100.4.9 ("3rd Party Mac Developer Installer" EKU)
1460 * 1.2.840.113635.100.4.13 ("Developer ID Installer" EKU)
1461 * Revocation is checked via any available method.
1462 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1463 @result A policy object. The caller is responsible for calling CFRelease on this when
1464 it is no longer needed.
1465 */
1466 __nullable CF_RETURNS_RETAINED
1467 SecPolicyRef SecPolicyCreateAppleExternalDeveloper(void)
1468 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
1469
1470 /*!
1471 @function SecPolicyCreateAppleSoftwareSigning
1472 @abstract Returns a policy object for verifying the Apple Software Signing certificate.
1473 @discussion The resulting policy uses the Basic X.509 policy with no validity check and
1474 pinning options:
1475 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1476 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1477 * There are exactly 3 certs in the chain.
1478 * The intermediate has the Common Name "Apple Code Signing Certification Authority".
1479 * The leaf has a marker extension with OID matching 1.2.840.113635.100.6.22.
1480 * The leaf has an ExtendedKeyUsage OID matching 1.3.6.1.5.5.7.3.3 (Code Signing).
1481 * Revocation is checked via any available method.
1482 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1483 @result A policy object. The caller is responsible for calling CFRelease on this when
1484 it is no longer needed.
1485 */
1486 __nullable CF_RETURNS_RETAINED
1487 SecPolicyRef SecPolicyCreateAppleSoftwareSigning(void)
1488 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
1489
1490 /*!
1491 @function SecPolicyGetName
1492 @abstract Returns a policy's name.
1493 @param policy A policy reference.
1494 @result A policy name.
1495 */
1496 __nullable CFStringRef SecPolicyGetName(SecPolicyRef policy)
1497 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
1498
1499 /*!
1500 @function SecPolicyGetOidString
1501 @abstract Returns a policy's oid in string decimal format.
1502 @param policy A policy reference.
1503 @result A policy oid.
1504 */
1505 CFStringRef SecPolicyGetOidString(SecPolicyRef policy)
1506 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
1507
1508 /*!
1509 @function SecPolicyCreateAppleUniqueDeviceCertificate
1510 @abstract Returns a policy object for verifying Unique Device Identifier Certificates.
1511 @param testRootHash Optional; The SHA-256 fingerprint of a test root for pinning.
1512 @discussion The resulting policy uses the Basic X.509 policy with no validity check and
1513 pinning options:
1514 * The chain is anchored to the SEP Root CA. Internal releases allow the chain to be
1515 anchored to the testRootHash input if the value true is set for the key
1516 "ApplePinningAllowTestCertsUCRT" in the com.apple.security preferences for the user
1517 of the calling application.
1518 * There are exactly 3 certs in the chain.
1519 * The intermediate has an extension with OID matching 1.2.840.113635.100.6.44 and value
1520 of "ucrt".
1521 * The leaf has a marker extension with OID matching 1.2.840.113635.100.10.1.
1522 * RSA key sizes are disallowed. EC key sizes are P-256 or larger.
1523 @result A policy object. The caller is responsible for calling CFRelease on this when
1524 it is no longer needed.
1525 */
1526 __nullable CF_RETURNS_RETAINED
1527 SecPolicyRef SecPolicyCreateAppleUniqueDeviceCertificate(CFDataRef __nullable testRootHash)
1528 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
1529
1530 /*!
1531 @function SecPolicyCreateAppleWarsaw
1532 @abstract Returns a policy object for verifying signed Warsaw assets.
1533 @discussion The resulting policy uses the Basic X.509 policy with validity check and
1534 pinning options:
1535 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1536 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1537 * There are exactly 3 certs in the chain.
1538 * The intermediate has an extension with OID matching 1.2.840.113635.100.6.2.14.
1539 * The leaf has a marker extension with OID matching 1.2.840.113635.100.6.29.
1540 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1541 @result A policy object. The caller is responsible for calling CFRelease on this when
1542 it is no longer needed.
1543 */
1544 __nullable CF_RETURNS_RETAINED
1545 SecPolicyRef SecPolicyCreateAppleWarsaw(void)
1546 __OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) __TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1);
1547
1548 /*!
1549 @function SecPolicyCreateAppleSecureIOStaticAsset
1550 @abstract Returns a policy object for verifying signed static assets for Secure IO.
1551 @discussion The resulting policy uses the Basic X.509 policy with no validity check and
1552 pinning options:
1553 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1554 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1555 * There are exactly 3 certs in the chain.
1556 * The intermediate has an extension with OID matching 1.2.840.113635.100.6.2.10.
1557 * The leaf has a marker extension with OID matching 1.2.840.113635.100.6.50.
1558 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1559 @result A policy object. The caller is responsible for calling CFRelease on this when
1560 it is no longer needed.
1561 */
1562 __nullable CF_RETURNS_RETAINED
1563 SecPolicyRef SecPolicyCreateAppleSecureIOStaticAsset(void)
1564 __OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) __TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1);
1565
1566 /*!
1567 @function SecPolicyCreateAppleiCloudSetupService
1568 @abstract Ensure we're appropriately pinned to the iCloud Setup service (SSL + Apple restrictions)
1569 @param hostname Required; hostname to verify the certificate name against.
1570 @param context Optional; if present, "AppleServerAuthenticationAllowUATiCloudSetup" with value
1571 Boolean true will allow Test Apple roots and test OIDs on internal releases.
1572 @discussion This policy uses the Basic X.509 policy with validity check
1573 and pinning options:
1574 * The chain is anchored to any of the production Apple Root CAs.
1575 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.12.
1576 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.15.2 or, if
1577 enabled, OID 1.2.840.113635.100.6.27.15.1.
1578 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1579 extension or Common Name.
1580 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1581 * Revocation is checked via any available method.
1582 @result A policy object. The caller is responsible for calling CFRelease
1583 on this when it is no longer needed.
1584 */
1585 __nullable CF_RETURNS_RETAINED
1586 SecPolicyRef SecPolicyCreateAppleiCloudSetupService(CFStringRef hostname, CFDictionaryRef __nullable context)
1587 __OSX_AVAILABLE(10.12.4) __IOS_AVAILABLE(10.3) __TVOS_AVAILABLE(10.2) __WATCHOS_AVAILABLE(3.2);
1588
1589 /*!
1590 @function SecPolicyCreateAppleCompatibilityiCloudSetupService
1591 @abstract Ensure we're appropriately pinned to the iCloud Setup service using compatibility certs
1592 @param hostname Required; hostname to verify the certificate name against.
1593 @discussion This policy uses the Basic X.509 policy with validity check
1594 and pinning options:
1595 * The chain is anchored to the GeoTrust Global CA
1596 * The intermediate has a subject public key info hash matching the public key of
1597 the Apple IST CA G1 intermediate.
1598 * The chain length is 3.
1599 * The leaf has a marker extension with OID 1.2.840.113635.100.6.27.15.2 or
1600 OID 1.2.840.113635.100.6.27.15.1.
1601 * The leaf has the provided hostname in the DNSName of the SubjectAlternativeName
1602 extension or Common Name.
1603 * The leaf is checked against the Black and Gray lists.
1604 * The leaf has ExtendedKeyUsage with the ServerAuth OID.
1605 @result A policy object. The caller is responsible for calling CFRelease
1606 on this when it is no longer needed.
1607 */
1608 __nullable CF_RETURNS_RETAINED
1609 SecPolicyRef SecPolicyCreateAppleCompatibilityiCloudSetupService(CFStringRef hostname)
1610 __OSX_AVAILABLE(10.12.4) __IOS_AVAILABLE(10.3) __TVOS_AVAILABLE(10.2) __WATCHOS_AVAILABLE(3.2);
1611
1612 /*!
1613 @function SecPolicyCreateAppleAppTransportSecurity
1614 @abstract Ensure all certs in the evaluation meet ATS minimums
1615 @discussion This policy is meant to be used alongside an SSL policy in order to enforce App Transport Security certificate rules:
1616 * All certificates use either RSA key sizes of 2048-bits or larger or EC key sizes of 256-bits or larger.
1617 * All certificates use SHA-256 or better for signature hash algorithms.
1618 @result A policy object. The caller is responsible for calling CFRelease
1619 on this when it is no longer needed.
1620 */
1621 __nullable CF_RETURNS_RETAINED
1622 SecPolicyRef SecPolicyCreateAppleAppTransportSecurity(void)
1623 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
1624
1625 /*!
1626 @function SecPolicyCreateMobileSoftwareUpdate
1627 @abstract Returns a policy object for evaluating certificate chains for signing Mobile Software Updates.
1628 @discussion This policy uses the Basic X.509 policy with no validity check
1629 and pinning options:
1630 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1631 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1632 * There are exactly 3 certs in the chain.
1633 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.18.
1634 * The leaf has a marker extension with OID 1.2.840.113635.100.6.57.2, or on internal releases,
1635 1.2.840.113635.100.6.57.1.
1636 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1637 @result A policy object. The caller is responsible for calling CFRelease
1638 on this when it is no longer needed.
1639 */
1640 __nullable CF_RETURNS_RETAINED
1641 SecPolicyRef SecPolicyCreateMobileSoftwareUpdate(void)
1642 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
1643
1644 /*!
1645 @function SecPolicyCreateAppleBasicAttestationSystem
1646 @abstract Returns a policy object for verifying Basic Attestation Authority SCRT-attested certs
1647 @param testRootHash Optional; The SHA-256 fingerprint of a test root for pinning.
1648 @discussion The resulting policy uses the Basic X.509 policy with validity check and
1649 pinning options:
1650 * The chain is anchored to the Basic Attestation System Root CA.
1651 * There are exactly 3 certs in the chain.
1652 @result A policy object. The caller is responsible for calling CFRelease on this when
1653 it is no longer needed.
1654 */
1655 __nullable CF_RETURNS_RETAINED
1656 SecPolicyRef SecPolicyCreateAppleBasicAttestationSystem(CFDataRef __nullable testRootHash)
1657 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
1658
1659 /*!
1660 @function SecPolicyCreateAppleBasicAttestationUser
1661 @abstract Returns a policy object for verifying Basic Attestation Authority UCRT-attested certs
1662 @param testRootHash Optional; The SHA-256 fingerprint of a test root for pinning.
1663 @discussion The resulting policy uses the Basic X.509 policy with validity check and
1664 pinning options:
1665 * The chain is anchored to the Basic Attestation User Root CA.
1666 * There are exactly 3 certs in the chain.
1667 @result A policy object. The caller is responsible for calling CFRelease on this when
1668 it is no longer needed.
1669 */
1670 __nullable CF_RETURNS_RETAINED
1671 SecPolicyRef SecPolicyCreateAppleBasicAttestationUser(CFDataRef __nullable testRootHash)
1672 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
1673
1674 /*!
1675 @function SecPolicyCreateiAPSWAuth
1676 @abstract Returns a policy object for verifying iAP Software Auth certificates
1677 @discussion The resulting policy uses the Basic X.509 policy with no validity check
1678 and pinning options:
1679 * There are exactly 2 certs in the chain.
1680 * The leaf has a marker extension with OID 1.2.840.113635.100.6.59.1
1681 The intended use of this policy is that the caller pass in the
1682 SW Auth root to SecTrustSetAnchorCertificates().
1683 @result A policy object. The caller is responsible for calling CFRelease on this when
1684 it is no longer needed.
1685 */
1686 __nullable CF_RETURNS_RETAINED
1687 SecPolicyRef SecPolicyCreateiAPSWAuth(void)
1688 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
1689
1690 /*!
1691 @function SecPolicyCreateDemoDigitalCatalog
1692 @abstract Returns a policy object for evaluating certificate chains for signing Digital
1693 Catalog manifests for Demo units.
1694 @discussion This policy uses the Basic X.509 policy with validity check and
1695 pinning options:
1696 * There are exactly 3 certs in the chain.
1697 * The intermediate has common name "DemoUnit CA"
1698 * The leaf has a marker extension with OID 1.2.840.113635.100.6.60
1699 @result A policy object. The caller is responsible for calling CFRelease
1700 on this when it is no longer needed.
1701 */
1702 __nullable CF_RETURNS_RETAINED
1703 SecPolicyRef SecPolicyCreateDemoDigitalCatalogSigning(void)
1704 __OSX_AVAILABLE(10.13.4) __IOS_AVAILABLE(11.3) __TVOS_AVAILABLE(11.3) __WATCHOS_AVAILABLE(4.3);
1705
1706 /*!
1707 @function SecPolicyCreateAppleAssetReceipt
1708 @abstract Returns a policy object for evaluating certificate chains for signing Asset Receipts
1709 @discussion This policy uses the Basic X.509 policy with no validity check
1710 and pinning options:
1711 * The chain is anchored to any of the production Apple Root CAs. Internal releases allow
1712 the chain to be anchored to Test Apple Root CAs if a defaults write for the policy is set.
1713 * There are exactly 3 certs in the chain.
1714 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.10.
1715 * The leaf has a marker extension with OID 1.2.840.113635.100.6.61.
1716 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1717 @result A policy object. The caller is responsible for calling CFRelease
1718 on this when it is no longer needed.
1719 */
1720 __nullable CF_RETURNS_RETAINED
1721 SecPolicyRef SecPolicyCreateAppleAssetReceipt(void)
1722 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0));
1723
1724 /*!
1725 @function SecPolicyCreateAppleDeveloperIDPlustTicket
1726 @abstract Returns a policy object for evaluating certificate chains for signing Developer ID+ Tickets
1727 @discussion This policy uses the Basic X.509 policy with no validity check
1728 and pinning options:
1729 * The chain is anchored to any of the production Apple Root CAs.
1730 * There are exactly 3 certs in the chain.
1731 * The intermediate has a marker extension with OID 1.2.840.113635.100.6.2.17.
1732 * The leaf has a marker extension with OID 1.2.840.113635.100.6.1.30.
1733 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1734 @result A policy object. The caller is responsible for calling CFRelease
1735 on this when it is no longer needed.
1736 */
1737 __nullable CF_RETURNS_RETAINED
1738 SecPolicyRef SecPolicyCreateAppleDeveloperIDPlusTicket(void)
1739 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0));
1740
1741 /*!
1742 @function SecPolicyCreateiAPSWAuthWithExpiration
1743 @abstract Returns a policy object for verifying iAP Software Auth certificates
1744 @param checkExpiration Determines whether the policy checks expiration on the certificates
1745 @discussion The resulting policy uses the Basic X.509 policy and pinning options:
1746 * There are exactly 2 certs in the chain.
1747 * The leaf has a marker extension with OID 1.2.840.113635.100.6.59.1
1748 The intended use of this policy is that the caller pass in the
1749 SW Auth root to SecTrustSetAnchorCertificates().
1750 @result A policy object. The caller is responsible for calling CFRelease on this when
1751 it is no longer needed.
1752 */
1753 __nullable CF_RETURNS_RETAINED
1754 SecPolicyRef SecPolicyCreateiAPSWAuthWithExpiration(bool checkExpiration)
1755 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0));
1756
1757 /*!
1758 @function SecPolicyCreateAppleFDRProvisioning
1759 @abstract Returns a policy object for verifying FDR Provisioning certificates
1760 @discussion The resulting policy uses the Basic X.509 policy with no validity check.
1761 The intended use of this policy is that the caller pass in the FDR root to SecTrustSetAnchorCertificates().
1762 @result A policy object. The caller is responsible for calling CFRelease on this when
1763 it is no longer needed.
1764 */
1765 __nullable CF_RETURNS_RETAINED
1766 SecPolicyRef SecPolicyCreateAppleFDRProvisioning(void)
1767 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0));
1768
1769 /*!
1770 @function SecPolicyCreateAppleComponentCertificate
1771 @abstract Returns a policy object for verifying Component certs
1772 @param testRootHash Optional; The SHA-256 fingerprint of a test root for pinning.
1773 @discussion The resulting policy uses the Basic X.509 policy with validity check and
1774 pinning options:
1775 * The chain is anchored to the Component Root CA.
1776 * There are exactly 3 certs in the chain.
1777 * The leaf and intermediate each have a marker extension with OID matching 1.2.840.113635.100.11.1
1778 @result A policy object. The caller is responsible for calling CFRelease on this when
1779 it is no longer needed.
1780 */
1781 __nullable CF_RETURNS_RETAINED
1782 SecPolicyRef SecPolicyCreateAppleComponentCertificate(CFDataRef __nullable testRootHash)
1783 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
1784
1785 /*!
1786 @function SecPolicyCreateAppleKeyTransparency
1787 @abstract Returns a policy object for verifying Apple certificates.
1788 @param applicationId A string that identifies the applicationId.
1789 @discussion The resulting policy uses the Basic X.509 policy with no validity check and
1790 pinning options:
1791 * The chain is anchored to any of the production Apple Root CAs.
1792 * There are exactly 3 certs in the chain.
1793 * The intermediate has a marker extension with OID TBD.
1794 * The leaf has a marker extension with OID 1.2.840.113635.100.6.69.1 and value
1795 matching the applicationId.
1796 * Revocation is checked via any available method.
1797 * RSA key sizes are 2048-bit or larger. EC key sizes are P-256 or larger.
1798 @result A policy object. The caller is responsible for calling CFRelease on this when
1799 it is no longer needed.
1800 */
1801 __nullable CF_RETURNS_RETAINED
1802 SecPolicyRef SecPolicyCreateAppleKeyTransparency(CFStringRef applicationId)
1803 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
1804
1805 /*!
1806 @function SecPolicyCreateLegacySSL
1807 @abstract Returns a policy object for evaluating legacy SSL certificate chains that don't meet
1808 SecPolicyCreateSSL.
1809 @param server Passing true for this parameter creates a policy for SSL
1810 server certificates.
1811 @param hostname (Optional) If present, the policy will require the specified
1812 hostname to match the hostname in the leaf certificate.
1813 @result A policy object. The caller is responsible for calling CFRelease
1814 on this when it is no longer needed.
1815 @discussion Use of this policy will be audited. Passing false for the server parameter will
1816 result in a SecPolicy object with the same requirements as SecPolicyCreateSSL with a false
1817 server parameter (i.e. the client authentication verification performed by this policy is
1818 identical to the client authentication verification performed by SecPolicyCreateSSL).
1819 */
1820 __nullable CF_RETURNS_RETAINED
1821 SecPolicyRef SecPolicyCreateLegacySSL(Boolean server, CFStringRef __nullable hostname)
1822 SPI_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
1823
1824 /*
1825 * Legacy functions (OS X only)
1826 */
1827 #if TARGET_OS_OSX
1828
1829 /*!
1830 @function SecPolicyCopy
1831 @abstract Returns a copy of a policy reference based on certificate type and OID.
1832 @param certificateType A certificate type.
1833 @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.
1834 @param policy The returned policy reference. This is a required parameter.
1835 @result A result code. See "Security Error Codes" (SecBase.h).
1836 @discussion This function is deprecated in Mac OS X 10.7 and later;
1837 to obtain a policy reference, use one of the SecPolicyCreate* functions in SecPolicy.h.
1838 */
1839 OSStatus SecPolicyCopy(CSSM_CERT_TYPE certificateType, const CSSM_OID *policyOID, SecPolicyRef * __nonnull CF_RETURNS_RETAINED policy)
1840 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
1841
1842 /*!
1843 @function SecPolicyCopyAll
1844 @abstract Returns an array of all known policies based on certificate type.
1845 @param certificateType A certificate type. This is a optional parameter. Pass CSSM_CERT_UNKNOWN if the certificate type is unknown.
1846 @param policies The returned array of policies. This is a required parameter.
1847 @result A result code. See "Security Error Codes" (SecBase.h).
1848 @discussion This function is deprecated in Mac OS X 10.7 and later;
1849 to obtain a policy reference, use one of the SecPolicyCreate* functions in SecPolicy.h. (Note: there is normally
1850 no reason to iterate over multiple disjointed policies, except to provide a way to edit trust settings for each
1851 policy, as is done in certain certificate UI views. In that specific case, your code should call SecPolicyCreateWithOID
1852 for each desired policy from the list of supported OID constants in SecPolicy.h.)
1853 */
1854 OSStatus SecPolicyCopyAll(CSSM_CERT_TYPE certificateType, CFArrayRef * __nonnull CF_RETURNS_RETAINED policies)
1855 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
1856
1857 /* Given a unified SecPolicyRef, return a copy with a legacy
1858 C++ ItemImpl-based Policy instance. Only for internal use;
1859 legacy references cannot be used by SecPolicy API functions. */
1860 __nullable CF_RETURNS_RETAINED
1861 SecPolicyRef SecPolicyCreateItemImplInstance(SecPolicyRef policy);
1862
1863 /* Given a CSSM_OID pointer, return a string which can be passed
1864 to SecPolicyCreateWithProperties. The return value can be NULL
1865 if no supported policy was found for the OID argument. */
1866 __nullable
1867 CFStringRef SecPolicyGetStringForOID(CSSM_OID* oid)
1868 API_DEPRECATED("No longer supported", macos(10.5,10.14));
1869
1870 /*!
1871 @function SecPolicyCreateAppleTimeStampingAndRevocationPolicies
1872 @abstract Create timeStamping policy array from a given set of policies by applying identical revocation behavior
1873 @param policyOrArray can be a SecPolicyRef or a CFArray of SecPolicyRef
1874 @discussion This function is deprecated in macOS 10.13 and later. Your code should call SecPolicyCreateAppleTimeStamping
1875 and SecPolicyCreateRevocation instead to obtain these policies, then insert them into an array as needed.
1876 */
1877 __nullable CF_RETURNS_RETAINED
1878 CFArrayRef SecPolicyCreateAppleTimeStampingAndRevocationPolicies(CFTypeRef policyOrArray)
1879 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_13, __IPHONE_NA, __IPHONE_NA);
1880
1881 #endif /* TARGET_OS_MAC && !TARGET_OS_IPHONE */
1882
1883 /* MARK: WARNING: The following constants and functions are for project use
1884 * within the Security project and are subject to change without warning */
1885
1886 /*!
1887 @enum Policy Check Keys
1888 @discussion Keys that represent various checks that can be done in a trust
1889 policy. Use outside of the Security project at your own peril.
1890 */
1891 extern const CFStringRef kSecPolicyCheckAnchorApple;
1892 extern const CFStringRef kSecPolicyCheckAnchorSHA1;
1893 extern const CFStringRef kSecPolicyCheckAnchorSHA256;
1894 extern const CFStringRef kSecPolicyCheckAnchorTrusted;
1895 extern const CFStringRef kSecPolicyCheckBasicCertificateProcessing;
1896 extern const CFStringRef kSecPolicyCheckBasicConstraints;
1897 extern const CFStringRef kSecPolicyCheckBasicConstraintsCA;
1898 extern const CFStringRef kSecPolicyCheckBasicConstraintsPathLen;
1899 extern const CFStringRef kSecPolicyCheckBlackListedKey;
1900 extern const CFStringRef kSecPolicyCheckBlackListedLeaf;
1901 extern const CFStringRef kSecPolicyCheckCertificatePolicy;
1902 extern const CFStringRef kSecPolicyCheckChainLength;
1903 extern const CFStringRef kSecPolicyCheckCriticalExtensions;
1904 extern const CFStringRef kSecPolicyCheckCTRequired;
1905 extern const CFStringRef kSecPolicyCheckEAPTrustedServerNames;
1906 extern const CFStringRef kSecPolicyCheckEmail;
1907 extern const CFStringRef kSecPolicyCheckExtendedKeyUsage;
1908 extern const CFStringRef kSecPolicyCheckExtendedValidation;
1909 extern const CFStringRef kSecPolicyCheckGrayListedKey;
1910 extern const CFStringRef kSecPolicyCheckGrayListedLeaf;
1911 extern const CFStringRef kSecPolicyCheckIdLinkage;
1912 extern const CFStringRef kSecPolicyCheckIntermediateCountry;
1913 extern const CFStringRef kSecPolicyCheckIntermediateEKU;
1914 extern const CFStringRef kSecPolicyCheckIntermediateMarkerOid;
1915 extern const CFStringRef kSecPolicyCheckIntermediateMarkerOidWithoutValueCheck;
1916 extern const CFStringRef kSecPolicyCheckIntermediateOrganization;
1917 extern const CFStringRef kSecPolicyCheckIntermediateSPKISHA256;
1918 extern const CFStringRef kSecPolicyCheckIssuerCommonName;
1919 extern const CFStringRef kSecPolicyCheckIssuerPolicyConstraints;
1920 extern const CFStringRef kSecPolicyCheckIssuerNameConstraints;
1921 extern const CFStringRef kSecPolicyCheckKeySize;
1922 extern const CFStringRef kSecPolicyCheckKeyUsage;
1923 extern const CFStringRef kSecPolicyCheckLeafMarkerOid;
1924 extern const CFStringRef kSecPolicyCheckLeafMarkerOidWithoutValueCheck;
1925 extern const CFStringRef kSecPolicyCheckLeafMarkersProdAndQA;
1926 extern const CFStringRef kSecPolicyCheckMissingIntermediate;
1927 extern const CFStringRef kSecPolicyCheckNameConstraints;
1928 extern const CFStringRef kSecPolicyCheckNoNetworkAccess;
1929 extern const CFStringRef kSecPolicyCheckNonEmptySubject;
1930 extern const CFStringRef kSecPolicyCheckNotValidBefore;
1931 extern const CFStringRef kSecPolicyCheckPinningRequired;
1932 extern const CFStringRef kSecPolicyCheckPolicyConstraints;
1933 extern const CFStringRef kSecPolicyCheckRevocation;
1934 extern const CFStringRef kSecPolicyCheckRevocationIfTrusted;
1935 extern const CFStringRef kSecPolicyCheckRevocationOnline;
1936 extern const CFStringRef kSecPolicyCheckRevocationResponseRequired;
1937 extern const CFStringRef kSecPolicyCheckSSLHostname;
1938 extern const CFStringRef kSecPolicyCheckServerAuthEKU;
1939 extern const CFStringRef kSecPolicyCheckSignatureHashAlgorithms;
1940 extern const CFStringRef kSecPolicyCheckSubjectCommonName;
1941 extern const CFStringRef kSecPolicyCheckSubjectCommonNamePrefix;
1942 extern const CFStringRef kSecPolicyCheckSubjectCommonNameTEST;
1943 extern const CFStringRef kSecPolicyCheckSubjectOrganization;
1944 extern const CFStringRef kSecPolicyCheckSubjectOrganizationalUnit;
1945 extern const CFStringRef kSecPolicyCheckSystemTrustedCTRequired;
1946 extern const CFStringRef kSecPolicyCheckSystemTrustedWeakHash;
1947 extern const CFStringRef kSecPolicyCheckSystemTrustedWeakKey;
1948 extern const CFStringRef kSecPolicyCheckTemporalValidity;
1949 extern const CFStringRef kSecPolicyCheckUnparseableExtension;
1950 extern const CFStringRef kSecPolicyCheckUsageConstraints;
1951 extern const CFStringRef kSecPolicyCheckValidityPeriodMaximums;
1952 extern const CFStringRef kSecPolicyCheckValidRoot;
1953 extern const CFStringRef kSecPolicyCheckWeakKeySize;
1954 extern const CFStringRef kSecPolicyCheckWeakSignature;
1955
1956 /* Special option for checking Apple Anchors */
1957 extern const CFStringRef kSecPolicyAppleAnchorIncludeTestRoots;
1958
1959 /* Special option for checking Prod and QA Markers */
1960 extern const CFStringRef kSecPolicyLeafMarkerProd;
1961 extern const CFStringRef kSecPolicyLeafMarkerQA;
1962
1963 /* Special option for checking Revocation */
1964 extern const CFStringRef kSecPolicyCheckRevocationOCSP;
1965 extern const CFStringRef kSecPolicyCheckRevocationCRL;
1966 extern const CFStringRef kSecPolicyCheckRevocationAny;
1967
1968 /* Policy Names */
1969 extern const CFStringRef kSecPolicyNameX509Basic;
1970 extern const CFStringRef kSecPolicyNameSSLServer;
1971 extern const CFStringRef kSecPolicyNameSSLClient;
1972 extern const CFStringRef kSecPolicyNameEAPServer;
1973 extern const CFStringRef kSecPolicyNameEAPClient;
1974 extern const CFStringRef kSecPolicyNameIPSecServer;
1975 extern const CFStringRef kSecPolicyNameIPSecClient;
1976 extern const CFStringRef kSecPolicyNameSMIME;
1977 extern const CFStringRef kSecPolicyNameCodeSigning;
1978 extern const CFStringRef kSecPolicyNameTimeStamping;
1979 extern const CFStringRef kSecPolicyNameOCSPSigner;
1980
1981 /*
1982 * MARK: SecPolicyCheckCert functions
1983 */
1984 bool SecPolicyCheckCertSSLHostname(SecCertificateRef cert, CFTypeRef pvcValue);
1985 bool SecPolicyCheckCertEmail(SecCertificateRef cert, CFTypeRef pvcValue);
1986 bool SecPolicyCheckCertTemporalValidity(SecCertificateRef cert, CFTypeRef pvcValue);
1987 bool SecPolicyCheckCertWeakKeySize(SecCertificateRef cert, CFTypeRef __nullable pvcValue);
1988 bool SecPolicyCheckCertKeyUsage(SecCertificateRef cert, CFTypeRef pvcValue);
1989 bool SecPolicyCheckCertExtendedKeyUsage(SecCertificateRef cert, CFTypeRef pvcValue);
1990 bool SecPolicyCheckCertSubjectCommonName(SecCertificateRef cert, CFTypeRef pvcValue);
1991 bool SecPolicyCheckCertSubjectCommonNamePrefix(SecCertificateRef cert, CFTypeRef pvcValue);
1992 bool SecPolicyCheckCertSubjectCommonNameTEST(SecCertificateRef cert, CFTypeRef pvcValue);
1993 bool SecPolicyCheckCertSubjectOrganization(SecCertificateRef cert, CFTypeRef pvcValue);
1994 bool SecPolicyCheckCertSubjectOrganizationalUnit(SecCertificateRef cert, CFTypeRef pvcValue);
1995 bool SecPolicyCheckCertNotValidBefore(SecCertificateRef cert, CFTypeRef pvcValue);
1996 bool SecPolicyCheckCertEAPTrustedServerNames(SecCertificateRef cert, CFTypeRef pvcValue);
1997 bool SecPolicyCheckCertLeafMarkerOid(SecCertificateRef cert, CFTypeRef pvcValue);
1998 bool SecPolicyCheckCertLeafMarkerOidWithoutValueCheck(SecCertificateRef cert, CFTypeRef pvcValue);
1999 bool SecPolicyCheckCertLeafMarkersProdAndQA(SecCertificateRef cert, CFTypeRef pvcValue);
2000 bool SecPolicyCheckCertNonEmptySubject(SecCertificateRef cert, CFTypeRef __nullable pvcValue);
2001 bool SecPolicyCheckCertKeySize(SecCertificateRef cert, CFTypeRef pvcValue);
2002 bool SecPolicyCheckCertWeakSignature(SecCertificateRef cert, CFTypeRef __nullable pvcValue);
2003 bool SecPolicyCheckCertSignatureHashAlgorithms(SecCertificateRef cert, CFTypeRef pvcValue);
2004 bool SecPolicyCheckCertCertificatePolicy(SecCertificateRef cert, CFTypeRef pvcValue);
2005 bool SecPolicyCheckCertCriticalExtensions(SecCertificateRef cert, CFTypeRef __nullable pvcValue);
2006 bool SecPolicyCheckCertSubjectCountry(SecCertificateRef cert, CFTypeRef pvcValue);
2007 bool SecPolicyCheckCertUnparseableExtension(SecCertificateRef cert, CFTypeRef pvcValue);
2008
2009 void SecPolicySetName(SecPolicyRef policy, CFStringRef policyName);
2010 __nullable CFArrayRef SecPolicyXPCArrayCopyArray(xpc_object_t xpc_policies, CFErrorRef *error);
2011
2012 void SecPolicySetOptionsValue(SecPolicyRef policy, CFStringRef key, CFTypeRef value);
2013
2014 bool SecDNSIsTLD(CFStringRef reference);
2015
2016 CF_IMPLICIT_BRIDGING_DISABLED
2017 CF_ASSUME_NONNULL_END
2018
2019 __END_DECLS
2020
2021 #endif /* !_SECURITY_SECPOLICYPRIV_H_ */