2 * Copyright (c) 2002-2008, 2010-2012 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()
208 _AuthorizationMakeExternalForm (
209 AuthorizationRef authorization
,
210 AuthorizationExternalForm
*extForm
212 #define AuthorizationMakeExternalForm _AuthorizationMakeExternalForm
216 CFStringRef descriptor
,
217 CFArrayRef trustedlist
,
218 SecAccessRef
*accessRef
220 #define SecAccessCreate _SecAccessCreate
222 #if (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
224 _SecAccessCreateFromOwnerAndACL (
225 const CSSM_ACL_OWNER_PROTOTYPE
*owner
,
227 const CSSM_ACL_ENTRY_INFO
*acls
,
228 SecAccessRef
*accessRef
230 #define SecAccessCreateFromOwnerAndACL _SecAccessCreateFromOwnerAndACL
231 #else // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
233 _SecAccessCreateWithOwnerAndACL (
236 SecAccessOwnerType ownerType
,
240 #define SecAccessCreateWithOwnerAndACL _SecAccessCreateWithOwnerAndACL
241 #endif // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
244 _SecItemCopyMatching (
245 CFDictionaryRef query
,
248 #define SecItemCopyMatching _SecItemCopyMatching
251 _SecKeychainCopyDomainDefault (
252 SecPreferencesDomain domain
,
253 SecKeychainRef
*keychain
255 #define SecKeychainCopyDomainDefault _SecKeychainCopyDomainDefault
258 _SecKeychainGetPreferenceDomain (
259 SecPreferencesDomain
*domain
261 #define SecKeychainGetPreferenceDomain _SecKeychainGetPreferenceDomain
265 const char *pathName
,
266 SecKeychainRef
*keychain
268 #define SecKeychainOpen _SecKeychainOpen
271 _SecKeychainSetDomainDefault (
272 SecPreferencesDomain domain
,
273 SecKeychainRef keychain
275 #define SecKeychainSetDomainDefault _SecKeychainSetDomainDefault
278 _SecKeychainSetPreferenceDomain (
279 SecPreferencesDomain domain
281 #define SecKeychainSetPreferenceDomain _SecKeychainSetPreferenceDomain
284 _SecKeychainItemCopyContent (
285 SecKeychainItemRef itemRef
,
286 SecItemClass
*itemClass
,
287 SecKeychainAttributeList
*attrList
,
291 #define SecKeychainItemCopyContent _SecKeychainItemCopyContent
294 _SecKeychainItemCreateFromContent (
295 SecItemClass itemClass
,
296 SecKeychainAttributeList
*attrList
,
299 SecKeychainRef keychainRef
,
300 SecAccessRef initialAccess
,
301 SecKeychainItemRef
*itemRef
303 #define SecKeychainItemCreateFromContent _SecKeychainItemCreateFromContent
306 _SecKeychainItemDelete (
307 SecKeychainItemRef itemRef
309 #define SecKeychainItemDelete _SecKeychainItemDelete
312 _SecKeychainItemFreeContent (
313 SecKeychainAttributeList
*attrList
,
316 #define SecKeychainItemFreeContent _SecKeychainItemFreeContent
319 _SecKeychainItemModifyContent (
320 SecKeychainItemRef itemRef
,
321 const SecKeychainAttributeList
*attrList
,
325 #define SecKeychainItemModifyContent _SecKeychainItemModifyContent
329 _SecTrustedApplicationCreateFromPath (
331 SecTrustedApplicationRef
*app
333 #define SecTrustedApplicationCreateFromPath _SecTrustedApplicationCreateFromPath
335 #else // TARGET_OS_IPHONE
337 CFStringRef
_kSecPropertyKeyValue();
338 #define kSecPropertyKeyValue _kSecPropertyKeyValue()
340 CFStringRef
_kSecPropertyKeyLabel();
341 #define kSecPropertyKeyLabel _kSecPropertyKeyLabel()
344 _SecCertificateCopyProperties (
345 SecCertificateRef certRef
347 #define SecCertificateCopyProperties _SecCertificateCopyProperties
349 #endif // TARGET_OS_IPHONE
352 _SecCertificateCreateWithData (
353 CFAllocatorRef allocator
,
356 #define SecCertificateCreateWithData _SecCertificateCreateWithData
360 #endif // _DY_FRAMEWORK_H