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