Update contrib.
2 * Copyright (c) 2006-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.
15 * legacy plugin selector definition
26 #ifndef __CRYPTOAPI_LEGACYSELECTOR_H__
27 #define __CRYPTOAPI_LEGACYSELECTOR_H__
29 #include <cryptospi/pluginselectorbase.h>
30 #include <cryptospi/cryptospidef.h>
31 #include <cryptospi/cryptoplugin.h>
32 #include <cryptospi/cryptoparams.h>
38 class CSymmetricCipher;
39 class CAsymmetricCipher;
43 class CSymmetricKeyGenerator;
44 class CKeyPairGenerator;
47 class CCharacteristicsAndPluginName;
49 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
53 NONSHARABLE_CLASS(CLegacySelector): public CBase, public MPluginSelector
58 NewL create the legacy selector.
59 @return A pointer to a CLegacySelector instance
61 static CLegacySelector* NewL();
64 NewLC create the legacy selector.
65 @return A pointer to a CLegacySelector instance
67 static CLegacySelector* NewLC();
74 //virtual function from MPluginSelector
75 virtual void CreateHashL(CHash*& aHash,
79 const CCryptoParams* aAlgorithmParams);
81 //virtual function from MPluginSelector
82 virtual void CreateRandomL(CRandom*& aRandom,
84 const CCryptoParams* aAlgorithmParams);
86 //virtual function from MPluginSelector
87 virtual void CreateSymmetricCipherL(CSymmetricCipher*& aCipher,
93 const CCryptoParams* aAlgorithmParams);
95 //virtual function from MPluginSelector
96 virtual void CreateAsymmetricCipherL(CAsymmetricCipher*& aCipher,
101 const CCryptoParams* aAlgorithmParams);
103 //virtual function from MPluginSelector
104 virtual void CreateSignerL(CSigner*& aSigner,
108 const CCryptoParams* aAlgorithmParams);
110 //virtual function from MPluginSelector
111 virtual void CreateVerifierL(CVerifier*& aVerifier,
115 const CCryptoParams* aAlgorithmParams);
117 //virtual function from MPluginSelector
118 virtual void CreateKeyPairGeneratorL(CKeyPairGenerator*& aKeyPairGenerator,
119 TUid aKeyAlgorithmUid,
120 const CCryptoParams* aAlgorithmParams);
122 //virtual function from MPluginSelector
123 virtual void CreateKeyAgreementL(CKeyAgreement*& aKeyAgreement,
125 const CKey& aPrivateKey,
126 const CCryptoParams* aAlgorithmParams);
128 //virtual function from MPluginSelector
129 virtual void CreateAsyncHashL(CAsyncHash*& aHash,
133 const CCryptoParams* aAlgorithmParams);
135 //virtual function from MPluginSelector
136 virtual void CreateAsyncRandomL(CAsyncRandom*& aRandom,
138 const CCryptoParams* aAlgorithmParams);
140 //virtual function from MPluginSelector
141 virtual void CreateAsyncSymmetricCipherL(CAsyncSymmetricCipher*& aCipher,
147 const CCryptoParams* aAlgorithmParams);
149 //virtual function from MPluginSelector
150 virtual void CreateAsyncAsymmetricCipherL(CAsyncAsymmetricCipher*& aCipher,
155 const CCryptoParams* aAlgorithmParams);
157 //virtual function from MPluginSelector
158 virtual void CreateAsyncSignerL(CAsyncSigner*& aSigner,
162 const CCryptoParams* aAlgorithmParams);
164 //virtual function from MPluginSelector
165 virtual void CreateAsyncVerifierL(CAsyncVerifier*& aVerifier,
169 const CCryptoParams* aAlgorithmParams);
171 //virtual function from MPluginSelector
172 virtual void CreateAsyncKeyPairGeneratorL(CAsyncKeyPairGenerator*& aKeyPairGenerator,
174 const CCryptoParams* aAlgorithmParams);
176 //virtual function from MPluginSelector
177 virtual void CreateAsyncKeyAgreementL(CAsyncKeyAgreement*& aKeyAgreement,
179 const CKey& aPrivateKey,
180 const CCryptoParams* aAlgorithmParams);
182 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
183 //virtual function from MPluginSelector
184 virtual void CreateMacL(CMac*& aMac,
185 const TUid aAlgorithmUid,
187 const CCryptoParams* aAlgorithmParams);
189 //virtual function from MPluginSelector
190 virtual void CreateAsyncMacL(CAsyncMac*& aMac,
191 const TUid aAlgorithmUid,
193 const CCryptoParams* aAlgorithmParams);
195 //virtual function from MPluginSelector
196 virtual void CreateHashL(CHash*& aHash,
198 const CCryptoParams* aAlgorithmParams);
200 //virtual function from MPluginSelector
201 virtual void CreateAsyncHashL(CAsyncHash*& aAsyncHash,
203 const CCryptoParams* aAlgorithmParams);
210 Find an implemenation of an algorithmUid
211 @param aAlgorithmUid the alogorithm Uid
212 @param aImplementationId the implementation Uid
213 @param aDllIndex the index of the plugin dll
214 @return KErrNone if successful; otherwise, a system wide error code.
216 TInt FindPlugin(TUid aAlgorithmUid, TUid& aImplementationId, TInt& aDllIndex);
217 TInt FindPlugin(TUid aAlgorithmUid, TUid& aImplementationId, TFileName& aDllName);
220 Array of the characteristics of an interface
222 RPointerArray<CCharacteristicsAndPluginName> iCharacteristicsAndDllIndex;
225 The next characteristic index to try
227 TInt iNextCharacteristic;
231 #endif //__CRYPTOAPI_LEGACYSELECTOR_H__