]>
git.saurik.com Git - apple/security.git/blob - libsecurity_cdsa_client/lib/tpclient.h
2 * Copyright (c) 2000-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 // tpclient - client interface to CSSM TPs and their operations
22 #ifndef _H_CDSA_CLIENT_TPCLIENT
23 #define _H_CDSA_CLIENT_TPCLIENT 1
25 #include <security_cdsa_client/cssmclient.h>
26 #include <security_cdsa_client/clclient.h>
27 #include <security_cdsa_client/cspclient.h>
28 #include <security_cdsa_utilities/cssmtrust.h>
29 #include <security_cdsa_utilities/cssmalloc.h>
30 #include <security_cdsa_utilities/cssmdata.h>
34 namespace CssmClient
{
40 class TPImpl
: public AttachmentImpl
43 TPImpl(const Guid
&guid
);
44 TPImpl(const Module
&module);
48 // the CL and CSP used with many TP operations is usually
49 // pretty stable. The system may even figure them out
50 // automatically in the future.
57 void certGroupVerify(const CertGroup
&certGroup
, const TPVerifyContext
&context
,
58 TPVerifyResult
*result
);
61 void setupCL(); // setup mUseCL
62 void setupCSP(); // setup mUseCSP
65 CL
*mUseCL
; // use this CL for TP operation
66 CSP
*mUseCSP
; // use this CSP for TP operation
67 bool mOwnCL
, mOwnCSP
; // whether we've made our own
71 class TP
: public Attachment
76 explicit TP(Impl
*impl
) : Attachment(impl
) {}
77 TP(const Guid
&guid
) : Attachment(new Impl(guid
)) {}
78 TP(const Module
&module) : Attachment(new Impl(module)) {}
80 Impl
*operator ->() const { return &impl
<Impl
>(); }
81 Impl
&operator *() const { return impl
<Impl
>(); }
86 // A self-building TPVerifyContext.
87 // This is a TPVerifyContext, but it's NOT A PODWRAPPER (it's larger).
89 // NOTE: This is not a client-side object.
91 class TPBuildVerifyContext
: public TPVerifyContext
{
93 TPBuildVerifyContext(CSSM_TP_ACTION action
= CSSM_TP_ACTION_DEFAULT
,
94 Allocator
&alloc
= Allocator::standard());
99 TPCallerAuth mCallerAuth
;
100 // PolicyInfo mPolicyInfo; // -- unused
101 CssmDlDbList mDlDbList
;
105 } // end namespace CssmClient
106 } // end namespace Security
108 #endif // _H_CDSA_CLIENT_CLCLIENT