os/security/cryptoplugins/cryptospiplugins/test/h4drv/crypto_h4_plugin/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) 2007-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 __PLUGINENTRY_H__
sl@0
    25
#define __PLUGINENTRY_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
	/**
sl@0
    47
	   Enumerates the set of plug-ins supported by the module for a given interface
sl@0
    48
	   e.g. all of the hash plug-ins.
sl@0
    49
	   
sl@0
    50
	   @param aInterface The UID of the plug-in interface type. If the UID is not recognised
sl@0
    51
	   then the NULL pointer must be returned.
sl@0
    52
	   @param aNumPlugins The number of plug-in characteristics objects in the result.
sl@0
    53
	   @param A pointer to an array of characteristics objects. The SPI casts this to
sl@0
    54
	   the expected sub-class of TCharacteristics for the specified interface UID.
sl@0
    55
	*/
sl@0
    56
	IMPORT_C static const TCharacteristics** Enumerate(TUid aInterface, TInt& aNumPlugins);
sl@0
    57
sl@0
    58
	/**
sl@0
    59
	   Retrieves the extended characteristics about a given implementation of an
sl@0
    60
	   algorithm within the current plug-in DLL.
sl@0
    61
sl@0
    62
	   @param aImplementationUid The UID of the implementation requested
sl@0
    63
	   @return A pointer to the extended characteristics, allocated on the heap,
sl@0
    64
	   which should be deleted once the caller has finished with it.
sl@0
    65
	*/
sl@0
    66
	IMPORT_C static void GetExtendedCharacteristicsL(TUid aImplementationUid, CExtendedCharacteristics*&);
sl@0
    67
sl@0
    68
	/**
sl@0
    69
	   Creates a new instance of an asymmetric cipher
sl@0
    70
sl@0
    71
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
    72
	   the new asymmetric cipher object.
sl@0
    73
	   @param aImplementationId The UID of the asymmetric cipher plug-in to instantiate.
sl@0
    74
	   @param aKey The encryption/decryption key.
sl@0
    75
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
    76
	   algorithm. This is for extendibility and will normally be null.
sl@0
    77
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
    78
	*/
sl@0
    79
	IMPORT_C static void CreateAsymmetricCipherL(MAsymmetricCipher*& aPlugin,
sl@0
    80
												 TUid aImplementationId,
sl@0
    81
												 const CKey& aKey,
sl@0
    82
												 TUid aCryptoMode,
sl@0
    83
												 TUid aPaddingMode,
sl@0
    84
												 const CCryptoParams* aAlgorithmParams);
sl@0
    85
sl@0
    86
	/**
sl@0
    87
	   Creates a new instance of an asymmetric signer.
sl@0
    88
sl@0
    89
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
    90
	   the new asymmetric signer object.
sl@0
    91
	   @param aImplementationId The UID of the signer plug-in to instantiate.
sl@0
    92
	   @param aKey The signing key.
sl@0
    93
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
    94
	   algorithm. This is for extendibility and will normally be null.
sl@0
    95
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
    96
	*/
sl@0
    97
	IMPORT_C static void CreateAsymmetricSignerL(MSigner*& aPlugin,
sl@0
    98
												 TUid aImplementationId,
sl@0
    99
												 const CKey& aKey,
sl@0
   100
												 TUid aPaddingMode,
sl@0
   101
												 const CCryptoParams* aAlgorithmParams);
sl@0
   102
sl@0
   103
	/**
sl@0
   104
	   Creates a new instance of an asymmetric verifier.
sl@0
   105
sl@0
   106
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   107
	   the new asymmetric verifier object.
sl@0
   108
	   @param aImplementationId The UID of the verifier plug-in to instantiate.
sl@0
   109
	   @param aKey The key to verify the signature with.
sl@0
   110
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   111
	   algorithm. This is for extendibility and will normally be null.
sl@0
   112
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   113
	*/
sl@0
   114
	IMPORT_C static void CreateAsymmetricVerifierL(MVerifier*& aPlugin,
sl@0
   115
												   TUid aImplementationId,
sl@0
   116
												   const CKey& aKey,
sl@0
   117
												   TUid aPaddingMode,
sl@0
   118
												   const CCryptoParams* aAlgorithmParams);
sl@0
   119
sl@0
   120
sl@0
   121
										
sl@0
   122
	/**
sl@0
   123
	   Creates a new instance of a Hash object.
sl@0
   124
sl@0
   125
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   126
	   the new hash object.
sl@0
   127
	   @param aImplementationId The UID of the hash plug-in to instantiate.
sl@0
   128
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   129
	   algorithm. This is for extendibility and will normally be null.
sl@0
   130
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   131
	*/
sl@0
   132
	IMPORT_C static void CreateHashL(MHash*& aPlugin,
sl@0
   133
									 TUid aImplementationId,
sl@0
   134
									 TUid aOperationMode,
sl@0
   135
									 const CKey* aKey,
sl@0
   136
									 const CCryptoParams* aAlgorithmParams);
