First public contribution.
2 * Copyright (c) 2007-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 __VERIFIERIMPL_H__
20 #define __VERIFIERIMPL_H__
30 #include <cryptospi/cryptospidef.h>
32 #include "verifierplugin.h"
34 #include "common/inlines.h"
37 * Abstract base class for verifier plug-ins.
39 namespace SoftwareCrypto
41 using namespace CryptoSpi;
43 NONSHARABLE_CLASS(CVerifierImpl) : public CBase, public MVerifier
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
60 // Override MVerifier virtual functions
61 virtual void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult) = 0;
62 virtual void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature) = 0;
72 virtual void ConstructL(const CKey& aKey);
75 Helper function implemented by concrete cipher sub-class that allows
76 GetCharacteristicsL to return the correct characteristics object.
77 @return The implemention uid
79 virtual TUid ImplementationUid() const = 0;
82 Store the key to use for verifying.
83 The key length is also checked to meet export restrictions and
84 to ensure that it is appropriate for the cipher.
87 virtual void DoSetKeyL(const CKey& aKey);
95 #endif // __VERIFIERIMPL_H__