os/security/cryptoplugins/cryptospiplugins/test/dummyecchwplugin/src/pluginentry.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptoplugins/cryptospiplugins/test/dummyecchwplugin/src/pluginentry.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,210 @@
     1.4 +/*
     1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +/**
    1.23 + * @file
    1.24 + * @internalComponent
    1.25 + * @released
    1.26 + */
    1.27 +#ifndef CPLUGINENTRY_H
    1.28 +#define CPLUGINENTRY_H
    1.29 +
    1.30 +#include <cryptospi/cryptoparams.h>
    1.31 +#include <e32cmn.h>
    1.32 +#include <cryptospi/cryptospidef.h>
    1.33 +#include "keys.h"
    1.34 +#include <cryptospi/hashplugin.h>
    1.35 +#include <cryptospi/randomplugin.h>
    1.36 +#include "symmetriccipherplugin.h"
    1.37 +#include "asymmetriccipherplugin.h"
    1.38 +#include "signerplugin.h"
    1.39 +#include "verifierplugin.h"
    1.40 +#include "keypairgeneratorplugin.h"
    1.41 +#include "keyagreementplugin.h"
    1.42 +
    1.43 +using namespace CryptoSpi;
    1.44 +
    1.45 +class CCryptoPluginEntry
    1.46 +    {
    1.47 +public:
    1.48 +    /**
    1.49 +     * Enumerates the set of plug-ins supported by the module for a given interface
    1.50 +     * e.g. all of the hash plug-ins.
    1.51 +     *
    1.52 +     * @param aInterface The UID of the plug-in interface type. If the UID is not recognised
    1.53 +     * then the NULL pointer must be returned.
    1.54 +     * @param aNumPlugins The number of plug-in characteristics objects in the result.
    1.55 +     */
    1.56 +    IMPORT_C static const TCharacteristics** Enumerate(TUid aInterface,
    1.57 +            TInt& aNumPlugins);
    1.58 +
    1.59 +    IMPORT_C static void GetExtendedCharacteristicsL(TUid aImplementationUid,
    1.60 +            CExtendedCharacteristics*&);
    1.61 +    
    1.62 +    /**
    1.63 +     * Creates a new instance of an asymmetric cipher
    1.64 +     *
    1.65 +     * @param aPlugin A reference to a pointer that should be set to point to 
    1.66 +     * the new asymmetric cipher object.
    1.67 +     * @param aImplementationId The UID of the asymmetric cipher plug-in to instantiate.
    1.68 +     * @param aKey The encryption/decryption key.
    1.69 +     * @param aPaddingMode The padding mode.
    1.70 +     * @param aAlgorithmParams The parameters that are specific to a particular 
    1.71 +     * algorithm. This is for extendibility and will normally be null.
    1.72 +     * 
    1.73 +     * @leave Function can leave with any system wide error codes in 
    1.74 +     * case of failure.
    1.75 +     */
    1.76 +    IMPORT_C static void CreateAsymmetricCipherL(MAsymmetricCipher*& aPlugin,
    1.77 +            TUid aImplementationId, const CKey& aKey, TUid aCryptoMode,
    1.78 +            TUid aPaddingMode, const CCryptoParams* aAlgorithmParams);
    1.79 +
    1.80 +    /**
    1.81 +     * Creates a new instance of an asymmetric signer.
    1.82 +     *
    1.83 +     * @param aPlugin A reference to a pointer that should be set to point to 
    1.84 +     * the new asymmetric signer object.
    1.85 +     * @param aImplementationId The UID of the signer plug-in to instantiate.
    1.86 +     * @param aKey The signing key.
    1.87 +     * @param aPaddingMode The padding mode.
    1.88 +     * @param aAlgorithmParams The parameters that are specific to a particular 
    1.89 +     * algorithm. This is for extendibility and will normally be null.
    1.90 +     * 
    1.91 +     * @leave Function can leave with any system wide error codes in 
    1.92 +     * case of failure.
    1.93 +     */
    1.94 +    IMPORT_C static void CreateAsymmetricSignerL(MSigner*& aPlugin,
    1.95 +            TUid aImplementationId, const CKey& aKey, TUid aPaddingMode,
    1.96 +            const CCryptoParams* aAlgorithmParams);
    1.97 +
    1.98 +    /**
    1.99 +     * Creates a new instance of an asymmetric verifier.
   1.100 +     *
   1.101 +     * @param aPlugin A reference to a pointer that should be set to point to 
   1.102 +     * the new asymmetric verifier object.
   1.103 +     * @param aImplementationId The UID of the verifier plug-in to instantiate.
   1.104 +     * @param aKey The key to verify the signature with.
   1.105 +     * @param aAlgorithmParams The parameters that are specific to a particular 
   1.106 +     * algorithm. This is for extendibility and will normally be null.
   1.107 +     *
   1.108 +     * @leave Function can leave with any system wide error codes in 
   1.109 +     * case of failure.
   1.110 +     */
   1.111 +    IMPORT_C static void CreateAsymmetricVerifierL(MVerifier*& aPlugin,
   1.112 +                                                   TUid aImplementationId,
   1.113 +                                                   const CKey& aKey,
   1.114 +                                                   TUid aPaddingMode,
   1.115 +                                                   const CCryptoParams* aAlgorithmParams);
   1.116 +
   1.117 +    /**
   1.118 +     * Creates a new instance of a Hash object.
   1.119 +     *
   1.120 +     * @param aPlugin A reference to a pointer that should be set to point to 
   1.121 +     * the new hash object.
   1.122 +     * @param aImplementationId The UID of the hash plug-in to instantiate.
   1.123 +     * @param aAlgorithmParams The parameters that are specific to a particular 
   1.124 +     * algorithm. This is for extendibility and will normally be null.
   1.125 +     *
   1.126 +     * @leave Function can leave with any system wide error codes in 
   1.127 +     * case of failure.
   1.128 +     */
   1.129 +    IMPORT_C static void CreateHashL(MHash*& aPlugin,
   1.130 +                                     TUid aImplementationId,
   1.131 +                                     TUid aOperationMode,
   1.132 +                                     const CKey* aKey,
   1.133 +                                     const CCryptoParams* aAlgorithmParams);
   1.134 +
   1.135 +    /**
   1.136 +     * Creates a new instance of a Random object.
   1.137 +     *
   1.138 +     * @param aPlugin A reference to a pointer that should be set to point to the new random object.
   1.139 +     * @param aImplementationId The UID of the random plug-in to instantiate.
   1.140 +     * @param aAlgorithmParams The parameters that are specific to a particular 
   1.141 +     * algorithm. This is for extendibility and will normally be null.
   1.142 +     *
   1.143 +     * @leave Function can leave with any system wide error codes in 
   1.144 +     * case of failure.
   1.145 +     */
   1.146 +    IMPORT_C static void CreateRandomL(MRandom*& aPlugin,
   1.147 +                                       TUid aImplementationId,
   1.148 +                                       const CCryptoParams* aAlgorithmParams);
   1.149 +
   1.150 +
   1.151 +    /**
   1.152 +     * Creates a new instance of a key agreement system.
   1.153 +     *
   1.154 +     * @param aPlugin A reference to a pointer that should be set to point to 
   1.155 +     * the new asymmetric key pair generator object.
   1.156 +     * @param aImplementationId The UID of the key agreement plug-in to instantiate.
   1.157 +     * @param aPrivateKey The private key to combine with the other parties public key
   1.158 +     * during the agreement.
   1.159 +     * @param aAlgorithmParams The parameters that are specific to a particular 
   1.160 +     * algorithm. This is for extendibility and will normally be null.
   1.161 +     *
   1.162 +     * @leave Function can leave with any system wide error codes in 
   1.163 +     * case of failure.
   1.164 +     */
   1.165 +    IMPORT_C static void CreateKeyAgreementL(MKeyAgreement*& aPlugin,
   1.166 +                                             TUid aImplementationId,
   1.167 +                                             const CKey& aPrivateKey,
   1.168 +                                             const CCryptoParams* aAlgorithmParams);
   1.169 +
   1.170 +    /**
   1.171 +     * Creates a new instance of an asymmetric key pair generator.
   1.172 +     *
   1.173 +     * @param aPlugin A reference to a pointer that should be set to point to 
   1.174 +     * the new asymmetric key pair generator object.
   1.175 +     * @param aImplementationId The UID of the verifier plug-in to instantiate.
   1.176 +     * @param aAlgorithmParams The parameters that are specific to a particular 
   1.177 +     * algorithm. This is for extendibility and will normally be null.
   1.178 +     *
   1.179 +     * @leave Function can leave with any system wide error codes in 
   1.180 +     * case of failure.
   1.181 +     */
   1.182 +    IMPORT_C static void CreateKeyPairGeneratorL(MKeyPairGenerator*& aPlugin,
   1.183 +                                                 TUid aImplementationId,
   1.184 +                                                 const CCryptoParams* aAlgorithmParams);
   1.185 +                                        
   1.186 +    /**
   1.187 +     * Creates a new instance of a symmetric cipher
   1.188 +     *
   1.189 +     * @param aPlugin A reference to a pointer that should be set to point to 
   1.190 +     * the new asymmetric object.
   1.191 +     * @param aImplementationId The UID of the symmetric cipher plug-in to instantiate.
   1.192 +     * @param aKey The encryption/decryption key.
   1.193 +     * @param aCryptoMode Encrypt or Decrypt.
   1.194 +     * @param aOperationMode the block cipher mode to use ECB, CBC, CTR etc
   1.195 +     * @param aPadding the padding scheme to use.
   1.196 +     * @param aAlgorithmParams The parameters that are specific to a particular 
   1.197 +     * algorithm. This is for extendibility and will normally be null.
   1.198 +     *
   1.199 +     * @leave Function can leave with any system wide error codes in 
   1.200 +     * case of failure.
   1.201 +     */
   1.202 +    IMPORT_C static void CreateSymmetricCipherL(MSymmetricCipher*& aPlugin,
   1.203 +                                                TUid aImplementationId,
   1.204 +                                                const CKey& aKey,
   1.205 +                                                TUid aCryptoMode,
   1.206 +                                                TUid aOperationMode,
   1.207 +                                                TUid aPadding,
   1.208 +                                                const CCryptoParams* aAlgorithmParams);
   1.209 +
   1.210 +
   1.211 +    };
   1.212 +
   1.213 +#endif // CPLUGINENTRY_H