diff -r 675a964f4eb5 -r 35751d3474b7 crypto/weakcryptospi/test/tplugins/inc/rsaverifyimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crypto/weakcryptospi/test/tplugins/inc/rsaverifyimpl.h Thu Sep 10 14:01:51 2009 +0300 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __RSAVERIFYIMPL_H__ +#define __RSAVERIFYIMPL_H__ + +/** +@file +@internalComponent +@released +*/ + +#include +#include +#include + +#include "verifierimpl.h" +#include "../../../source/common/inlines.h" + +/** + * Implementation of RSA verification + */ +namespace SoftwareCrypto + { + using namespace CryptoSpi; + + NONSHARABLE_CLASS(CRSAVerifierImpl) : public CVerifierImpl + { + public: + /** + Creates an instance of an RSA verifier plug-in. + @param aKey The key + @param aPaddingMode The padding mode + @return A pointer to a CRSAVerifierImpl instance + */ + static CRSAVerifierImpl* NewL(TUid aImplementationUid, const CKey& aKey, TUid aPaddingMode); + + /** + Creates an instance of an RSA verifier plug-in. + @param aKey The key + @param aPaddingMode The padding mode + @return A pointer to a CRSAVerifierImpl instance + */ + static CRSAVerifierImpl* NewLC(TUid aImplementationUid, const CKey& aKey, TUid aPaddingMode); + + // Override CVerifierImpl virtual functions + TUid ImplementationUid() const; + // End of CVerifierImpl + + // Override MSignatureBase virtual functions + void SetPaddingModeL(TUid aPaddingMode); + void SetKeyL(const CKey& aPublicKey); + TInt GetMaximumInputLengthL() const; + TInt GetMaximumOutputLengthL() const; + // End of MSignatureBase + + // Override MSigner virtual functions + void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult); + void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature); + // End of MSigner + + const CExtendedCharacteristics* GetExtendedCharacteristicsL(); + static CExtendedCharacteristics* CreateExtendedCharacteristicsL(); + + /// Destructor + ~CRSAVerifierImpl(); + + protected: + /// Constructor + CRSAVerifierImpl(TUid aImplementationUid, TUid aPaddingMode); + + /// second phase of construction + virtual void ConstructL(const CKey& aKey); + + protected: + /// the current padding scheme + TUid iPaddingMode; + CPadding* iPadding; + + private: + + TUid iImplementationUid; + }; + } + +#endif // __RSAVERIFYIMPL_H__