2 * Copyright (c) 2000-2004 Apple Computer, 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@
26 // acl_keychain - a subject type for the protected-path
27 // keychain prompt interaction model.
32 #include <security_cdsa_utilities/cssmacl.h>
33 #include <security_agent_client/agentclient.h>
38 // This is the actual subject implementation class
40 class KeychainPromptAclSubject
: public SimpleAclSubject
{
41 static const Version pumaVersion
= 0; // 10.0, 10.1 -> default selector (not stored)
42 static const Version jaguarVersion
= 1; // 10.2 et al -> first version selector
44 bool validate(const AclValidationContext
&baseCtx
, const TypedList
&sample
) const;
45 CssmList
toList(Allocator
&alloc
) const;
47 KeychainPromptAclSubject(string description
, const CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR
&selector
);
49 void exportBlob(Writer::Counter
&pub
, Writer::Counter
&priv
);
50 void exportBlob(Writer
&pub
, Writer
&priv
);
52 IFDUMP(void debugDump() const);
54 class Maker
: public AclSubject::Maker
{
56 Maker(CSSM_ACL_SUBJECT_TYPE type
= CSSM_ACL_SUBJECT_TYPE_KEYCHAIN_PROMPT
)
57 : AclSubject::Maker(type
) { }
58 KeychainPromptAclSubject
*make(const TypedList
&list
) const;
59 KeychainPromptAclSubject
*make(Version version
, Reader
&pub
, Reader
&priv
) const;
63 CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR selector
; // selector structure
64 string description
; // description blob (string)
67 static CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR defaultSelector
;
69 typedef uint32 VersionMarker
;
70 static const VersionMarker currentVersion
= 0x3BD5910D;
72 bool isLegacyCompatible() const;
76 #endif //_ACL_KEYCHAIN