2 * Copyright (c) 2002-2008, 2010, 2011 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 _IORegistryEntryGetName (
113 io_registry_entry_t entry
,
116 #define IORegistryEntryGetName _IORegistryEntryGetName
119 _IORegistryEntryGetParentEntry (
120 io_registry_entry_t entry
,
121 const io_name_t plane
,
122 io_registry_entry_t
*parent
124 #define IORegistryEntryGetParentEntry _IORegistryEntryGetParentEntry
127 _IORegistryEntryGetPath (
128 io_registry_entry_t entry
,
129 const io_name_t plane
,
132 #define IORegistryEntryGetPath _IORegistryEntryGetPath
135 _IORegistryEntryGetRegistryEntryID (
136 io_registry_entry_t entry
,
139 #define IORegistryEntryGetRegistryEntryID _IORegistryEntryGetRegistryEntryID
142 _IORegistryEntrySearchCFProperty (
143 io_registry_entry_t entry
,
144 const io_name_t plane
,
146 CFAllocatorRef allocator
,
148 ) CF_RETURNS_RETAINED
;
149 #define IORegistryEntrySearchCFProperty _IORegistryEntrySearchCFProperty
152 _IOServiceGetMatchingServices (
153 mach_port_t masterPort
,
154 CFDictionaryRef matching
,
155 io_iterator_t
*existing
157 #define IOServiceGetMatchingServices _IOServiceGetMatchingServices
159 CFMutableDictionaryRef
163 #define IOServiceMatching _IOServiceMatching
166 #pragma mark Security.framework APIs
168 #if !TARGET_OS_IPHONE
170 CFTypeRef
_kSecAttrService();
171 #define kSecAttrService _kSecAttrService()
173 CFTypeRef
_kSecClass();
174 #define kSecClass _kSecClass()
176 CFTypeRef
_kSecClassGenericPassword();
177 #define kSecClassGenericPassword _kSecClassGenericPassword()
179 CFTypeRef
_kSecMatchLimit();
180 #define kSecMatchLimit _kSecMatchLimit()
182 CFTypeRef
_kSecMatchLimitAll();
183 #define kSecMatchLimitAll _kSecMatchLimitAll()
185 CFTypeRef
_kSecMatchSearchList();
186 #define kSecMatchSearchList _kSecMatchSearchList()
188 CFTypeRef
_kSecReturnRef();
189 #define kSecReturnRef _kSecReturnRef()
192 _AuthorizationMakeExternalForm (
193 AuthorizationRef authorization
,
194 AuthorizationExternalForm
*extForm
196 #define AuthorizationMakeExternalForm _AuthorizationMakeExternalForm
200 CFStringRef descriptor
,
201 CFArrayRef trustedlist
,
202 SecAccessRef
*accessRef
204 #define SecAccessCreate _SecAccessCreate
206 #if (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
208 _SecAccessCreateFromOwnerAndACL (
209 const CSSM_ACL_OWNER_PROTOTYPE
*owner
,
211 const CSSM_ACL_ENTRY_INFO
*acls
,
212 SecAccessRef
*accessRef
214 #define SecAccessCreateFromOwnerAndACL _SecAccessCreateFromOwnerAndACL
215 #else // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
217 _SecAccessCreateWithOwnerAndACL (
220 SecAccessOwnerType ownerType
,
224 #define SecAccessCreateWithOwnerAndACL _SecAccessCreateWithOwnerAndACL
225 #endif // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
228 _SecItemCopyMatching (
229 CFDictionaryRef query
,
232 #define SecItemCopyMatching _SecItemCopyMatching
235 _SecKeychainCopyDomainDefault (
236 SecPreferencesDomain domain
,
237 SecKeychainRef
*keychain
239 #define SecKeychainCopyDomainDefault _SecKeychainCopyDomainDefault
242 _SecKeychainGetPreferenceDomain (
243 SecPreferencesDomain
*domain
245 #define SecKeychainGetPreferenceDomain _SecKeychainGetPreferenceDomain
249 const char *pathName
,
250 SecKeychainRef
*keychain
252 #define SecKeychainOpen _SecKeychainOpen
255 _SecKeychainSetDomainDefault (
256 SecPreferencesDomain domain
,
257 SecKeychainRef keychain
259 #define SecKeychainSetDomainDefault _SecKeychainSetDomainDefault
262 _SecKeychainSetPreferenceDomain (
263 SecPreferencesDomain domain
265 #define SecKeychainSetPreferenceDomain _SecKeychainSetPreferenceDomain
268 _SecKeychainItemCopyContent (
269 SecKeychainItemRef itemRef
,
270 SecItemClass
*itemClass
,
271 SecKeychainAttributeList
*attrList
,
275 #define SecKeychainItemCopyContent _SecKeychainItemCopyContent
278 _SecKeychainItemCreateFromContent (
279 SecItemClass itemClass
,
280 SecKeychainAttributeList
*attrList
,
283 SecKeychainRef keychainRef
,
284 SecAccessRef initialAccess
,
285 SecKeychainItemRef
*itemRef
287 #define SecKeychainItemCreateFromContent _SecKeychainItemCreateFromContent
290 _SecKeychainItemDelete (
291 SecKeychainItemRef itemRef
293 #define SecKeychainItemDelete _SecKeychainItemDelete
296 _SecKeychainItemFreeContent (
297 SecKeychainAttributeList
*attrList
,
300 #define SecKeychainItemFreeContent _SecKeychainItemFreeContent
303 _SecKeychainItemModifyContent (
304 SecKeychainItemRef itemRef
,
305 const SecKeychainAttributeList
*attrList
,
309 #define SecKeychainItemModifyContent _SecKeychainItemModifyContent
313 _SecTrustedApplicationCreateFromPath (
315 SecTrustedApplicationRef
*app
317 #define SecTrustedApplicationCreateFromPath _SecTrustedApplicationCreateFromPath
319 #else // TARGET_OS_IPHONE
321 CFStringRef
_kSecPropertyKeyValue();
322 #define kSecPropertyKeyValue _kSecPropertyKeyValue()
324 CFStringRef
_kSecPropertyKeyLabel();
325 #define kSecPropertyKeyLabel _kSecPropertyKeyLabel()
328 _SecCertificateCopyProperties (
329 SecCertificateRef certRef
331 #define SecCertificateCopyProperties _SecCertificateCopyProperties
333 #endif // TARGET_OS_IPHONE
336 _SecCertificateCreateWithData (
337 CFAllocatorRef allocator
,
340 #define SecCertificateCreateWithData _SecCertificateCreateWithData
344 #endif // _DY_FRAMEWORK_H