sl@0: /* sl@0: * Copyright (c) 2007-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: #include "pluginentry.h" sl@0: #include "pluginconfig.h" sl@0: #include "keys.h" sl@0: #include "randomimpl.h" sl@0: #include "rijndaelimpl.h" sl@0: #include "randomimpl.h" sl@0: #include sl@0: sl@0: sl@0: using namespace HwCrypto; sl@0: sl@0: EXPORT_C const TCharacteristics** CCryptoPluginEntry::Enumerate(TUid aInterface, TInt& aNumPlugins) sl@0: { sl@0: const TCharacteristics** ptr(0); sl@0: aNumPlugins = 0; sl@0: sl@0: switch (aInterface.iUid) sl@0: { sl@0: case KRandomInterface: sl@0: { sl@0: aNumPlugins=sizeof(KRandomCharacteristics)/sizeof(TRandomCharacteristics*); sl@0: ptr= (const TCharacteristics**) &KRandomCharacteristics[0]; sl@0: } sl@0: break; sl@0: sl@0: case KSymmetricCipherInterface: sl@0: { sl@0: aNumPlugins=sizeof(KSymmetricCipherCharacteristics)/sizeof(TSymmetricCipherCharacteristics*); sl@0: ptr = (const TCharacteristics**) &KSymmetricCipherCharacteristics[0]; sl@0: } sl@0: break; sl@0: sl@0: default:; sl@0: } sl@0: sl@0: return ptr; sl@0: } sl@0: sl@0: EXPORT_C void CCryptoPluginEntry::GetExtendedCharacteristicsL(TUid aImplementationUid, CExtendedCharacteristics*& aExt) sl@0: { sl@0: switch (aImplementationUid.iUid) sl@0: { sl@0: case KCryptoPluginRandom: sl@0: aExt=CRandomImpl::StaticGetExtendedCharacteristicsL(); sl@0: break; sl@0: case KCryptoPluginAes: sl@0: aExt=CH4RijndaelImpl::StaticGetExtendedCharacteristicsL(); sl@0: break; sl@0: default: sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: } sl@0: sl@0: EXPORT_C void CCryptoPluginEntry::CreateAsymmetricCipherL(MAsymmetricCipher*& /*aPlugin*/, sl@0: TUid /*aImplementationId*/, sl@0: const CKey& /*aKey*/, sl@0: TUid /*aCryptoMode*/, sl@0: TUid /*aPaddingMode*/, sl@0: const CCryptoParams* /*aAlgorithmParams*/) sl@0: { sl@0: User::Leave(KErrNotFound); sl@0: } sl@0: sl@0: sl@0: sl@0: EXPORT_C void CCryptoPluginEntry::CreateAsymmetricSignerL(MSigner*& /*aPlugin*/, sl@0: TUid /*aImplementationId*/, sl@0: const CKey& /*aKey*/, sl@0: TUid /*aPaddingMode*/, sl@0: const CCryptoParams* /*aAlgorithmParams*/) sl@0: { sl@0: User::Leave(KErrNotFound); sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CCryptoPluginEntry::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: User::Leave(KErrNotFound); sl@0: } sl@0: sl@0: EXPORT_C void CCryptoPluginEntry::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: User::Leave(KErrNotFound); sl@0: } sl@0: sl@0: EXPORT_C void CCryptoPluginEntry::CreateKeyAgreementL(MKeyAgreement*& /*aPlugin*/, sl@0: TUid /*aImplementationId*/, sl@0: const CKey& /*aPrivateKey*/, sl@0: const CCryptoParams* /*aAlgorithmParams*/) sl@0: { sl@0: User::Leave(KErrNotFound); sl@0: } sl@0: sl@0: EXPORT_C void CCryptoPluginEntry::CreateKeyPairGeneratorL(MKeyPairGenerator*& /*aPlugin*/, sl@0: TUid /*aImplementationId*/, sl@0: const CCryptoParams* /*aAlgorithmParams*/) sl@0: { sl@0: User::Leave(KErrNotFound); sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CCryptoPluginEntry::CreateRandomL(MRandom*& aPlugin, sl@0: TUid /*aImplementationId*/, sl@0: const CCryptoParams* /*aAlgorithmParams*/) sl@0: { sl@0: aPlugin=CRandomImpl::NewL(); sl@0: //User::Leave(KErrNotFound); sl@0: } sl@0: sl@0: EXPORT_C void CCryptoPluginEntry::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: switch (aImplementationId.iUid) sl@0: { sl@0: case KCryptoPluginAes: sl@0: { sl@0: aPlugin=CH4RijndaelImpl::NewL(aKey, aCryptoMode, aOperationMode, aPadding); sl@0: //User::Leave(KErrNotFound); sl@0: } sl@0: break; sl@0: sl@0: default: sl@0: User::Leave(KErrNotFound); sl@0: } sl@0: } sl@0: sl@0: // End of file