sl@0
   137
sl@0
   138
	/**
sl@0
   139
	   Creates a new instance of a Random object.
sl@0
   140
sl@0
   141
	   @param aPlugin A reference to a pointer that should be set to point to the new random object.
sl@0
   142
	   @param aImplementationId The UID of the random plug-in to instantiate.
sl@0
   143
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   144
	   algorithm. This is for extendibility and will normally be null.
sl@0
   145
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   146
	*/
sl@0
   147
	IMPORT_C static void CreateRandomL(MRandom*& aPlugin,
sl@0
   148
									   TUid aImplementationId,
sl@0
   149
									   const CCryptoParams* aAlgorithmParams);
sl@0
   150
sl@0
   151
sl@0
   152
	/**
sl@0
   153
	   Creates a new instance of a key agreement system.
sl@0
   154
sl@0
   155
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   156
	   the new asymmetric key pair generator object.
sl@0
   157
	   @param aImplementationId The UID of the key agreement plug-in to instantiate.
sl@0
   158
	   @param aPrivateKey The private key to combine with the other parties public key
sl@0
   159
	   during the agreement.
sl@0
   160
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   161
	   algorithm. This is for extendibility and will normally be null.
sl@0
   162
	   @return KErrNone if successful; otherwise, a system wide error code.		   
sl@0
   163
	*/
sl@0
   164
	IMPORT_C static void CreateKeyAgreementL(MKeyAgreement*& aPlugin,
sl@0
   165
											 TUid aImplementationId,
sl@0
   166
											 const CKey& aPrivateKey,
sl@0
   167
											 const CCryptoParams* aAlgorithmParams);
sl@0
   168
sl@0
   169
	/**
sl@0
   170
	   Creates a new instance of an asymmetric key pair generator.
sl@0
   171
sl@0
   172
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   173
	   the new asymmetric key pair generator object.
sl@0
   174
	   @param aImplementationId The UID of the verifier plug-in to instantiate.
sl@0
   175
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   176
	   algorithm. This is for extendibility and will normally be null.
sl@0
   177
	   @return KErrNone if successful; otherwise, a system wide error code.
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
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   196
	*/
sl@0
   197
	IMPORT_C static void CreateSymmetricCipherL(MSymmetricCipher*& aPlugin,
sl@0
   198
												TUid aImplementationId,
sl@0
   199
												const CKey& aKey,
sl@0
   200
												TUid aCryptoMode,
sl@0
   201
												TUid aOperationMode,
sl@0
   202
												TUid aPadding,
sl@0
   203
												const CCryptoParams* aAlgorithmParams);
sl@0
   204
sl@0
   205
sl@0
   206
	/**
sl@0
   207
	   Creates a new instance of a Random object.
sl@0
   208
sl@0
   209
	   @param aPlugin A reference to a pointer that should be set to point to the new random object.
sl@0
   210
	   @param aImplementationId The UID of the random plug-in to instantiate.
sl@0
   211
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   212
	   algorithm. This is for extendibility and will normally be null.
sl@0
   213
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   214
		
sl@0
   215
	   IMPORT_C static void CreateAsyncRandomL(MAsyncRandom*& aPlugin,
sl@0
   216
	   TUid aImplementationId,
sl@0
   217
	   const CCryptoParams* aAlgorithmParams);
sl@0
   218
										
sl@0
   219
	*/										
sl@0
   220
	/**
sl@0
   221
	   Creates a new instance of a Hash object.
sl@0
   222
sl@0
   223
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   224
	   the new hash object.
sl@0
   225
	   @param aImplementationId The UID of the hash plug-in to instantiate.
sl@0
   226
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   227
	   algorithm. This is for extendibility and will normally be null.
sl@0
   228
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   229
		
sl@0
   230
	   IMPORT_C static void CreateAsyncHashL(MAsyncHash*& aPlugin,
sl@0
   231
	   TUid aImplementationId,
sl@0
   232
	   const CCryptoParams* aAlgorithmParams);
sl@0
   233
sl@0
   234
	*/
sl@0
   235
sl@0
   236
sl@0
   237
	/**
sl@0
   238
	   Creates a new instance of a symmetric cipher
sl@0
   239
sl@0
   240
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   241
	   the new asymmetric object.
sl@0
   242
	   @param aImplementationId The UID of the symmetric cipher plug-in to instantiate.
sl@0
   243
	   @param aKey The encryption/decryption key.
sl@0
   244
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   245
	   algorithm. This is for extendibility and will normally be null.
sl@0
   246
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   247
sl@0
   248
	   IMPORT_C static void CreateAsyncSymmetricCipherL(MAsyncSymmetricCipher*& aPlugin,
sl@0
   249
	   TUid aImplementationId,
sl@0
   250
	   const CKey& aKey,
sl@0
   251
	   TUid aMode,
sl@0
   252
	   TUid aPadding,
sl@0
   253
	   const CCryptoParams* aAlgorithmParams);
sl@0
   254
sl@0
   255
	*/
