sl@0: /* sl@0: * Copyright (c) 2006-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: #include sl@0: #include sl@0: #include "keys.h" sl@0: #include sl@0: sl@0: #include "signerimpl.h" sl@0: #include "pluginconfig.h" sl@0: sl@0: using namespace SoftwareCrypto; sl@0: sl@0: CSignerImpl::CSignerImpl() sl@0: { sl@0: } sl@0: sl@0: CSignerImpl::~CSignerImpl() sl@0: { sl@0: delete iKey; sl@0: } sl@0: sl@0: void CSignerImpl::Close() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CSignerImpl::Reset() sl@0: { sl@0: } sl@0: sl@0: TAny* CSignerImpl::GetExtension(TUid /*aExtensionId*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: void CSignerImpl::GetCharacteristicsL(const TAny*& aPluginCharacteristics) sl@0: { sl@0: TInt numCiphers = sizeof(KSignerCharacteristics)/sizeof(TAsymmetricSignatureCharacteristics*); sl@0: TInt32 implUid = ImplementationUid().iUid; sl@0: for (TInt i = 0; i < numCiphers; ++i) sl@0: { sl@0: if (KSignerCharacteristics[i]->cmn.iImplementationUID == implUid) sl@0: { sl@0: aPluginCharacteristics = KSignerCharacteristics[i]; sl@0: break; sl@0: } sl@0: } sl@0: } sl@0: sl@0: void CSignerImpl::DoSetKeyL(const CKey& aPrivateKey) sl@0: { sl@0: delete iKey; sl@0: iKey = CKey::NewL(aPrivateKey); sl@0: } sl@0: sl@0: void CSignerImpl::ConstructL(const CKey& aPrivateKey) sl@0: { sl@0: SetKeyL(aPrivateKey); sl@0: } sl@0: sl@0: sl@0: // Methods implemented in subclass. No coverage here. sl@0: #ifdef _BullseyeCoverage sl@0: #pragma suppress_warnings on sl@0: #pragma BullseyeCoverage off sl@0: #pragma suppress_warnings off sl@0: #endif sl@0: void CSignerImpl::SetPaddingModeL(TUid /*aPaddingMode*/) sl@0: { sl@0: // Override in subclass sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CSignerImpl::SetKeyL(const CKey& /*aPrivateKey*/) sl@0: { sl@0: // Override in subclass sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: TInt CSignerImpl::GetMaximumInputLengthL() const sl@0: { sl@0: // Override in subclass sl@0: User::Leave(KErrNotSupported); sl@0: return 0; sl@0: } sl@0: sl@0: TInt CSignerImpl::GetMaximumOutputLengthL() const sl@0: { sl@0: // Override in subclass sl@0: User::Leave(KErrNotSupported); sl@0: return 0; sl@0: }