crypto/weakcryptospi/inc/spi/verifierplugin.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 10 Sep 2009 14:01:51 +0300
changeset 8 35751d3474b7
child 30 cf642210ecb7
permissions -rw-r--r--
Revision: 200935

/*
* 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: 
* verifier abstract interface
*
*/


/**
 @file
 @publishedPartner
 @released
*/

#ifndef __CRYPTOAPI_VERIFIER_H__
#define __CRYPTOAPI_VERIFIER_H__

#include "signerplugin.h"

namespace CryptoSpi
	{

	/**
	The Verifier definition. Intended to allow plug-ins
	to implement extensible signature verifier functionality, and to work with all
	known existing  signature algorithms, e.g. DSA, RSA etc
	*/

	class MVerifier : public MSignatureBase
		{
	public:

		/**
		Verify the signature
		@param aInput	The hash of the message to be verified
		@param aSignature	The signature of the hash
		@param aVerificationResult	Indicates the success or failure of the verification
		*/
		virtual void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult) = 0;

		/**
		Unsign the signature
		@param aOutput	The unsigned hash
		@param aSignature	The signature of the hash
		*/
		virtual void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature) = 0;
		};

	class MAsyncVerifier : public MSignatureBase
		{
	public:

		/**
		Verify the signature
		@param aInput	The hash of the message to be verified
		@param aSignature	The signature of the hash
		@param aVerificationResult	Indicates the success or failure of the verification
		@param aRequestStatus
		*/
		virtual void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult, TRequestStatus& aRequestStatus) = 0;

		/**
		Unsign the signature
		@param aOutput	The unsigned hash
		@param aSignature	The signature of the hash
		@param aRequestStatus the request status.
		*/
		virtual void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature, TRequestStatus& aRequestStatus) = 0;
		/**
		Cancel the outstanding request
		*/
		virtual void Cancel() = 0;
		};

	} //namespace CryptoSpi

#endif //__CRYPTOAPI_VERIFIER_H__