sl@0: /* sl@0: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: * @file sl@0: * @internalComponent sl@0: * @released sl@0: */ sl@0: #ifndef CPLUGINENTRY_H sl@0: #define CPLUGINENTRY_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "keys.h" sl@0: #include sl@0: #include sl@0: #include "symmetriccipherplugin.h" sl@0: #include "asymmetriccipherplugin.h" sl@0: #include "signerplugin.h" sl@0: #include "verifierplugin.h" sl@0: #include "keypairgeneratorplugin.h" sl@0: #include "keyagreementplugin.h" sl@0: sl@0: using namespace CryptoSpi; sl@0: sl@0: class CCryptoPluginEntry sl@0: { sl@0: public: sl@0: /** sl@0: * Enumerates the set of plug-ins supported by the module for a given interface sl@0: * e.g. all of the hash plug-ins. sl@0: * sl@0: * @param aInterface The UID of the plug-in interface type. If the UID is not recognised sl@0: * then the NULL pointer must be returned. sl@0: * @param aNumPlugins The number of plug-in characteristics objects in the result. sl@0: */ sl@0: IMPORT_C static const TCharacteristics** Enumerate(TUid aInterface, sl@0: TInt& aNumPlugins); sl@0: sl@0: IMPORT_C static void GetExtendedCharacteristicsL(TUid aImplementationUid, sl@0: CExtendedCharacteristics*&); sl@0: sl@0: /** sl@0: * Creates a new instance of an asymmetric cipher sl@0: * sl@0: * @param aPlugin A reference to a pointer that should be set to point to sl@0: * the new asymmetric cipher object. sl@0: * @param aImplementationId The UID of the asymmetric cipher plug-in to instantiate. sl@0: * @param aKey The encryption/decryption key. sl@0: * @param aPaddingMode The padding mode. sl@0: * @param aAlgorithmParams The parameters that are specific to a particular sl@0: * algorithm. This is for extendibility and will normally be null. sl@0: * sl@0: * @leave Function can leave with any system wide error codes in sl@0: * case of failure. sl@0: */ sl@0: IMPORT_C static void CreateAsymmetricCipherL(MAsymmetricCipher*& aPlugin, sl@0: TUid aImplementationId, const CKey& aKey, TUid aCryptoMode, sl@0: TUid aPaddingMode, const CCryptoParams* aAlgorithmParams); sl@0: sl@0: /** sl@0: * Creates a new instance of an asymmetric signer. sl@0: * sl@0: * @param aPlugin A reference to a pointer that should be set to point to sl@0: * the new asymmetric signer object. sl@0: * @param aImplementationId The UID of the signer plug-in to instantiate. sl@0: * @param aKey The signing key. sl@0: * @param aPaddingMode The padding mode. sl@0: * @param aAlgorithmParams The parameters that are specific to a particular sl@0: * algorithm. This is for extendibility and will normally be null. sl@0: * sl@0: * @leave Function can leave with any system wide error codes in sl@0: * case of failure. sl@0: */ sl@0: IMPORT_C static void CreateAsymmetricSignerL(MSigner*& aPlugin, sl@0: TUid aImplementationId, const CKey& aKey, TUid aPaddingMode, sl@0: const CCryptoParams* aAlgorithmParams); sl@0: sl@0: /** sl@0: * Creates a new instance of an asymmetric verifier. sl@0: * sl@0: * @param aPlugin A reference to a pointer that should be set to point to sl@0: * the new asymmetric verifier object. sl@0: * @param aImplementationId The UID of the verifier plug-in to instantiate. sl@0: * @param aKey The key to verify the signature with. sl@0: * @param aAlgorithmParams The parameters that are specific to a particular sl@0: * algorithm. This is for extendibility and will normally be null. sl@0: * sl@0: * @leave Function can leave with any system wide error codes in sl@0: * case of failure. sl@0: */ sl@0: IMPORT_C static void CreateAsymmetricVerifierL(MVerifier*& aPlugin, sl@0: TUid aImplementationId, sl@0: const CKey& aKey, sl@0: TUid aPaddingMode, sl@0: const CCryptoParams* aAlgorithmParams); sl@0: sl@0: /** sl@0: * Creates a new instance of a Hash object. sl@0: * sl@0: * @param aPlugin A reference to a pointer that should be set to point to sl@0: * the new hash object. sl@0: * @param aImplementationId The UID of the hash plug-in to instantiate. sl@0: * @param aAlgorithmParams The parameters that are specific to a particular sl@0: * algorithm. This is for extendibility and will normally be null. sl@0: * sl@0: * @leave Function can leave with any system wide error codes in sl@0: * case of failure. sl@0: */ sl@0: IMPORT_C static void CreateHashL(MHash*& aPlugin, sl@0: TUid aImplementationId, sl@0: TUid aOperationMode, sl@0: const CKey* aKey, sl@0: const CCryptoParams* aAlgorithmParams); sl@0: sl@0: /** sl@0: * Creates a new instance of a Random object. sl@0: * sl@0: * @param aPlugin A reference to a pointer that should be set to point to the new random object. sl@0: * @param aImplementationId The UID of the random plug-in to instantiate. sl@0: * @param aAlgorithmParams The parameters that are specific to a particular sl@0: * algorithm. This is for extendibility and will normally be null. sl@0: * sl@0: * @leave Function can leave with any system wide error codes in sl@0: * case of failure. sl@0: */ sl@0: IMPORT_C static void CreateRandomL(MRandom*& aPlugin, sl@0: TUid aImplementationId, sl@0: const CCryptoParams* aAlgorithmParams); sl@0: sl@0: sl@0: /** sl@0: * Creates a new instance of a key agreement system. sl@0: * sl@0: * @param aPlugin A reference to a pointer that should be set to point to sl@0: * the new asymmetric key pair generator object. sl@0: * @param aImplementationId The UID of the key agreement plug-in to instantiate. sl@0: * @param aPrivateKey The private key to combine with the other parties public key sl@0: * during the agreement. sl@0: * @param aAlgorithmParams The parameters that are specific to a particular sl@0: * algorithm. This is for extendibility and will normally be null. sl@0: * sl@0: * @leave Function can leave with any system wide error codes in sl@0: * case of failure. sl@0: */ sl@0: IMPORT_C static void CreateKeyAgreementL(MKeyAgreement*& aPlugin, sl@0: TUid aImplementationId, sl@0: const CKey& aPrivateKey, sl@0: const CCryptoParams* aAlgorithmParams); sl@0: sl@0: /** sl@0: * Creates a new instance of an asymmetric key pair generator. sl@0: * sl@0: * @param aPlugin A reference to a pointer that should be set to point to sl@0: * the new asymmetric key pair generator object. sl@0: * @param aImplementationId The UID of the verifier plug-in to instantiate. sl@0: * @param aAlgorithmParams The parameters that are specific to a particular sl@0: * algorithm. This is for extendibility and will normally be null. sl@0: * sl@0: * @leave Function can leave with any system wide error codes in sl@0: * case of failure. sl@0: */ sl@0: IMPORT_C static void CreateKeyPairGeneratorL(MKeyPairGenerator*& aPlugin, sl@0: TUid aImplementationId, sl@0: const CCryptoParams* aAlgorithmParams); sl@0: sl@0: /** sl@0: * Creates a new instance of a symmetric cipher sl@0: * sl@0: * @param aPlugin A reference to a pointer that should be set to point to sl@0: * the new asymmetric object. sl@0: * @param aImplementationId The UID of the symmetric cipher plug-in to instantiate. sl@0: * @param aKey The encryption/decryption key. sl@0: * @param aCryptoMode Encrypt or Decrypt. sl@0: * @param aOperationMode the block cipher mode to use ECB, CBC, CTR etc sl@0: * @param aPadding the padding scheme to use. sl@0: * @param aAlgorithmParams The parameters that are specific to a particular sl@0: * algorithm. This is for extendibility and will normally be null. sl@0: * sl@0: * @leave Function can leave with any system wide error codes in sl@0: * case of failure. sl@0: */ sl@0: IMPORT_C static void CreateSymmetricCipherL(MSymmetricCipher*& aPlugin, sl@0: TUid aImplementationId, sl@0: const CKey& aKey, sl@0: TUid aCryptoMode, sl@0: TUid aOperationMode, sl@0: TUid aPadding, sl@0: const CCryptoParams* aAlgorithmParams); sl@0: sl@0: sl@0: }; sl@0: sl@0: #endif // CPLUGINENTRY_H