os/security/cryptoplugins/cryptospiplugins/test/dummyecchwplugin/src/pluginentry.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptoplugins/cryptospiplugins/test/dummyecchwplugin/src/pluginentry.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,141 @@
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 +#include "pluginentry.h"
1.23 +#include "pluginconfig.h"
1.24 +#include "dummyeccimpl.h"
1.25 +#include "dummyeccsignerimpl.h"
1.26 +#include "keys.h"
1.27 +#include <cryptospi/cryptospidef.h>
1.28 +
1.29 +using namespace DummyEccHwCrypto;
1.30 +
1.31 +EXPORT_C const TCharacteristics** CCryptoPluginEntry::Enumerate(
1.32 + TUid aInterface, TInt& aNumPlugins)
1.33 + {
1.34 + const TCharacteristics** ptr(0);
1.35 +
1.36 + switch (aInterface.iUid)
1.37 + {
1.38 + case KAsymmetricCipherInterface:
1.39 + {
1.40 + aNumPlugins = sizeof(KAsymmetricCipherCharacteristics)
1.41 + / sizeof(TAsymmetricCipherCharacteristics*);
1.42 + ptr
1.43 + = (const TCharacteristics**) &KAsymmetricCipherCharacteristics[0];
1.44 + }
1.45 + break;
1.46 +
1.47 + case KSignerInterface:
1.48 + {
1.49 + aNumPlugins = sizeof(KSignerCharacteristics)
1.50 + / sizeof(TAsymmetricSignatureCharacteristics*);
1.51 + ptr = (const TCharacteristics**) &KSignerCharacteristics[0];
1.52 + }
1.53 + break;
1.54 +
1.55 + default:
1.56 + aNumPlugins = 0;
1.57 + }
1.58 +
1.59 + return ptr;
1.60 + }
1.61 +
1.62 +EXPORT_C void CCryptoPluginEntry::GetExtendedCharacteristicsL(
1.63 + TUid /* aImplementationUid */, CExtendedCharacteristics*& /* aExt */)
1.64 + {
1.65 + User::Leave(KErrNotSupported);
1.66 + }
1.67 +
1.68 +EXPORT_C void CCryptoPluginEntry::CreateAsymmetricCipherL(
1.69 + MAsymmetricCipher*& aPlugin, TUid aImplementationId,
1.70 + const CKey& aKey, TUid aCryptoMode, TUid aPaddingMode,
1.71 + const CCryptoParams* /* aAlgorithmParams */)
1.72 + {
1.73 + switch (aImplementationId.iUid)
1.74 + {
1.75 + case KCryptoPluginEccCipher:
1.76 + {
1.77 + aPlugin = CDummyECCCipherImpl::NewL(aKey, aCryptoMode, aPaddingMode);
1.78 + }
1.79 + break;
1.80 +
1.81 + default:
1.82 + User::Leave(KErrNotFound);
1.83 + }
1.84 + }
1.85 +
1.86 +EXPORT_C void CCryptoPluginEntry::CreateAsymmetricSignerL(
1.87 + MSigner*& aPlugin, TUid aImplementationId,
1.88 + const CKey& aKey, TUid aPaddingMode, const CCryptoParams* /* aAlgorithmParams */)
1.89 + {
1.90 + switch (aImplementationId.iUid)
1.91 + {
1.92 + case KCryptoPluginEccSigner:
1.93 + {
1.94 + aPlugin = CDummyECCSignerImpl::NewL(aKey, aPaddingMode);
1.95 + }
1.96 + break;
1.97 +
1.98 + default:
1.99 + User::Leave(KErrNotFound);
1.100 + }
1.101 + }
1.102 +
1.103 +EXPORT_C void CCryptoPluginEntry::CreateAsymmetricVerifierL(
1.104 + MVerifier*& /*aPlugin*/, TUid /*aImplementationId*/,
1.105 + const CKey& /*aKey*/, TUid /*aPaddingMode*/, const CCryptoParams* /*aAlgorithmParams*/)
1.106 + {
1.107 + User::Leave(KErrNotFound);
1.108 + }
1.109 +
1.110 +EXPORT_C void CCryptoPluginEntry::CreateHashL(MHash*& /*aPlugin*/,
1.111 + TUid /*aImplementationId*/, TUid /*aOperationMode*/,
1.112 + const CKey* /*aKey*/, const CCryptoParams* /*aAlgorithmParams*/)
1.113 + {
1.114 + User::Leave(KErrNotFound);
1.115 + }
1.116 +
1.117 +EXPORT_C void CCryptoPluginEntry::CreateKeyAgreementL(
1.118 + MKeyAgreement*& /*aPlugin*/, TUid /*aImplementationId*/,
1.119 + const CKey& /*aPrivateKey*/, const CCryptoParams* /*aAlgorithmParams*/)
1.120 + {
1.121 + User::Leave(KErrNotFound);
1.122 + }
1.123 +
1.124 +EXPORT_C void CCryptoPluginEntry::CreateKeyPairGeneratorL(
1.125 + MKeyPairGenerator*& /*aPlugin*/, TUid /*aImplementationId*/,
1.126 + const CCryptoParams* /*aAlgorithmParams*/)
1.127 + {
1.128 + User::Leave(KErrNotFound);
1.129 + }
1.130 +
1.131 +EXPORT_C void CCryptoPluginEntry::CreateRandomL(MRandom*& /*aPlugin*/,
1.132 + TUid /*aImplementationId*/, const CCryptoParams* /*aAlgorithmParams*/)
1.133 + {
1.134 + User::Leave(KErrNotFound);
1.135 + }
1.136 +
1.137 +EXPORT_C void CCryptoPluginEntry::CreateSymmetricCipherL(
1.138 + MSymmetricCipher*& /*aPlugin*/, TUid /*aImplementationId*/, const CKey& /*aKey*/,
1.139 + TUid /*aCryptoMode*/, TUid /*aOperationMode*/, TUid /*aPadding*/,
1.140 + const CCryptoParams* /*aAlgorithmParams*/)
1.141 + {
1.142 + User::Leave(KErrNotSupported);
1.143 + }
1.144 +// End of file