2 * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
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
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.
20 The functions provided in SecACL are for managing entries in the access control list.
23 #ifndef _SECURITY_SECACL_H_
24 #define _SECURITY_SECACL_H_
26 #include <Security/SecBase.h>
27 #include <Security/cssmtype.h>
28 #include <Security/cssmapple.h>
29 #include <CoreFoundation/CoreFoundation.h>
32 #if defined(__cplusplus)
37 @function SecACLGetTypeID
38 @abstract Returns the type identifier of SecACL instances.
39 @result The CFTypeID of SecACL instances.
41 CFTypeID
SecACLGetTypeID(void);
44 @function SecACLCreateFromSimpleContents
45 @abstract Creates a new access control list entry from the application list, description, and prompt selector provided and adds it to an item's access.
46 @param access An access reference.
47 @param applicationList An array of SecTrustedApplication instances that will be allowed access without prompting.
48 @param description The human readable name that will be used to refer to this item when the user is prompted.
49 @param promptSelector A pointer to a CSSM prompt selector.
50 @param newAcl A pointer to an access control list entry. On return, this points to the reference of the new access control list entry.
51 @result A result code. See "Security Error Codes" (SecBase.h).
53 OSStatus
SecACLCreateFromSimpleContents(SecAccessRef access
,
54 CFArrayRef applicationList
,
55 CFStringRef description
, const CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR
*promptSelector
,
59 @function SecACLRemove
60 @abstract Removes the access control list entry specified.
61 @param aclRef The reference to the access control list entry to remove.
62 @result A result code. See "Security Error Codes" (SecBase.h).
64 OSStatus
SecACLRemove(SecACLRef aclRef
);
67 @function SecACLGetSimpleContents
68 @abstract Returns the application list, description, and CSSM prompt selector for a given access control list entry.
69 @param acl An access control list entry reference.
70 @param applicationList On return, An array of SecTrustedApplication instances that will be allowed access without prompting, for the given access control list entry. The caller needs to call CFRelease on this array when it's no longer needed.
71 @param description On return, the human readable name that will be used to refer to this item when the user is prompted, for the given access control list entry. The caller needs to call CFRelease on this string when it's no longer needed.
72 @param promptSelector A pointer to a CSSM prompt selector. On return, this points to the CSSM prompt selector for the given access control list entry.
73 @result A result code. See "Security Error Codes" (SecBase.h).
75 OSStatus
SecACLCopySimpleContents(SecACLRef acl
,
76 CFArrayRef
*applicationList
,
77 CFStringRef
*description
, CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR
*promptSelector
);
80 @function SecACLSetSimpleContents
81 @abstract Sets the application list, description, and CSSM prompt selector for a given access control list entry.
82 @param acl A reference to the access control list entry to edit.
83 @param applicationList An application list reference.
84 @param description The human readable name that will be used to refer to this item when the user is prompted.
85 @param promptSelector A pointer to a CSSM prompt selector.
86 @result A result code. See "Security Error Codes" (SecBase.h).
88 OSStatus
SecACLSetSimpleContents(SecACLRef acl
,
89 CFArrayRef applicationList
,
90 CFStringRef description
, const CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR
*promptSelector
);
93 @function SecACLGetAuthorizations
94 @abstract Retrieve the CSSM authorization tags of a given access control list entry.
95 @param acl An access control list entry reference.
96 @param tags On return, this points to the first item in an array of CSSM authorization tags.
97 @param tagCount On return, this points to the number of tags in the CSSM authorization tag array.
98 @result A result code. See "Security Error Codes" (SecBase.h).
100 OSStatus
SecACLGetAuthorizations(SecACLRef acl
,
101 CSSM_ACL_AUTHORIZATION_TAG
*tags
, uint32
*tagCount
);
104 @function SecACLSetAuthorizations
105 @abstract Sets the CSSM authorization tags of a given access control list entry.
106 @param acl An access control list entry reference.
107 @param tags A pointer to the first item in an array of CSSM authorization tags.
108 @param tagCount The number of tags in the CSSM authorization tag array.
109 @result A result code. See "Security Error Codes" (SecBase.h).
111 OSStatus
SecACLSetAuthorizations(SecACLRef acl
,
112 CSSM_ACL_AUTHORIZATION_TAG
*tags
, uint32 tagCount
);
115 #if defined(__cplusplus)
119 #endif /* !_SECURITY_SECACL_H_ */