SecItemServer+SWC.h
1 /* 2 * Copyright (c) 2007-2019 Apple Inc. All Rights Reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23 24 #include <TargetConditionals.h> 25 26 #if TARGET_OS_IOS && !TARGET_OS_BRIDGE 27 #include <CoreFoundation/CoreFoundation.h> 28 29 // Compatibility wrappers for SWC Objective-C interface. 30 typedef enum SecSWCFlags { 31 kSecSWCFlags_None = 0, 32 kSecSWCFlag_UserApproved = (1 << 0), 33 kSecSWCFlag_UserDenied = (1 << 1), 34 kSecSWCFlag_SiteApproved = (1 << 2), 35 kSecSWCFlag_SiteDenied = (1 << 3), 36 } SecSWCFlags; 37 38 extern SecSWCFlags _SecAppDomainApprovalStatus(CFStringRef appID, CFStringRef fqdn, CFErrorRef *error); 39 extern void _SecSetAppDomainApprovalStatus(CFStringRef appID, CFStringRef fqdn, CFBooleanRef approved); 40 41 extern CFTypeRef _SecCopyFQDNObjectFromString(CFStringRef entitlementValue); 42 extern CFStringRef _SecGetFQDNFromFQDNObject(CFTypeRef fqdnObject, SInt32 *outPort); 43 #if !TARGET_OS_SIMULATOR 44 extern bool _SecEntitlementContainsDomainForService(CFArrayRef domains, CFStringRef domain, SInt32 port); 45 #endif /* !TARGET_OS_SIMULATOR */ 46 #endif // TARGET_OS_IOS && !TARGET_OS_BRIDGE