sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
/**
|
sl@0
|
20 |
* @file
|
sl@0
|
21 |
* @internalComponent
|
sl@0
|
22 |
* @released
|
sl@0
|
23 |
*/
|
sl@0
|
24 |
#ifndef CPLUGINENTRY_H
|
sl@0
|
25 |
#define CPLUGINENTRY_H
|
sl@0
|
26 |
|
sl@0
|
27 |
#include <cryptospi/cryptoparams.h>
|
sl@0
|
28 |
#include <e32cmn.h>
|
sl@0
|
29 |
#include <cryptospi/cryptospidef.h>
|
sl@0
|
30 |
#include "keys.h"
|
sl@0
|
31 |
#include <cryptospi/hashplugin.h>
|
sl@0
|
32 |
#include <cryptospi/randomplugin.h>
|
sl@0
|
33 |
#include "symmetriccipherplugin.h"
|
sl@0
|
34 |
#include "asymmetriccipherplugin.h"
|
sl@0
|
35 |
#include "signerplugin.h"
|
sl@0
|
36 |
#include "verifierplugin.h"
|
sl@0
|
37 |
#include "keypairgeneratorplugin.h"
|
sl@0
|
38 |
#include "keyagreementplugin.h"
|
sl@0
|
39 |
|
sl@0
|
40 |
using namespace CryptoSpi;
|
sl@0
|
41 |
|
sl@0
|
42 |
class CCryptoPluginEntry
|
sl@0
|
43 |
{
|
sl@0
|
44 |
public:
|
sl@0
|
45 |
/**
|
sl@0
|
46 |
* Enumerates the set of plug-ins supported by the module for a given interface
|
sl@0
|
47 |
* e.g. all of the hash plug-ins.
|
sl@0
|
48 |
*
|
sl@0
|
49 |
* @param aInterface The UID of the plug-in interface type. If the UID is not recognised
|
sl@0
|
50 |
* then the NULL pointer must be returned.
|
sl@0
|
51 |
* @param aNumPlugins The number of plug-in characteristics objects in the result.
|
sl@0
|
52 |
*/
|
sl@0
|
53 |
IMPORT_C static const TCharacteristics** Enumerate(TUid aInterface,
|
sl@0
|
54 |
TInt& aNumPlugins);
|
sl@0
|
55 |
|
sl@0
|
56 |
IMPORT_C static void GetExtendedCharacteristicsL(TUid aImplementationUid,
|
sl@0
|
57 |
CExtendedCharacteristics*&);
|
sl@0
|
58 |
|
sl@0
|
59 |
/**
|
sl@0
|
60 |
* Creates a new instance of an asymmetric cipher
|
sl@0
|
61 |
*
|
sl@0
|
62 |
* @param aPlugin A reference to a pointer that should be set to point to
|
sl@0
|
63 |
* the new asymmetric cipher object.
|
sl@0
|
64 |
* @param aImplementationId The UID of the asymmetric cipher plug-in to instantiate.
|
sl@0
|
65 |
* @param aKey The encryption/decryption key.
|
sl@0
|
66 |
* @param aPaddingMode The padding mode.
|
sl@0
|
67 |
* @param aAlgorithmParams The parameters that are specific to a particular
|
sl@0
|
68 |
* algorithm. This is for extendibility and will normally be null.
|
sl@0
|
69 |
*
|
sl@0
|
70 |
* @leave Function can leave with any system wide error codes in
|
sl@0
|
71 |
* case of failure.
|
sl@0
|
72 |
*/
|
sl@0
|
73 |
IMPORT_C static void CreateAsymmetricCipherL(MAsymmetricCipher*& aPlugin,
|
sl@0
|
74 |
TUid aImplementationId, const CKey& aKey, TUid aCryptoMode,
|
sl@0
|
75 |
TUid aPaddingMode, const CCryptoParams* aAlgorithmParams);
|
sl@0
|
76 |
|
sl@0
|
77 |
/**
|
sl@0
|
78 |
* Creates a new instance of an asymmetric signer.
|
sl@0
|
79 |
*
|
sl@0
|
80 |
* @param aPlugin A reference to a pointer that should be set to point to
|
sl@0
|
81 |
* the new asymmetric signer object.
|
sl@0
|
82 |
* @param aImplementationId The UID of the signer plug-in to instantiate.
|
sl@0
|
83 |
* @param aKey The signing key.
|
sl@0
|
84 |
* @param aPaddingMode The padding mode.
|
sl@0
|
85 |
* @param aAlgorithmParams The parameters that are specific to a particular
|
sl@0
|
86 |
* algorithm. This is for extendibility and will normally be null.
|
sl@0
|
87 |
*
|
sl@0
|
88 |
* @leave Function can leave with any system wide error codes in
|
sl@0
|
89 |
* case of failure.
|
sl@0
|
90 |
*/
|
sl@0
|
91 |
IMPORT_C static void CreateAsymmetricSignerL(MSigner*& aPlugin,
|
sl@0
|
92 |
TUid aImplementationId, const CKey& aKey, TUid aPaddingMode,
|
sl@0
|
93 |
const CCryptoParams* aAlgorithmParams);
|
sl@0
|
94 |
|
sl@0
|
95 |
/**
|
sl@0
|
96 |
* Creates a new instance of an asymmetric verifier.
|
sl@0
|
97 |
*
|
sl@0
|
98 |
* @param aPlugin A reference to a pointer that should be set to point to
|
sl@0
|
99 |
* the new asymmetric verifier object.
|
sl@0
|
100 |
* @param aImplementationId The UID of the verifier plug-in to instantiate.
|
sl@0
|
101 |
* @param aKey The key to verify the signature with.
|
sl@0
|
102 |
* @param aAlgorithmParams The parameters that are specific to a particular
|
sl@0
|
103 |
* algorithm. This is for extendibility and will normally be null.
|
sl@0
|
104 |
*
|
sl@0
|
105 |
* @leave Function can leave with any system wide error codes in
|
sl@0
|
106 |
* case of failure.
|
sl@0
|
107 |
*/
|
sl@0
|
108 |
IMPORT_C static void CreateAsymmetricVerifierL(MVerifier*& aPlugin,
|
sl@0
|
109 |
TUid aImplementationId,
|
sl@0
|
110 |
const CKey& aKey,
|
sl@0
|
111 |
TUid aPaddingMode,
|
sl@0
|
112 |
const CCryptoParams* aAlgorithmParams);
|
sl@0
|
113 |
|
sl@0
|
114 |
/**
|
sl@0
|
115 |
* Creates a new instance of a Hash object.
|
sl@0
|
116 |
*
|
sl@0
|
117 |
* @param aPlugin A reference to a pointer that should be set to point to
|
sl@0
|
118 |
* the new hash object.
|
sl@0
|
119 |
* @param aImplementationId The UID of the hash plug-in to instantiate.
|
sl@0
|
120 |
* @param aAlgorithmParams The parameters that are specific to a particular
|
sl@0
|
121 |
* algorithm. This is for extendibility and will normally be null.
|
sl@0
|
122 |
*
|
sl@0
|
123 |
* @leave Function can leave with any system wide error codes in
|
sl@0
|
124 |
* case of failure.
|
sl@0
|
125 |
*/
|
sl@0
|
126 |
IMPORT_C static void CreateHashL(MHash*& aPlugin,
|
sl@0
|
127 |
TUid aImplementationId,
|
sl@0
|
128 |
TUid aOperationMode,
|
sl@0
|
129 |
const CKey* aKey,
|
sl@0
|
130 |
const CCryptoParams* aAlgorithmParams);
|
sl@0
|
131 |
|
sl@0
|
132 |
/**
|
sl@0
|
133 |
* Creates a new instance of a Random object.
|
sl@0
|
134 |
*
|
sl@0
|
135 |
* @param aPlugin A reference to a pointer that should be set to point to the new random object.
|
sl@0
|
136 |
* @param aImplementationId The UID of the random plug-in to instantiate.
|
sl@0
|
137 |
* @param aAlgorithmParams The parameters that are specific to a particular
|
sl@0
|
138 |
* algorithm. This is for extendibility and will normally be null.
|
sl@0
|
139 |
*
|
sl@0
|
140 |
* @leave Function can leave with any system wide error codes in
|
sl@0
|
141 |
* case of failure.
|
sl@0
|
142 |
*/
|
sl@0
|
143 |
IMPORT_C static void CreateRandomL(MRandom*& aPlugin,
|
sl@0
|
144 |
TUid aImplementationId,
|
sl@0
|
145 |
const CCryptoParams* aAlgorithmParams);
|
sl@0
|
146 |
|
sl@0
|
147 |
|
sl@0
|
148 |
/**
|
sl@0
|
149 |
* Creates a new instance of a key agreement system.
|
sl@0
|
150 |
*
|
sl@0
|
151 |
* @param aPlugin A reference to a pointer that should be set to point to
|
sl@0
|
152 |
* the new asymmetric key pair generator object.
|
sl@0
|
153 |
* @param aImplementationId The UID of the key agreement plug-in to instantiate.
|
sl@0
|
154 |
* @param aPrivateKey The private key to combine with the other parties public key
|
sl@0
|
155 |
* during the agreement.
|
sl@0
|
156 |
* @param aAlgorithmParams The parameters that are specific to a particular
|
sl@0
|
157 |
* algorithm. This is for extendibility and will normally be null.
|
sl@0
|
158 |
*
|
sl@0
|
159 |
* @leave Function can leave with any system wide error codes in
|
sl@0
|
160 |
* case of failure.
|
sl@0
|
161 |
*/
|
sl@0
|
162 |
IMPORT_C static void CreateKeyAgreementL(MKeyAgreement*& aPlugin,
|
sl@0
|
163 |
TUid aImplementationId,
|
sl@0
|
164 |
const CKey& aPrivateKey,
|
sl@0
|
165 |
const CCryptoParams* aAlgorithmParams);
|
sl@0
|
166 |
|
sl@0
|
167 |
/**
|
sl@0
|
168 |
* Creates a new instance of an asymmetric key pair generator.
|
sl@0
|
169 |
*
|
sl@0
|
170 |
* @param aPlugin A reference to a pointer that should be set to point to
|
sl@0
|
171 |
* the new asymmetric key pair generator object.
|
sl@0
|
172 |
* @param aImplementationId The UID of the verifier plug-in to instantiate.
|
sl@0
|
173 |
* @param aAlgorithmParams The parameters that are specific to a particular
|
sl@0
|
174 |
* algorithm. This is for extendibility and will normally be null.
|
sl@0
|
175 |
*
|
sl@0
|
176 |
* @leave Function can leave with any system wide error codes in
|
sl@0
|
177 |
* case of failure.
|
sl@0
|
178 |
*/
|
sl@0
|
179 |
IMPORT_C static void CreateKeyPairGeneratorL(MKeyPairGenerator*& aPlugin,
|
sl@0
|
180 |
TUid aImplementationId,
|
sl@0
|
181 |
const CCryptoParams* aAlgorithmParams);
|
sl@0
|
182 |
|
sl@0
|
183 |
/**
|
sl@0
|
184 |
* Creates a new instance of a symmetric cipher
|
sl@0
|
185 |
*
|
sl@0
|
186 |
* @param aPlugin A reference to a pointer that should be set to point to
|
sl@0
|
187 |
* the new asymmetric object.
|
sl@0
|
188 |
* @param aImplementationId The UID of the symmetric cipher plug-in to instantiate.
|
sl@0
|
189 |
* @param aKey The encryption/decryption key.
|
sl@0
|
190 |
* @param aCryptoMode Encrypt or Decrypt.
|
sl@0
|
191 |
* @param aOperationMode the block cipher mode to use ECB, CBC, CTR etc
|
sl@0
|
192 |
* @param aPadding the padding scheme to use.
|
sl@0
|
193 |
* @param aAlgorithmParams The parameters that are specific to a particular
|
sl@0
|
194 |
* algorithm. This is for extendibility and will normally be null.
|
sl@0
|
195 |
*
|
sl@0
|
196 |
* @leave Function can leave with any system wide error codes in
|
sl@0
|
197 |
* case of failure.
|
sl@0
|
198 |
*/
|
sl@0
|
199 |
IMPORT_C static void CreateSymmetricCipherL(MSymmetricCipher*& aPlugin,
|
sl@0
|
200 |
TUid aImplementationId,
|
sl@0
|
201 |
const CKey& aKey,
|
sl@0
|
202 |
TUid aCryptoMode,
|
sl@0
|
203 |
TUid aOperationMode,
|
sl@0
|
204 |
TUid aPadding,
|
sl@0
|
205 |
const CCryptoParams* aAlgorithmParams);
|
sl@0
|
206 |
|
sl@0
|
207 |
|
sl@0
|
208 |
};
|
sl@0
|
209 |
|
sl@0
|
210 |
#endif // CPLUGINENTRY_H
|