]> git.saurik.com Git - apple/security.git/blob - Keychain/SecAccessPriv.h
Security-176.tar.gz
[apple/security.git] / Keychain / SecAccessPriv.h
1 /*
2 * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18 /*!
19 @header SecAccessPriv
20 SecAccessPriv implements a way to set and manipulate access control rules and
21 restrictions on SecKeychainItems. The functions here are private.
22 */
23
24 #ifndef _SECURITY_SECACCESS_PRIV_H_
25 #define _SECURITY_SECACCESS_PRIV_H_
26
27 #include <Security/SecBase.h>
28 #include <Security/cssmtype.h>
29 #include <CoreFoundation/CFArray.h>
30
31
32 #if defined(__cplusplus)
33 extern "C" {
34 #endif
35
36 /*!
37 @function SecKeychainAddIToolsPassword
38 @abstract Creates a new iTools password using the access control list from iToolsTrustedApps.plist.
39 @param keychain A reference to the keychain to which to add the password. Pass NULL to add the password to the default keychain.
40 @param accountNameLength The length of the buffer pointed to by accountName.
41 @param accountName A pointer to a string containing the account name associated with this password.
42 @param passwordLength The length of the buffer pointed to by passwordData.
43 @param passwordData A pointer to a buffer containing the password data to be stored in the keychain.
44 @param itemRef On return, a reference to the new keychain item.
45 @result A result code. See "Security Error Codes" (SecBase.h).
46 @discussion The SecKeychainAddIToolsPassword function adds a new iTools password to the specified keychain with an ACL composed of a list of trusted applications. A required parameter to identify the password is the accountName, which is an application-defined string. The servicename will always be "iTools". SecKeychainAddIToolsPassword optionally returns a reference to the newly added item.
47 */
48
49 OSStatus SecKeychainAddIToolsPassword(SecKeychainRef keychain, UInt32 accountNameLength, const char *accountName,
50 UInt32 passwordLength, const void *passwordData, SecKeychainItemRef *itemRef);
51
52 #if defined(__cplusplus)
53 }
54 #endif
55
56 #endif /* !_SECURITY_SECACCESS_PRIV_H_ */