os/security/crypto/weakcryptospi/test/tplugins/inc/pluginentry.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2006-2010 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
sl@0
    25
#ifndef __PLUGINENTRY_H__
sl@0
    26
#define __PLUGINENTRY_H__
sl@0
    27
sl@0
    28
#include <cryptospi/cryptoparams.h>
sl@0
    29
#include <e32cmn.h>
sl@0
    30
#include <cryptospi/cryptospidef.h>
sl@0
    31
#include <cryptospi/keys.h>
sl@0
    32
#include <cryptospi/hashplugin.h>
sl@0
    33
#include <cryptospi/randomplugin.h>
sl@0
    34
#include <cryptospi/symmetriccipherplugin.h>
sl@0
    35
#include <cryptospi/asymmetriccipherplugin.h>
sl@0
    36
#include <cryptospi/signerplugin.h>
sl@0
    37
#include <cryptospi/verifierplugin.h>
sl@0
    38
#include <cryptospi/keypairgeneratorplugin.h>
sl@0
    39
#include <cryptospi/keyagreementplugin.h>
sl@0
    40
sl@0
    41
#ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
sl@0
    42
#include <cryptospi/macplugin.h>
sl@0
    43
#endif
sl@0
    44
sl@0
    45
using namespace CryptoSpi;
sl@0
    46
sl@0
    47
