os/security/cryptoplugins/cryptospiplugins/test/dummyecchwplugin/src/dummyeccsignerimpl.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/dummyeccsignerimpl.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,85 @@
     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	CDUMMYECCSIGNERIMPL_H
    1.28 +#define	CDUMMYECCSIGNERIMPL_H
    1.29 +#include <e32base.h>
    1.30 +#include <e32cmn.h>
    1.31 +#include "keys.h"
    1.32 +#include "signerplugin.h"
    1.33 +
    1.34 +namespace DummyEccHwCrypto
    1.35 +	{
    1.36 +	using namespace CryptoSpi;
    1.37 +
    1.38 +    /**
    1.39 +     * Implements the MSigner interface.
    1.40 +     * 
    1.41 +     * This should be used to create the signer object to perform 
    1.42 +     * signing using ECC.
    1.43 +     */
    1.44 +	NONSHARABLE_CLASS(CDummyECCSignerImpl) : public CBase, public MSigner
    1.45 +		{
    1.46 +	public:
    1.47 +		static CDummyECCSignerImpl* NewL(const CryptoSpi::CKey& aKey, 
    1.48 +			TUid aPaddingMode);
    1.49 +		static CDummyECCSignerImpl* NewLC(const CryptoSpi::CKey& aKey, 
    1.50 +			TUid aPaddingMode);
    1.51 +
    1.52 +		// MPlugin Interface
    1.53 +		void Close();
    1.54 +        void Reset();
    1.55 +        void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics);
    1.56 +        const CExtendedCharacteristics* GetExtendedCharacteristicsL();
    1.57 +        TAny* GetExtension(TUid aExtensionId);
    1.58 +        // End of MPlugin Interface    
    1.59 +        
    1.60 +        // MSignatureBase inteface
    1.61 +		void SetPaddingModeL(TUid aPaddingMode);
    1.62 +		void SetKeyL(const CKey& aPrivateKey);
    1.63 +		TInt GetMaximumInputLengthL() const;
    1.64 +		TInt GetMaximumOutputLengthL() const;
    1.65 +		// End of MSignatureBase inteface
    1.66 +		
    1.67 +		// MSigner interface
    1.68 +		void SignL(const TDesC8& aInput, CCryptoParams& aSignature);
    1.69 +
    1.70 +		TUid ImplementationUid() const;
    1.71 +		/// Destructor
    1.72 +		~CDummyECCSignerImpl();
    1.73 +
    1.74 +	private:
    1.75 +		CDummyECCSignerImpl(TUid aPaddingMode);
    1.76 +		void ConstructL(const CryptoSpi::CKey& aKey);
    1.77 +
    1.78 +	private:
    1.79 +	    /* The key extracted from a CKey object. This would just have 
    1.80 +         * a handle to the key stored in hardware. Hence the actual key 
    1.81 +         * would not be available to the user of this cryptoSPI plugin.
    1.82 +         */
    1.83 +        CKey* iKey;
    1.84 +	    TUid iPaddingMode;
    1.85 +		};
    1.86 +	}
    1.87 +
    1.88 +#endif //CDUMMYECCSIGNERIMPL_H