]> git.saurik.com Git - apple/security.git/blob - cdsa/cdsa_client/aclclient.h
Security-30.1.tar.gz
[apple/security.git] / cdsa / cdsa_client / aclclient.h
1 /*
2 * Copyright (c) 2000-2001 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 //
20 // keyclient
21 //
22 #ifndef _H_CDSA_CLIENT_ACLCLIENT
23 #define _H_CDSA_CLIENT_ACLCLIENT 1
24
25 #include <Security/cssmaclpod.h>
26 #include <Security/cssmcred.h>
27
28 namespace Security
29 {
30
31 namespace CssmClient
32 {
33
34 class CSP;
35
36 //
37 // AclClient -- abstract interface implemented by objects that can manipulate their acls
38 //
39 class AclClient
40 {
41 public:
42 // Acl manipulation
43 virtual void getAcl(const char *selectionTag, AutoAclEntryInfoList &aclInfos) const = 0;
44 virtual void changeAcl(const CSSM_ACCESS_CREDENTIALS *accessCred,
45 const CSSM_ACL_EDIT &aclEdit) = 0;
46
47 // Acl owner manipulation
48 virtual void getOwner(AutoAclOwnerPrototype &owner) const = 0;
49 virtual void changeOwner(const CSSM_ACCESS_CREDENTIALS *accessCred,
50 const CSSM_ACL_OWNER_PROTOTYPE &newOwner) = 0;
51
52 #if 0
53 // Create a random owner
54 static void makeRandomOwner(CSP &csp, AutoAclOwnerPrototype &owner, AutoCredentials &cred);
55 void setOwnerAndAcl(const AutoCredentials &cred, const AutoAclOwnerPrototype &newOwner,
56 uint32 numEntries, const CSSM_ACL_ENTRY_INFO *entries);
57 #endif
58 };
59
60
61 } // end namespace CssmClient
62
63 } // end namespace Security
64
65 #endif // _H_CDSA_CLIENT_ACLCLIENT