sl@0
   256
	/**
sl@0
   257
	   Creates a new instance of an asymmetric cipher
sl@0
   258
sl@0
   259
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   260
	   the new asymmetric cipher object.
sl@0
   261
	   @param aImplementationId The UID of the asymmetric cipher plug-in to instantiate.
sl@0
   262
	   @param aKey The encryption/decryption key.
sl@0
   263
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   264
	   algorithm. This is for extendibility and will normally be null.
sl@0
   265
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   266
		
sl@0
   267
	   IMPORT_C static void CreateAsyncAsymmetricCipherL(MAsyncAsymmetricCipher*& aPlugin,
sl@0
   268
	   TUid aImplementationId,
sl@0
   269
	   const CKey& aKey,
sl@0
   270
	   const CCryptoParams* aAlgorithmParams);
sl@0
   271
sl@0
   272
sl@0
   273
sl@0
   274
	*/
sl@0
   275
	/**
sl@0
   276
	   Creates a new instance of an asymmetric signer.
sl@0
   277
sl@0
   278
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   279
	   the new asymmetric signer object.
sl@0
   280
	   @param aImplementationId The UID of the signer plug-in to instantiate.
sl@0
   281
	   @param aKey The signing key.
sl@0
   282
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   283
	   algorithm. This is for extendibility and will normally be null.
sl@0
   284
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   285
		
sl@0
   286
	   IMPORT_C static void CreateAsyncAsymmetricSignerL(MAsyncSigner*& aPlugin,
sl@0
   287
	   TUid aImplementationId,
sl@0
   288
	   const CKey& aKey,
sl@0
   289
	   const CCryptoParams* aAlgorithmParams);
sl@0
   290
	*/
sl@0
   291
	/**
sl@0
   292
	   Creates a new instance of an asymmetric verifier.
sl@0
   293
sl@0
   294
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   295
	   the new asymmetric verifier object.
sl@0
   296
	   @param aImplementationId The UID of the verifier plug-in to instantiate.
sl@0
   297
	   @param aKey The key to verify the signature with.
sl@0
   298
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   299
	   algorithm. This is for extendibility and will normally be null.
sl@0
   300
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   301
sl@0
   302
	   IMPORT_C static void CreateAsyncAsymmetricVerifierL(MAsyncVerifier*& aPlugin,
sl@0
   303
	   TUid aImplementationId,
sl@0
   304
	   const CKey& aKey,
sl@0
   305
	   const CCryptoParams* aAlgorithmParams);
sl@0
   306
sl@0
   307
sl@0
   308
	*/
sl@0
   309
	/**
sl@0
   310
	   Creates a new instance of a key agreement system.
sl@0
   311
sl@0
   312
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   313
	   the new asymmetric key pair generator object.
sl@0
   314
	   @param aImplementationId The UID of the key agreement plug-in to instantiate.
sl@0
   315
	   @param aKey The private key to combine with the other parties public key
sl@0
   316
	   during the agreement.
sl@0
   317
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   318
	   algorithm. This is for extendibility and will normally be null.
sl@0
   319
	   @return KErrNone if successful; otherwise, a system wide error code.		   
sl@0
   320
sl@0
   321
	   IMPORT_C static void CreateAsyncKeyAgreementL(MAsyncKeyAgreement*& aPlugin,
sl@0
   322
	   TUid aImplementationId,
sl@0
   323
	   const CKey& aPrivateKey,
sl@0
   324
	   const CCryptoParams* aAlgorithmParams);
sl@0
   325
	*/
sl@0
   326
sl@0
   327
	/**
sl@0
   328
	   Creates a new instance of an asymmetric key pair generator.
sl@0
   329
sl@0
   330
	   @param aPlugin A reference to a pointer that should be set to point to 
sl@0
   331
	   the new asymmetric key pair generator object.
sl@0
   332
	   @param aImplementationId The UID of the verifier plug-in to instantiate.
sl@0
   333
	   @param aAlgorithmParams The parameters that are specific to a particular 
sl@0
   334
	   algorithm. This is for extendibility and will normally be null.
sl@0
   335
	   @return KErrNone if successful; otherwise, a system wide error code.
sl@0
   336
		
sl@0
   337
		
sl@0
   338
	   IMPORT_C static void CreateAsyncKeyPairGeneratorL(MAsyncKeyPairGenerator*& aPlugin,
sl@0
   339
	   TUid aImplementationId,
sl@0
   340
	   const CCryptoParams* aAlgorithmParams);
sl@0
   341
	*/
sl@0
   342
	};
sl@0
   343
sl@0
   344
sl@0
   345
#endif // __PLUGINENTRY_H__