2 * Copyright (c) 2007-2009 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@
23 #ifndef _SECURITYD_CLIENT_H_
24 #define _SECURITYD_CLIENT_H_
27 #include <Security/SecTrustStore.h>
28 #include <CoreFoundation/CFArray.h>
29 #include <CoreFoundation/CFDictionary.h>
32 #define SECURITYSERVER_BOOTSTRAP_NAME "com.apple.secd"
34 #define SECURITYSERVER_BOOTSTRAP_NAME "com.apple.securityd"
35 #endif // *** END SECITEM_SHIM_OSX ***
37 #define SECURITYD(SPI, IN, OUT) (gSecurityd \
38 ? gSecurityd->SPI(IN, OUT) \
39 : ServerCommandSendReceive(SPI ## _id, IN, OUT))
41 #define SECURITYD_AG(SPI, IN, OUT) (gSecurityd \
42 ? gSecurityd->SPI(IN, OUT, SecAccessGroupsGetCurrent()) \
43 : ServerCommandSendReceive(SPI ## _id, IN, OUT))
47 sec_item_copy_matching_id
,
50 sec_trust_store_contains_id
,
51 sec_trust_store_set_trust_settings_id
,
52 sec_trust_store_remove_certificate_id
,
54 sec_trust_evaluate_id
,
55 sec_restore_keychain_id
,
56 sec_migrate_keychain_id
,
57 sec_keychain_backup_id
,
58 sec_keychain_restore_id
62 OSStatus (*sec_item_add
)(CFDictionaryRef attributes
, CFTypeRef
*result
,
63 CFArrayRef accessGroups
);
64 OSStatus (*sec_item_copy_matching
)(CFDictionaryRef query
,
65 CFTypeRef
*result
, CFArrayRef accessGroups
);
66 OSStatus (*sec_item_update
)(CFDictionaryRef query
,
67 CFDictionaryRef attributesToUpdate
, CFArrayRef accessGroups
);
68 OSStatus (*sec_item_delete
)(CFDictionaryRef query
, CFArrayRef accessGroups
);
69 SecTrustStoreRef (*sec_trust_store_for_domain
)(CFStringRef domainName
);
70 bool (*sec_trust_store_contains
)(SecTrustStoreRef ts
,
72 OSStatus (*sec_trust_store_set_trust_settings
)(SecTrustStoreRef ts
,
73 SecCertificateRef certificate
, CFTypeRef trustSettingsDictOrArray
);
74 OSStatus (*sec_trust_store_remove_certificate
)(SecTrustStoreRef ts
,
76 bool (*sec_truststore_remove_all
)(SecTrustStoreRef ts
);
77 bool (*sec_item_delete_all
)(void);
78 OSStatus (*sec_trust_evaluate
)(CFDictionaryRef args_in
,
80 OSStatus (*sec_restore_keychain
)(void);
81 OSStatus (*sec_migrate_keychain
)(CFArrayRef args_in
, CFTypeRef
*args_out
);
82 OSStatus (*sec_keychain_backup
)(CFArrayRef args_in
, CFTypeRef
*args_out
);
83 OSStatus (*sec_keychain_restore
)(CFArrayRef args_in
, CFTypeRef
*dummy
);
86 extern struct securityd
*gSecurityd
;
88 CFArrayRef
SecAccessGroupsGetCurrent(void);
89 void SecAccessGroupsSetCurrent(CFArrayRef accessGroups
);
91 OSStatus
ServerCommandSendReceive(uint32_t id
, CFTypeRef in
, CFTypeRef
*out
);
93 #endif /* _SECURITYD_CLIENT_H_ */