os/security/cryptoplugins/cryptospiplugins/test/h4drv/crypto_h4_plugin/pluginentry.h
Update contrib.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
24 #ifndef __PLUGINENTRY_H__
25 #define __PLUGINENTRY_H__
27 #include <cryptospi/cryptoparams.h>
29 #include <cryptospi/cryptospidef.h>
31 #include <cryptospi/hashplugin.h>
32 #include <cryptospi/randomplugin.h>
33 #include "symmetriccipherplugin.h"
34 #include "asymmetriccipherplugin.h"
35 #include "signerplugin.h"
36 #include "verifierplugin.h"
37 #include "keypairgeneratorplugin.h"
38 #include "keyagreementplugin.h"
40 using namespace CryptoSpi;
42 class CCryptoPluginEntry
47 Enumerates the set of plug-ins supported by the module for a given interface
48 e.g. all of the hash plug-ins.
50 @param aInterface The UID of the plug-in interface type. If the UID is not recognised
51 then the NULL pointer must be returned.
52 @param aNumPlugins The number of plug-in characteristics objects in the result.
53 @param A pointer to an array of characteristics objects. The SPI casts this to
54 the expected sub-class of TCharacteristics for the specified interface UID.
56 IMPORT_C static const TCharacteristics** Enumerate(TUid aInterface, TInt& aNumPlugins);
59 Retrieves the extended characteristics about a given implementation of an
60 algorithm within the current plug-in DLL.
62 @param aImplementationUid The UID of the implementation requested
63 @return A pointer to the extended characteristics, allocated on the heap,
64 which should be deleted once the caller has finished with it.
66 IMPORT_C static void GetExtendedCharacteristicsL(TUid aImplementationUid, CExtendedCharacteristics*&);
69 Creates a new instance of an asymmetric cipher
71 @param aPlugin A reference to a pointer that should be set to point to
72 the new asymmetric cipher object.
73 @param aImplementationId The UID of the asymmetric cipher plug-in to instantiate.
74 @param aKey The encryption/decryption key.
75 @param aAlgorithmParams The parameters that are specific to a particular
76 algorithm. This is for extendibility and will normally be null.
77 @return KErrNone if successful; otherwise, a system wide error code.
79 IMPORT_C static void CreateAsymmetricCipherL(MAsymmetricCipher*& aPlugin,
80 TUid aImplementationId,
84 const CCryptoParams* aAlgorithmParams);
87 Creates a new instance of an asymmetric signer.
89 @param aPlugin A reference to a pointer that should be set to point to
90 the new asymmetric signer object.
91 @param aImplementationId The UID of the signer plug-in to instantiate.
92 @param aKey The signing key.
93 @param aAlgorithmParams The parameters that are specific to a particular
94 algorithm. This is for extendibility and will normally be null.
95 @return KErrNone if successful; otherwise, a system wide error code.
97 IMPORT_C static void CreateAsymmetricSignerL(MSigner*& aPlugin,
98 TUid aImplementationId,
101 const CCryptoParams* aAlgorithmParams);
104 Creates a new instance of an asymmetric verifier.
106 @param aPlugin A reference to a pointer that should be set to point to
107 the new asymmetric verifier object.
108 @param aImplementationId The UID of the verifier plug-in to instantiate.
109 @param aKey The key to verify the signature with.
110 @param aAlgorithmParams The parameters that are specific to a particular
111 algorithm. This is for extendibility and will normally be null.
112 @return KErrNone if successful; otherwise, a system wide error code.
114 IMPORT_C static void CreateAsymmetricVerifierL(MVerifier*& aPlugin,
115 TUid aImplementationId,
118 const CCryptoParams* aAlgorithmParams);
123 Creates a new instance of a Hash object.
125 @param aPlugin A reference to a pointer that should be set to point to
127 @param aImplementationId The UID of the hash plug-in to instantiate.
128 @param aAlgorithmParams The parameters that are specific to a particular
129 algorithm. This is for extendibility and will normally be null.
130 @return KErrNone if successful; otherwise, a system wide error code.
132 IMPORT_C static void CreateHashL(MHash*& aPlugin,
133 TUid aImplementationId,
136 const CCryptoParams* aAlgorithmParams);
139 Creates a new instance of a Random object.
141 @param aPlugin A reference to a pointer that should be set to point to the new random object.
142 @param aImplementationId The UID of the random plug-in to instantiate.
143 @param aAlgorithmParams The parameters that are specific to a particular
144 algorithm. This is for extendibility and will normally be null.
145 @return KErrNone if successful; otherwise, a system wide error code.
147 IMPORT_C static void CreateRandomL(MRandom*& aPlugin,
148 TUid aImplementationId,
149 const CCryptoParams* aAlgorithmParams);
153 Creates a new instance of a key agreement system.
155 @param aPlugin A reference to a pointer that should be set to point to
156 the new asymmetric key pair generator object.
157 @param aImplementationId The UID of the key agreement plug-in to instantiate.
158 @param aPrivateKey The private key to combine with the other parties public key
159 during the agreement.
160 @param aAlgorithmParams The parameters that are specific to a particular
161 algorithm. This is for extendibility and will normally be null.
162 @return KErrNone if successful; otherwise, a system wide error code.
164 IMPORT_C static void CreateKeyAgreementL(MKeyAgreement*& aPlugin,
165 TUid aImplementationId,
166 const CKey& aPrivateKey,
167 const CCryptoParams* aAlgorithmParams);
170 Creates a new instance of an asymmetric key pair generator.
172 @param aPlugin A reference to a pointer that should be set to point to
173 the new asymmetric key pair generator object.
174 @param aImplementationId The UID of the verifier plug-in to instantiate.
175 @param aAlgorithmParams The parameters that are specific to a particular
176 algorithm. This is for extendibility and will normally be null.
177 @return KErrNone if successful; otherwise, a system wide error code.
179 IMPORT_C static void CreateKeyPairGeneratorL(MKeyPairGenerator*& aPlugin,
180 TUid aImplementationId,
181 const CCryptoParams* aAlgorithmParams);
184 Creates a new instance of a symmetric cipher
186 @param aPlugin A reference to a pointer that should be set to point to
187 the new asymmetric object.
188 @param aImplementationId The UID of the symmetric cipher plug-in to instantiate.
189 @param aKey The encryption/decryption key.
190 @param aCryptoMode Encrypt or Decrypt.
191 @param aOperationMode the block cipher mode to use ECB, CBC, CTR etc
192 @param aPadding the padding scheme to use.
193 @param aAlgorithmParams The parameters that are specific to a particular
194 algorithm. This is for extendibility and will normally be null.
195 @return KErrNone if successful; otherwise, a system wide error code.
197 IMPORT_C static void CreateSymmetricCipherL(MSymmetricCipher*& aPlugin,
198 TUid aImplementationId,
203 const CCryptoParams* aAlgorithmParams);
207 Creates a new instance of a Random object.
209 @param aPlugin A reference to a pointer that should be set to point to the new random object.
210 @param aImplementationId The UID of the random plug-in to instantiate.
211 @param aAlgorithmParams The parameters that are specific to a particular
212 algorithm. This is for extendibility and will normally be null.
213 @return KErrNone if successful; otherwise, a system wide error code.
215 IMPORT_C static void CreateAsyncRandomL(MAsyncRandom*& aPlugin,
216 TUid aImplementationId,
217 const CCryptoParams* aAlgorithmParams);
221 Creates a new instance of a Hash object.
223 @param aPlugin A reference to a pointer that should be set to point to
225 @param aImplementationId The UID of the hash plug-in to instantiate.
226 @param aAlgorithmParams The parameters that are specific to a particular
227 algorithm. This is for extendibility and will normally be null.
228 @return KErrNone if successful; otherwise, a system wide error code.
230 IMPORT_C static void CreateAsyncHashL(MAsyncHash*& aPlugin,
231 TUid aImplementationId,
232 const CCryptoParams* aAlgorithmParams);
238 Creates a new instance of a symmetric cipher
240 @param aPlugin A reference to a pointer that should be set to point to
241 the new asymmetric object.
242 @param aImplementationId The UID of the symmetric cipher plug-in to instantiate.
243 @param aKey The encryption/decryption key.
244 @param aAlgorithmParams The parameters that are specific to a particular
245 algorithm. This is for extendibility and will normally be null.
246 @return KErrNone if successful; otherwise, a system wide error code.
248 IMPORT_C static void CreateAsyncSymmetricCipherL(MAsyncSymmetricCipher*& aPlugin,
249 TUid aImplementationId,
253 const CCryptoParams* aAlgorithmParams);
257 Creates a new instance of an asymmetric cipher
259 @param aPlugin A reference to a pointer that should be set to point to
260 the new asymmetric cipher object.
261 @param aImplementationId The UID of the asymmetric cipher plug-in to instantiate.
262 @param aKey The encryption/decryption key.
263 @param aAlgorithmParams The parameters that are specific to a particular
264 algorithm. This is for extendibility and will normally be null.
265 @return KErrNone if successful; otherwise, a system wide error code.
267 IMPORT_C static void CreateAsyncAsymmetricCipherL(MAsyncAsymmetricCipher*& aPlugin,
268 TUid aImplementationId,
270 const CCryptoParams* aAlgorithmParams);
276 Creates a new instance of an asymmetric signer.
278 @param aPlugin A reference to a pointer that should be set to point to
279 the new asymmetric signer object.
280 @param aImplementationId The UID of the signer plug-in to instantiate.
281 @param aKey The signing key.
282 @param aAlgorithmParams The parameters that are specific to a particular
283 algorithm. This is for extendibility and will normally be null.
284 @return KErrNone if successful; otherwise, a system wide error code.
286 IMPORT_C static void CreateAsyncAsymmetricSignerL(MAsyncSigner*& aPlugin,
287 TUid aImplementationId,
289 const CCryptoParams* aAlgorithmParams);
292 Creates a new instance of an asymmetric verifier.
294 @param aPlugin A reference to a pointer that should be set to point to
295 the new asymmetric verifier object.
296 @param aImplementationId The UID of the verifier plug-in to instantiate.
297 @param aKey The key to verify the signature with.
298 @param aAlgorithmParams The parameters that are specific to a particular
299 algorithm. This is for extendibility and will normally be null.
300 @return KErrNone if successful; otherwise, a system wide error code.
302 IMPORT_C static void CreateAsyncAsymmetricVerifierL(MAsyncVerifier*& aPlugin,
303 TUid aImplementationId,
305 const CCryptoParams* aAlgorithmParams);
310 Creates a new instance of a key agreement system.
312 @param aPlugin A reference to a pointer that should be set to point to
313 the new asymmetric key pair generator object.
314 @param aImplementationId The UID of the key agreement plug-in to instantiate.
315 @param aKey The private key to combine with the other parties public key
316 during the agreement.
317 @param aAlgorithmParams The parameters that are specific to a particular
318 algorithm. This is for extendibility and will normally be null.
319 @return KErrNone if successful; otherwise, a system wide error code.
321 IMPORT_C static void CreateAsyncKeyAgreementL(MAsyncKeyAgreement*& aPlugin,
322 TUid aImplementationId,
323 const CKey& aPrivateKey,
324 const CCryptoParams* aAlgorithmParams);
328 Creates a new instance of an asymmetric key pair generator.
330 @param aPlugin A reference to a pointer that should be set to point to
331 the new asymmetric key pair generator object.
332 @param aImplementationId The UID of the verifier plug-in to instantiate.
333 @param aAlgorithmParams The parameters that are specific to a particular
334 algorithm. This is for extendibility and will normally be null.
335 @return KErrNone if successful; otherwise, a system wide error code.
338 IMPORT_C static void CreateAsyncKeyPairGeneratorL(MAsyncKeyPairGenerator*& aPlugin,
339 TUid aImplementationId,
340 const CCryptoParams* aAlgorithmParams);
345 #endif // __PLUGINENTRY_H__