2 * Copyright (c) 2002-2008, 2010-2013 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
25 #ifndef _DY_FRAMEWORK_H
26 #define _DY_FRAMEWORK_H
28 #include <Availability.h>
29 #include <TargetConditionals.h>
30 #include <sys/cdefs.h>
31 #include <mach/mach.h>
32 #include <CoreFoundation/CoreFoundation.h>
33 #include <IOKit/IOKitLib.h>
34 #include <Security/Security.h>
35 #include <Security/SecCertificatePriv.h>
36 #include <Security/SecItem.h> // only needed for Mac OS X 10.6[.x]
41 #pragma mark IOKit.framework APIs
43 CFMutableDictionaryRef
45 mach_port_t masterPort
,
49 #define IOBSDNameMatching _IOBSDNameMatching
53 io_iterator_t iterator
55 #define IOIteratorNext _IOIteratorNext
59 mach_port_t bootstrapPort
,
60 mach_port_t
*masterPort
62 #define IOMasterPort _IOMasterPort
67 const io_name_t className
69 #define IOObjectConformsTo _IOObjectConformsTo
76 #define IOObjectGetClass _IOObjectGetClass
82 #define IOObjectRelease _IOObjectRelease
85 _IORegistryEntryCreateCFProperty (
86 io_registry_entry_t entry
,
88 CFAllocatorRef allocator
,
91 #define IORegistryEntryCreateCFProperty _IORegistryEntryCreateCFProperty
94 _IORegistryEntryCreateCFProperties (
95 io_registry_entry_t entry
,
96 CFMutableDictionaryRef
*properties
,
97 CFAllocatorRef allocator
,
100 #define IORegistryEntryCreateCFProperties _IORegistryEntryCreateCFProperties
103 _IORegistryEntryCreateIterator (
104 io_registry_entry_t entry
,
105 const io_name_t plane
,
106 IOOptionBits options
,
107 io_iterator_t
*iterator
109 #define IORegistryEntryCreateIterator _IORegistryEntryCreateIterator
112 _IORegistryEntryGetLocationInPlane (
113 io_registry_entry_t entry
,
114 const io_name_t plane
,
117 #define IORegistryEntryGetLocationInPlane _IORegistryEntryGetLocationInPlane
120 _IORegistryEntryGetName (
121 io_registry_entry_t entry
,
124 #define IORegistryEntryGetName _IORegistryEntryGetName
127 _IORegistryEntryGetNameInPlane (
128 io_registry_entry_t entry
,
129 const io_name_t plane
,
132 #define IORegistryEntryGetNameInPlane _IORegistryEntryGetNameInPlane
135 _IORegistryEntryGetParentEntry (
136 io_registry_entry_t entry
,
137 const io_name_t plane
,
138 io_registry_entry_t
*parent
140 #define IORegistryEntryGetParentEntry _IORegistryEntryGetParentEntry
143 _IORegistryEntryGetPath (
144 io_registry_entry_t entry
,
145 const io_name_t plane
,
148 #define IORegistryEntryGetPath _IORegistryEntryGetPath
151 _IORegistryEntryGetRegistryEntryID (
152 io_registry_entry_t entry
,
155 #define IORegistryEntryGetRegistryEntryID _IORegistryEntryGetRegistryEntryID
158 _IORegistryEntrySearchCFProperty (
159 io_registry_entry_t entry
,
160 const io_name_t plane
,
162 CFAllocatorRef allocator
,
164 ) CF_RETURNS_RETAINED
;
165 #define IORegistryEntrySearchCFProperty _IORegistryEntrySearchCFProperty
168 _IOServiceGetMatchingServices (
169 mach_port_t masterPort
,
170 CFDictionaryRef matching
,
171 io_iterator_t
*existing
173 #define IOServiceGetMatchingServices _IOServiceGetMatchingServices
175 CFMutableDictionaryRef
179 #define IOServiceMatching _IOServiceMatching
182 #pragma mark Security.framework APIs
184 #if !TARGET_OS_IPHONE
186 CFTypeRef
_kSecAttrService();
187 #define kSecAttrService _kSecAttrService()
189 CFTypeRef
_kSecClass();
190 #define kSecClass _kSecClass()
192 CFTypeRef
_kSecClassGenericPassword();
193 #define kSecClassGenericPassword _kSecClassGenericPassword()
195 CFTypeRef
_kSecMatchLimit();
196 #define kSecMatchLimit _kSecMatchLimit()
198 CFTypeRef
_kSecMatchLimitAll();
199 #define kSecMatchLimitAll _kSecMatchLimitAll()
201 CFTypeRef
_kSecMatchSearchList();
202 #define kSecMatchSearchList _kSecMatchSearchList()
204 CFTypeRef
_kSecReturnRef();
205 #define kSecReturnRef _kSecReturnRef()
207 CFTypeRef
_kSecGuestAttributePid();
208 #define kSecGuestAttributePid _kSecGuestAttributePid()
210 CFTypeRef
_kSecCodeInfoIdentifier();
211 #define kSecCodeInfoIdentifier _kSecCodeInfoIdentifier()
213 CFTypeRef
_kSecCodeInfoUnique();
214 #define kSecCodeInfoUnique _kSecCodeInfoUnique()
217 _AuthorizationMakeExternalForm (
218 AuthorizationRef authorization
,
219 AuthorizationExternalForm
*extForm
221 #define AuthorizationMakeExternalForm _AuthorizationMakeExternalForm
225 CFStringRef descriptor
,
226 CFArrayRef trustedlist
,
227 SecAccessRef
*accessRef
229 #define SecAccessCreate _SecAccessCreate
231 #if (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
233 _SecAccessCreateFromOwnerAndACL (
234 const CSSM_ACL_OWNER_PROTOTYPE
*owner
,
236 const CSSM_ACL_ENTRY_INFO
*acls
,
237 SecAccessRef
*accessRef
239 #define SecAccessCreateFromOwnerAndACL _SecAccessCreateFromOwnerAndACL
240 #else // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
242 _SecAccessCreateWithOwnerAndACL (
245 SecAccessOwnerType ownerType
,
249 #define SecAccessCreateWithOwnerAndACL _SecAccessCreateWithOwnerAndACL
250 #endif // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
253 _SecItemCopyMatching (
254 CFDictionaryRef query
,
257 #define SecItemCopyMatching _SecItemCopyMatching
260 _SecKeychainCopyDomainDefault (
261 SecPreferencesDomain domain
,
262 SecKeychainRef
*keychain
264 #define SecKeychainCopyDomainDefault _SecKeychainCopyDomainDefault
267 _SecKeychainGetPreferenceDomain (
268 SecPreferencesDomain
*domain
270 #define SecKeychainGetPreferenceDomain _SecKeychainGetPreferenceDomain
274 const char *pathName
,
275 SecKeychainRef
*keychain
277 #define SecKeychainOpen _SecKeychainOpen
280 _SecKeychainSetDomainDefault (
281 SecPreferencesDomain domain
,
282 SecKeychainRef keychain
284 #define SecKeychainSetDomainDefault _SecKeychainSetDomainDefault
287 _SecKeychainSetPreferenceDomain (
288 SecPreferencesDomain domain
290 #define SecKeychainSetPreferenceDomain _SecKeychainSetPreferenceDomain
293 _SecKeychainItemCopyContent (
294 SecKeychainItemRef itemRef
,
295 SecItemClass
*itemClass
,
296 SecKeychainAttributeList
*attrList
,
300 #define SecKeychainItemCopyContent _SecKeychainItemCopyContent
303 _SecKeychainItemCreateFromContent (
304 SecItemClass itemClass
,
305 SecKeychainAttributeList
*attrList
,
308 SecKeychainRef keychainRef
,
309 SecAccessRef initialAccess
,
310 SecKeychainItemRef
*itemRef
312 #define SecKeychainItemCreateFromContent _SecKeychainItemCreateFromContent
315 _SecKeychainItemDelete (
316 SecKeychainItemRef itemRef
318 #define SecKeychainItemDelete _SecKeychainItemDelete
321 _SecKeychainItemFreeContent (
322 SecKeychainAttributeList
*attrList
,
325 #define SecKeychainItemFreeContent _SecKeychainItemFreeContent
328 _SecKeychainItemModifyContent (
329 SecKeychainItemRef itemRef
,
330 const SecKeychainAttributeList
*attrList
,
334 #define SecKeychainItemModifyContent _SecKeychainItemModifyContent
338 _SecTrustedApplicationCreateFromPath (
340 SecTrustedApplicationRef
*app
342 #define SecTrustedApplicationCreateFromPath _SecTrustedApplicationCreateFromPath
344 #else // TARGET_OS_IPHONE
346 CFStringRef
_kSecPropertyKeyValue();
347 #define kSecPropertyKeyValue _kSecPropertyKeyValue()
349 CFStringRef
_kSecPropertyKeyLabel();
350 #define kSecPropertyKeyLabel _kSecPropertyKeyLabel()
353 _SecCertificateCopyProperties (
354 SecCertificateRef certRef
356 #define SecCertificateCopyProperties _SecCertificateCopyProperties
358 #endif // TARGET_OS_IPHONE
361 _SecCertificateCreateWithData (
362 CFAllocatorRef allocator
,
365 #define SecCertificateCreateWithData _SecCertificateCreateWithData
371 #endif // _DY_FRAMEWORK_H