]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cdsa_plugin/lib/CSPabstractsession.h
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_cdsa_plugin / lib / CSPabstractsession.h
1 //
2 // CSP plugin transition layer.
3 // This file was automatically generated. Do not edit on penalty of futility!
4 //
5 #ifndef _H_CSPABSTRACTSESSION
6 #define _H_CSPABSTRACTSESSION
7
8 #include <security_cdsa_plugin/pluginsession.h>
9 #include <security_cdsa_utilities/cssmdata.h>
10 #include <security_cdsa_utilities/context.h>
11 #include <security_cdsa_utilities/cssmacl.h>
12 #include <security_cdsa_utilities/cssmdb.h>
13
14
15 namespace Security {
16
17
18 //
19 // A pure abstract class to define the CSP module interface
20 //
21 class CSPAbstractPluginSession {
22 public:
23 virtual ~CSPAbstractPluginSession();
24 virtual void VerifyMacFinal(CSSM_CC_HANDLE CCHandle,
25 const CssmData &Mac) = 0;
26 virtual void GenerateRandom(CSSM_CC_HANDLE CCHandle,
27 const Context &Context,
28 CssmData &RandomNumber) = 0;
29 virtual void RetrieveUniqueId(CssmData &UniqueID) = 0;
30 virtual void SignDataFinal(CSSM_CC_HANDLE CCHandle,
31 CssmData &Signature) = 0;
32 virtual void VerifyDataUpdate(CSSM_CC_HANDLE CCHandle,
33 const CssmData DataBufs[],
34 uint32 DataBufCount) = 0;
35 virtual void GenerateMac(CSSM_CC_HANDLE CCHandle,
36 const Context &Context,
37 const CssmData DataBufs[],
38 uint32 DataBufCount,
39 CssmData &Mac) = 0;
40 virtual void VerifyMac(CSSM_CC_HANDLE CCHandle,
41 const Context &Context,
42 const CssmData DataBufs[],
43 uint32 DataBufCount,
44 const CssmData &Mac) = 0;
45 virtual void ObtainPrivateKeyFromPublicKey(const CssmKey &PublicKey,
46 CssmKey &PrivateKey) = 0;
47 virtual void ChangeLoginOwner(const AccessCredentials &AccessCred,
48 const CSSM_ACL_OWNER_PROTOTYPE &NewOwner) = 0;
49 virtual void SignDataInit(CSSM_CC_HANDLE CCHandle,
50 const Context &Context) = 0;
51 virtual void DecryptDataInit(CSSM_CC_HANDLE CCHandle,
52 const Context &Context,
53 CSSM_PRIVILEGE Privilege) = 0;
54 virtual void EventNotify(CSSM_CONTEXT_EVENT Event,
55 CSSM_CC_HANDLE CCHandle,
56 const Context &Context) = 0;
57 virtual void GetOperationalStatistics(CSPOperationalStatistics &Statistics) = 0;
58 virtual void DigestData(CSSM_CC_HANDLE CCHandle,
59 const Context &Context,
60 const CssmData DataBufs[],
61 uint32 DataBufCount,
62 CssmData &Digest) = 0;
63 virtual void GetLoginAcl(const CSSM_STRING *SelectionTag,
64 uint32 &NumberOfAclInfos,
65 CSSM_ACL_ENTRY_INFO_PTR &AclInfos) = 0;
66 virtual void GetKeyOwner(const CssmKey &Key,
67 CSSM_ACL_OWNER_PROTOTYPE &Owner) = 0;
68 virtual void ChangeKeyOwner(const AccessCredentials &AccessCred,
69 const CssmKey &Key,
70 const CSSM_ACL_OWNER_PROTOTYPE &NewOwner) = 0;
71 virtual void VerifyMacInit(CSSM_CC_HANDLE CCHandle,
72 const Context &Context) = 0;
73 virtual void DigestDataClone(CSSM_CC_HANDLE CCHandle,
74 CSSM_CC_HANDLE ClonedCCHandle) = 0;
75 virtual void GenerateMacUpdate(CSSM_CC_HANDLE CCHandle,
76 const CssmData DataBufs[],
77 uint32 DataBufCount) = 0;
78 virtual void EncryptDataFinal(CSSM_CC_HANDLE CCHandle,
79 CssmData &RemData) = 0;
80 virtual void EncryptDataInit(CSSM_CC_HANDLE CCHandle,
81 const Context &Context,
82 CSSM_PRIVILEGE Privilege) = 0;
83 virtual void VerifyData(CSSM_CC_HANDLE CCHandle,
84 const Context &Context,
85 const CssmData DataBufs[],
86 uint32 DataBufCount,
87 CSSM_ALGORITHMS DigestAlgorithm,
88 const CssmData &Signature) = 0;
89 virtual void UnwrapKey(CSSM_CC_HANDLE CCHandle,
90 const Context &Context,
91 const CssmKey *PublicKey,
92 const CssmKey &WrappedKey,
93 uint32 KeyUsage,
94 uint32 KeyAttr,
95 const CssmData *KeyLabel,
96 const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
97 CssmKey &UnwrappedKey,
98 CssmData &DescriptiveData,
99 CSSM_PRIVILEGE Privilege) = 0;
100 virtual void GenerateMacFinal(CSSM_CC_HANDLE CCHandle,
101 CssmData &Mac) = 0;
102 virtual void WrapKey(CSSM_CC_HANDLE CCHandle,
103 const Context &Context,
104 const AccessCredentials &AccessCred,
105 const CssmKey &Key,
106 const CssmData *DescriptiveData,
107 CssmKey &WrappedKey,
108 CSSM_PRIVILEGE Privilege) = 0;
109 virtual void DecryptDataFinal(CSSM_CC_HANDLE CCHandle,
110 CssmData &RemData) = 0;
111 virtual void SignData(CSSM_CC_HANDLE CCHandle,
112 const Context &Context,
113 const CssmData DataBufs[],
114 uint32 DataBufCount,
115 CSSM_ALGORITHMS DigestAlgorithm,
116 CssmData &Signature) = 0;
117 virtual void SignDataUpdate(CSSM_CC_HANDLE CCHandle,
118 const CssmData DataBufs[],
119 uint32 DataBufCount) = 0;
120 virtual void Logout() = 0;
121 virtual void DecryptData(CSSM_CC_HANDLE CCHandle,
122 const Context &Context,
123 const CssmData CipherBufs[],
124 uint32 CipherBufCount,
125 CssmData ClearBufs[],
126 uint32 ClearBufCount,
127 CSSM_SIZE &bytesDecrypted,
128 CssmData &RemData,
129 CSSM_PRIVILEGE Privilege) = 0;
130 virtual void QueryKeySizeInBits(CSSM_CC_HANDLE CCHandle,
131 const Context *Context,
132 const CssmKey *Key,
133 CSSM_KEY_SIZE &KeySize) = 0;
134 virtual void DigestDataInit(CSSM_CC_HANDLE CCHandle,
135 const Context &Context) = 0;
136 virtual void DigestDataFinal(CSSM_CC_HANDLE CCHandle,
137 CssmData &Digest) = 0;
138 virtual void Login(const AccessCredentials &AccessCred,
139 const CssmData *LoginName,
140 const void *Reserved) = 0;
141 virtual void ChangeKeyAcl(const AccessCredentials &AccessCred,
142 const CSSM_ACL_EDIT &AclEdit,
143 const CssmKey &Key) = 0;
144 virtual void GetKeyAcl(const CssmKey &Key,
145 const CSSM_STRING *SelectionTag,
146 uint32 &NumberOfAclInfos,
147 CSSM_ACL_ENTRY_INFO_PTR &AclInfos) = 0;
148 virtual void GenerateAlgorithmParams(CSSM_CC_HANDLE CCHandle,
149 const Context &Context,
150 uint32 ParamBits,
151 CssmData &Param,
152 uint32 &NumberOfUpdatedAttibutes,
153 CSSM_CONTEXT_ATTRIBUTE_PTR &UpdatedAttributes) = 0;
154 virtual void GetLoginOwner(CSSM_ACL_OWNER_PROTOTYPE &Owner) = 0;
155 virtual void VerifyDevice(const CssmData &DeviceCert) = 0;
156 virtual void EncryptDataUpdate(CSSM_CC_HANDLE CCHandle,
157 const CssmData ClearBufs[],
158 uint32 ClearBufCount,
159 CssmData CipherBufs[],
160 uint32 CipherBufCount,
161 CSSM_SIZE &bytesEncrypted) = 0;
162 virtual void VerifyDataInit(CSSM_CC_HANDLE CCHandle,
163 const Context &Context) = 0;
164 virtual void DecryptDataUpdate(CSSM_CC_HANDLE CCHandle,
165 const CssmData CipherBufs[],
166 uint32 CipherBufCount,
167 CssmData ClearBufs[],
168 uint32 ClearBufCount,
169 CSSM_SIZE &bytesDecrypted) = 0;
170 virtual void ChangeLoginAcl(const AccessCredentials &AccessCred,
171 const CSSM_ACL_EDIT &AclEdit) = 0;
172 virtual void DigestDataUpdate(CSSM_CC_HANDLE CCHandle,
173 const CssmData DataBufs[],
174 uint32 DataBufCount) = 0;
175 virtual void GenerateMacInit(CSSM_CC_HANDLE CCHandle,
176 const Context &Context) = 0;
177 virtual void QuerySize(CSSM_CC_HANDLE CCHandle,
178 const Context &Context,
179 CSSM_BOOL Encrypt,
180 uint32 QuerySizeCount,
181 QuerySizeData *DataBlock) = 0;
182 virtual void RetrieveCounter(CssmData &Counter) = 0;
183 virtual void DeriveKey(CSSM_CC_HANDLE CCHandle,
184 const Context &Context,
185 CssmData &Param,
186 uint32 KeyUsage,
187 uint32 KeyAttr,
188 const CssmData *KeyLabel,
189 const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
190 CssmKey &DerivedKey) = 0;
191 virtual void GenerateKey(CSSM_CC_HANDLE CCHandle,
192 const Context &Context,
193 uint32 KeyUsage,
194 uint32 KeyAttr,
195 const CssmData *KeyLabel,
196 const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
197 CssmKey &Key,
198 CSSM_PRIVILEGE Privilege) = 0;
199 virtual void FreeKey(const AccessCredentials *AccessCred,
200 CssmKey &KeyPtr,
201 CSSM_BOOL Delete) = 0;
202 virtual void PassThrough(CSSM_CC_HANDLE CCHandle,
203 const Context &Context,
204 uint32 PassThroughId,
205 const void *InData,
206 void **OutData) = 0;
207 virtual void VerifyMacUpdate(CSSM_CC_HANDLE CCHandle,
208 const CssmData DataBufs[],
209 uint32 DataBufCount) = 0;
210 virtual void VerifyDataFinal(CSSM_CC_HANDLE CCHandle,
211 const CssmData &Signature) = 0;
212 virtual void GenerateKeyPair(CSSM_CC_HANDLE CCHandle,
213 const Context &Context,
214 uint32 PublicKeyUsage,
215 uint32 PublicKeyAttr,
216 const CssmData *PublicKeyLabel,
217 CssmKey &PublicKey,
218 uint32 PrivateKeyUsage,
219 uint32 PrivateKeyAttr,
220 const CssmData *PrivateKeyLabel,
221 const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
222 CssmKey &PrivateKey,
223 CSSM_PRIVILEGE Privilege) = 0;
224 virtual void GetTimeValue(CSSM_ALGORITHMS TimeAlgorithm,
225 CssmData &TimeData) = 0;
226 virtual void EncryptData(CSSM_CC_HANDLE CCHandle,
227 const Context &Context,
228 const CssmData ClearBufs[],
229 uint32 ClearBufCount,
230 CssmData CipherBufs[],
231 uint32 CipherBufCount,
232 CSSM_SIZE &bytesEncrypted,
233 CssmData &RemData,
234 CSSM_PRIVILEGE Privilege) = 0;
235 };
236
237 } // end namespace Security
238
239 #endif //_H_CSPABSTRACTSESSION