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 CDUMMYECCSIGNERIMPL_H sl@0: #define CDUMMYECCSIGNERIMPL_H sl@0: #include sl@0: #include sl@0: #include "keys.h" sl@0: #include "signerplugin.h" sl@0: sl@0: namespace DummyEccHwCrypto sl@0: { sl@0: using namespace CryptoSpi; sl@0: sl@0: /** sl@0: * Implements the MSigner interface. sl@0: * sl@0: * This should be used to create the signer object to perform sl@0: * signing using ECC. sl@0: */ sl@0: NONSHARABLE_CLASS(CDummyECCSignerImpl) : public CBase, public MSigner sl@0: { sl@0: public: sl@0: static CDummyECCSignerImpl* NewL(const CryptoSpi::CKey& aKey, sl@0: TUid aPaddingMode); sl@0: static CDummyECCSignerImpl* NewLC(const CryptoSpi::CKey& aKey, sl@0: TUid aPaddingMode); sl@0: sl@0: // MPlugin Interface sl@0: void Close(); sl@0: void Reset(); sl@0: void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics); sl@0: const CExtendedCharacteristics* GetExtendedCharacteristicsL(); sl@0: TAny* GetExtension(TUid aExtensionId); sl@0: // End of MPlugin Interface sl@0: sl@0: // MSignatureBase inteface sl@0: void SetPaddingModeL(TUid aPaddingMode); sl@0: void SetKeyL(const CKey& aPrivateKey); sl@0: TInt GetMaximumInputLengthL() const; sl@0: TInt GetMaximumOutputLengthL() const; sl@0: // End of MSignatureBase inteface sl@0: sl@0: // MSigner interface sl@0: void SignL(const TDesC8& aInput, CCryptoParams& aSignature); sl@0: sl@0: TUid ImplementationUid() const; sl@0: /// Destructor sl@0: ~CDummyECCSignerImpl(); sl@0: sl@0: private: sl@0: CDummyECCSignerImpl(TUid aPaddingMode); sl@0: void ConstructL(const CryptoSpi::CKey& aKey); sl@0: sl@0: private: sl@0: /* The key extracted from a CKey object. This would just have sl@0: * a handle to the key stored in hardware. Hence the actual key sl@0: * would not be available to the user of this cryptoSPI plugin. sl@0: */ sl@0: CKey* iKey; sl@0: TUid iPaddingMode; sl@0: }; sl@0: } sl@0: sl@0: #endif //CDUMMYECCSIGNERIMPL_H