First public contribution.
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef __SIGNERIMPL_H__
20 #define __SIGNERIMPL_H__
30 #include <cryptospi/cryptospidef.h>
31 #include "signerplugin.h"
34 #include "common/inlines.h"
37 * Abstract base class for signer plug-ins.
39 namespace SoftwareCrypto
41 using namespace CryptoSpi;
43 NONSHARABLE_CLASS(CSignerImpl) : public CBase, public MSigner
46 // Override MPlugin virtual functions
48 void Reset(); // Always call reset in super-class if you override this
49 TAny* GetExtension(TUid aExtensionId);
50 void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics);
53 // Override MSignatureBase virtual functions
54 virtual void SetPaddingModeL(TUid aPaddingMode);
55 virtual void SetKeyL(const CKey& aPrivateKey);
56 virtual TInt GetMaximumInputLengthL() const;
57 virtual TInt GetMaximumOutputLengthL() const;
58 // End of MSignatureBase
68 Second phase of construction
69 @param aKey The signing key
71 virtual void ConstructL(const CKey& aKey);
74 Helper function implemented by concrete cipher sub-class that allows
75 GetCharacteristicsL to return the correct characteristics object.
76 @return The implemention uid
78 virtual TUid ImplementationUid() const = 0;
81 Store the signing key. The key length is also checked to meet export restrictions and
82 to ensure that it is appropriate for the cipher.
85 virtual void DoSetKeyL(const CKey& aKey);
88 /// the key, extracted from a CKey object
95 #endif // __SIGNERIMPL_H__