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 __RSAVERIFYIMPL_H__
20 #define __RSAVERIFYIMPL_H__
30 #include <cryptospi/cryptospidef.h>
32 #include "verifierimpl.h"
33 #include "common/inlines.h"
36 * Implementation of RSA verification
38 namespace SoftwareCrypto
40 using namespace CryptoSpi;
42 NONSHARABLE_CLASS(CRSAVerifierImpl) : public CVerifierImpl
46 Creates an instance of an RSA verifier plug-in.
48 @param aPaddingMode The padding mode
49 @return A pointer to a CRSAVerifierImpl instance
51 static CRSAVerifierImpl* NewL(const CKey& aKey, TUid aPaddingMode);
54 Creates an instance of an RSA verifier plug-in.
56 @param aPaddingMode The padding mode
57 @return A pointer to a CRSAVerifierImpl instance
59 static CRSAVerifierImpl* NewLC(const CKey& aKey, TUid aPaddingMode);
61 // Override CVerifierImpl virtual functions
62 TUid ImplementationUid() const;
63 // End of CVerifierImpl
65 // Override MSignatureBase virtual functions
66 void SetPaddingModeL(TUid aPaddingMode);
67 void SetKeyL(const CKey& aPublicKey);
68 TInt GetMaximumInputLengthL() const;
69 TInt GetMaximumOutputLengthL() const;
70 // End of MSignatureBase
72 // Override MSigner virtual functions
73 void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult);
74 void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature);
77 const CExtendedCharacteristics* GetExtendedCharacteristicsL();
78 static CExtendedCharacteristics* CreateExtendedCharacteristicsL();
85 CRSAVerifierImpl(TUid aPaddingMode);
87 /// second phase of construction
88 virtual void ConstructL(const CKey& aKey);
91 /// the current padding scheme
97 #endif // __RSAVERIFYIMPL_H__