class CCryptoPluginEntry
sl@0
    48
	{
sl@0
    49
public:
sl@0
    50
sl@0
    51
	/**
sl@0
    52
	Enumerates the set of plug-ins supported by the module for a given interface
sl@0
    53
	e.g. all of the hash plug-ins.
sl@0
    54
sl@0
    55
	@param aInterface The UID of the plug-in interface type. If the UID is not recognised
sl@0
    56
	then the NULL pointer must be returned.
sl@0
    57
	@param aNumPlugins The number of plug-in characteristics objects in the result.
sl@0
    58
	@param A pointer to an array of characteristics objects. The SPI casts this to
sl@0
    59
	the expected sub-class of TCharacteristics for the specified interface UID.
sl@0
    60
	*/
sl@0
    61
	IMPORT_C static const TCharacteristics** Enumerate(TUid aInterface, TInt& aNumPlugins);
sl@0
    62
sl@0
    63
	/**
sl@0
    64
    Retrieves the extended characteristics about a given implementation of an
sl@0
    65
    algorithm within the current plug-in DLL.
sl@0
    66
sl@0
    67
    @param aImplementationUid The UID of the implementation requested
sl@0
    68
    @return A pointer to the extended characteristics, allocated on the heap,
sl@0
    69
    which should be deleted once the caller has finished with it.
sl@0
    70
	*/
sl@0
    71
	IMPORT_C static void GetExtendedCharacteristicsL(TUid aImplementationUid, CExtendedCharacteristics*&);
sl@0
    72
sl@0
    73
	/**
sl@0
    74
	Creates a new instance of an asymmetric cipher
sl@0
    75
sl@0
    76
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
    77
	the new asymmetric cipher object.
sl@0
    78
	@param aImplementationId The UID of the asymmetric cipher plug-in to instantiate.
sl@0
    79
	@param aKey The encryption/decryption key.
sl@0
    80
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
    81
	algorithm. This is for extendibility and will normally be null.
sl@0
    82
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
    83
	*/
sl@0
    84
	IMPORT_C static void CreateAsymmetricCipherL(MAsymmetricCipher*& aPlugin,
sl@0
    85
												TUid aImplementationId,
sl@0
    86
												const CKey& aKey,
sl@0
    87
												TUid aCryptoMode,
sl@0
    88
												TUid aPaddingMode,
sl@0
    89
												const CCryptoParams* aAlgorithmParams);
sl@0
    90
sl@0
    91
	/**
sl@0
    92
	Creates a new instance of an asymmetric signer.
sl@0
    93
sl@0
    94
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
    95
	the new asymmetric signer object.
sl@0
    96
	@param aImplementationId The UID of the signer plug-in to instantiate.
sl@0
    97
	@param aKey The signing key.
sl@0
    98
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
    99
	algorithm. This is for extendibility and will normally be null.
sl@0
   100
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   101
	*/
sl@0
   102
	IMPORT_C static void CreateAsymmetricSignerL(MSigner*& aPlugin,
sl@0
   103
												TUid aImplementationId,
sl@0
   104
												const CKey& aKey,
sl@0
   105
												TUid aPaddingMode,
sl@0
   106
												const CCryptoParams* aAlgorithmParams);
sl@0
   107
sl@0
   108
	/**
sl@0
   109
	Creates a new instance of an asymmetric verifier.
sl@0
   110
sl@0
   111
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   112
	the new asymmetric verifier object.
sl@0
   113
	@param aImplementationId The UID of the verifier plug-in to instantiate.
sl@0
   114
	@param aKey The key to verify the signature with.
sl@0
   115
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   116
	algorithm. This is for extendibility and will normally be null.
sl@0
   117
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   118
	*/
sl@0
   119
	IMPORT_C static void CreateAsymmetricVerifierL(MVerifier*& aPlugin,
sl@0
   120
												TUid aImplementationId,
sl@0
   121
												const CKey& aKey,
sl@0
   122
												TUid aPaddingMode,
sl@0
   123
												const CCryptoParams* aAlgorithmParams);
sl@0
   124
sl@0
   125
sl@0
   126
									
sl@0
   127
	/**
sl@0
   128
	Creates a new instance of a Hash object.
sl@0
   129
sl@0
   130
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   131
	the new hash object.
sl@0
   132
	@param aImplementationId The UID of the hash plug-in to instantiate.
sl@0
   133
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   134
	algorithm. This is for extendibility and will normally be null.
sl@0
   135
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   136
	*/
sl@0
   137
	IMPORT_C static void CreateHashL(MHash*& aPlugin,
sl@0
   138
							TUid aImplementationId,
sl@0
   139
							TUid aOperationMode,
sl@0
   140
							const CKey* aKey,
sl@0
   141
							const CCryptoParams* aAlgorithmParams);
sl@0
   142
sl@0
   143
#ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
sl@0
   144
	/**
sl@0
   145
	 * Creates a new instance of a Hash object.
sl@0
   146
	 *
sl@0
   147
	 * @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   148
	 * the new hash object.
sl@0
   149
	 * @param aImplementationId The UID of the hash plug-in to instantiate.
sl@0
   150
	 * @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   151
	 * algorithm. This is for extendibility and will normally be null.
sl@0
   152
	 * @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   153
	 */
sl@0
   154
	IMPORT_C static void CreateHashL(MHash*& aPlugin,
sl@0
   155
									 TUid aImplementationId,
sl@0
   156
									 const CCryptoParams* aAlgorithmParams);
sl@0
   157
#endif
sl@0
   158
sl@0
   159
	/**
sl@0
   160
	Creates a new instance of a Random object.
sl@0
   161
sl@0
   162
	@param aPlugin A reference to a pointer that should be set to point to the new random object.
sl@0
   163
	@param aImplementationId The UID of the random plug-in to instantiate.
sl@0
   164
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   165
	algorithm. This is for extendibility and will normally be null.
sl@0
   166
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   167
	*/
sl@0
   168
	IMPORT_C static void CreateRandomL(MRandom*& aPlugin,
sl@0
   169
									TUid aImplementationId,
sl@0
   170
									const CCryptoParams* aAlgorithmParams);
sl@0
   171
sl@0
   172
sl@0
   173
	/**
sl@0
   174
	Creates a new instance of a key agreement system.
sl@0
   175
sl@0
   176
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   177
	the new asymmetric key pair generator object.
sl@0
   178
	@param aImplementationId The UID of the key agreement plug-in to instantiate.
sl@0
   179
	@param aKey The private key to combine with the other parties public key
sl@0
   180
	during the agreement.
sl@0
   181
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   182
	algorithm. This is for extendibility and will normally be null.
sl@0
   183
	@return KErrNone if successful; otherwise, a system wide error code.		   
sl@0
   184
	*/
sl@0
   185
	IMPORT_C static void CreateKeyAgreementL(MKeyAgreement*& aPlugin,
sl@0
   186
											TUid aImplementationId,
sl@0
   187
											const CKey& aPrivateKey,
sl@0
   188
											const CCryptoParams* aAlgorithmParams);
sl@0
   189
sl@0
   190
	/**
sl@0
   191
	Creates a new instance of an asymmetric key pair generator.
sl@0
   192
sl@0
   193
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   194
	the new asymmetric key pair generator object.
sl@0
   195
	@param aImplementationId The UID of the verifier plug-in to instantiate.
sl@0
   196
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   197
	algorithm. This is for extendibility and will normally be null.
sl@0
   198
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   199
	*/
sl@0
   200
	IMPORT_C static void CreateKeyPairGeneratorL(MKeyPairGenerator*& aPlugin,
sl@0
   201
												TUid aImplementationId,
sl@0
   202
												const CCryptoParams* aAlgorithmParams);
sl@0
   203
									
sl@0
   204
	/**
sl@0
   205
	Creates a new instance of a symmetric cipher
sl@0
   206
sl@0
   207
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   208
	the new asymmetric object.
sl@0
   209
	@param aImplementationId The UID of the symmetric cipher plug-in to instantiate.
sl@0
   210
	@param aKey The encryption/decryption key.
sl@0
   211
	@param aCryptoMode Encrypt or Decrypt.
sl@0
   212
	@param aOperationMode the block cipher mode to use ECB, CBC, CTR etc
sl@0
   213
	@param aPadding the padding scheme to use.
sl@0
   214
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   215
	algorithm. This is for extendibility and will normally be null.
sl@0
   216
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   217
	*/
sl@0
   218
	IMPORT_C static void CreateSymmetricCipherL(MSymmetricCipher*& aPlugin,
sl@0
   219
											TUid aImplementationId,
sl@0
   220
											const CKey& aKey,
sl@0
   221
											TUid aCryptoMode,
sl@0
   222
											TUid aOperationMode,
sl@0
   223
											TUid aPadding,
sl@0
   224
											const CCryptoParams* aAlgorithmParams);
sl@0
   225
sl@0
   226
#ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
sl@0
   227
	/**
sl@0
   228
	 * Create a CMac instance (if implementation is software based)
sl@0
   229
	 *
sl@0
   230
	 * @param aMac The pointer to CMac
sl@0
   231
	 * @param aImplementationId The specific hash or cipher plug-in to instantiate..
sl@0
   232
	 * @param aKey             	The key for calculating message authentication code value. 
sl@0
   233
	 *                         	Based on the algorithm used we will define the properties of the key.
sl@0
   234
	 * @param aAlgorithmParams 	The parameters that are specific to a particular 
sl@0
   235
	 *                         	algorithm. This is for extendibility and will normally be null. 	
sl@0
   236
	 * @return                 	KErrNone if successful; otherwise, a system wide error code.
sl@0
   237
	 */
sl@0
   238
	IMPORT_C static void CreateMacL(MMac*& aPlugin,
sl@0
   239
									const TUid aImplementationId,
sl@0
   240
									const CKey& aKey,
sl@0
   241
									const CCryptoParams* aAlgorithmParams);
sl@0
   242
#endif
sl@0
   243
	
sl@0
   244
	
sl@0
   245
	/**
sl@0
   246
	Creates a new instance of a Random object.
sl@0
   247
sl@0
   248
	@param aPlugin A reference to a pointer that should be set to point to the new random object.
sl@0
   249
	@param aImplementationId The UID of the random plug-in to instantiate.
sl@0
   250
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   251
	algorithm. This is for extendibility and will normally be null.
sl@0
   252
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   253
	
sl@0
   254
	IMPORT_C static void CreateAsyncRandomL(MAsyncRandom*& aPlugin,
sl@0
   255
									TUid aImplementationId,
sl@0
   256
									const CCryptoParams* aAlgorithmParams);
sl@0
   257
									
sl@0
   258
	*/										
sl@0
   259
	/**
sl@0
   260
	Creates a new instance of a Hash object.
sl@0
   261
sl@0
   262
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   263
	the new hash object.
sl@0
   264
	@param aImplementationId The UID of the hash plug-in to instantiate.
sl@0
   265
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   266
	algorithm. This is for extendibility and will normally be null.
sl@0
   267
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   268
	
sl@0
   269
	IMPORT_C static void CreateAsyncHashL(MAsyncHash*& aPlugin,
sl@0
   270
							TUid aImplementationId,
sl@0
   271
							const CCryptoParams* aAlgorithmParams);
sl@0
   272
sl@0
   273
	*/
sl@0
   274
sl@0
   275
sl@0
   276
	/**
sl@0
   277
	Creates a new instance of a symmetric cipher
sl@0
   278
sl@0
   279
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   280
	the new asymmetric object.
sl@0
   281
	@param aImplementationId The UID of the symmetric cipher plug-in to instantiate.
sl@0
   282
	@param aKey The encryption/decryption key.
sl@0
   283
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   284
	algorithm. This is for extendibility and will normally be null.
sl@0
   285
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   286
sl@0
   287
	IMPORT_C static void CreateAsyncSymmetricCipherL(MAsyncSymmetricCipher*& aPlugin,
sl@0
   288
											TUid aImplementationId,
sl@0
   289
											const CKey& aKey,
sl@0
   290
											TUid aMode,
sl@0
   291
											TUid aPadding,
sl@0
   292
											const CCryptoParams* aAlgorithmParams);
sl@0
   293
sl@0
   294
	*/
sl@0
   295
	/**
sl@0
   296
	Creates a new instance of an asymmetric cipher
sl@0
   297
sl@0
   298
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   299
	the new asymmetric cipher object.
sl@0
   300
	@param aImplementationId The UID of the asymmetric cipher plug-in to instantiate.
sl@0
   301
	@param aKey The encryption/decryption key.
sl@0
   302
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   303
	algorithm. This is for extendibility and will normally be null.
sl@0
   304
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   305
	
sl@0
   306
	IMPORT_C static void CreateAsyncAsymmetricCipherL(MAsyncAsymmetricCipher*& aPlugin,
sl@0
   307
												TUid aImplementationId,
sl@0
   308
												const CKey& aKey,
sl@0
   309
												const CCryptoParams* aAlgorithmParams);
sl@0
   310
sl@0
   311
sl@0
   312
sl@0
   313
*/
sl@0
   314
	/**
sl@0
   315
	Creates a new instance of an asymmetric signer.
sl@0
   316
sl@0
   317
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   318
	the new asymmetric signer object.
sl@0
   319
	@param aImplementationId The UID of the signer plug-in to instantiate.
sl@0
   320
	@param aKey The signing key.
sl@0
   321
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   322
	algorithm. This is for extendibility and will normally be null.
sl@0
   323
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   324
	
sl@0
   325
	IMPORT_C static void CreateAsyncAsymmetricSignerL(MAsyncSigner*& aPlugin,
sl@0
   326
												TUid aImplementationId,
sl@0
   327
												const CKey& aKey,
sl@0
   328
												const CCryptoParams* aAlgorithmParams);
sl@0
   329
	*/
sl@0
   330
	/**
sl@0
   331
	Creates a new instance of an asymmetric verifier.
sl@0
   332
sl@0
   333
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   334
	the new asymmetric verifier object.
sl@0
   335
	@param aImplementationId The UID of the verifier plug-in to instantiate.
sl@0
   336
	@param aKey The key to verify the signature with.
sl@0
   337
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   338
	algorithm. This is for extendibility and will normally be null.
sl@0
   339
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   340
sl@0
   341
	IMPORT_C static void CreateAsyncAsymmetricVerifierL(MAsyncVerifier*& aPlugin,
sl@0
   342
												TUid aImplementationId,
sl@0
   343
												const CKey& aKey,
sl@0
   344
												const CCryptoParams* aAlgorithmParams);
sl@0
   345
sl@0
   346
sl@0
   347
	*/
sl@0
   348
	/**
sl@0
   349
	Creates a new instance of a key agreement system.
sl@0
   350
sl@0
   351
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   352
	the new asymmetric key pair generator object.
sl@0
   353
	@param aImplementationId The UID of the key agreement plug-in to instantiate.
sl@0
   354
	@param aKey The private key to combine with the other parties public key
sl@0
   355
	during the agreement.
sl@0
   356
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   357
	algorithm. This is for extendibility and will normally be null.
sl@0
   358
	@return KErrNone if successful; otherwise, a system wide error code.		   
sl@0
   359
sl@0
   360
	IMPORT_C static void CreateAsyncKeyAgreementL(MAsyncKeyAgreement*& aPlugin,
sl@0
   361
											TUid aImplementationId,
sl@0
   362
											const CKey& aPrivateKey,
sl@0
   363
											const CCryptoParams* aAlgorithmParams);
sl@0
   364
	*/
sl@0
   365
	/**
sl@0
   366
	Creates a new instance of an asymmetric key pair generator.
sl@0
   367
sl@0
   368
	@param aPlugin A reference to a pointer that should be set to point to 
sl@0
   369
	the new asymmetric key pair generator object.
sl@0
   370
	@param aImplementationId The UID of the verifier plug-in to instantiate.
sl@0
   371
	@param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   372
	algorithm. This is for extendibility and will normally be null.
sl@0
   373
	@return KErrNone if successful; otherwise, a system wide error code.
sl@0
   374
	
sl@0
   375
	
sl@0
   376
	IMPORT_C static void CreateAsyncKeyPairGeneratorL(MAsyncKeyPairGenerator*& aPlugin,
sl@0
   377
												TUid aImplementationId,
sl@0
   378
												const CCryptoParams* aAlgorithmParams);
sl@0
   379
	*/
sl@0
   380
	};		
sl@0
   381
sl@0
   382
#endif // __PLUGINENTRY_H__