crypto/weakcryptospi/inc/spi/verifierplugin.h
changeset 8 35751d3474b7
child 30 cf642210ecb7
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
       
     1 /*
       
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * verifier abstract interface
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @publishedPartner
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef __CRYPTOAPI_VERIFIER_H__
       
    27 #define __CRYPTOAPI_VERIFIER_H__
       
    28 
       
    29 #include "signerplugin.h"
       
    30 
       
    31 namespace CryptoSpi
       
    32 	{
       
    33 
       
    34 	/**
       
    35 	The Verifier definition. Intended to allow plug-ins
       
    36 	to implement extensible signature verifier functionality, and to work with all
       
    37 	known existing  signature algorithms, e.g. DSA, RSA etc
       
    38 	*/
       
    39 
       
    40 	class MVerifier : public MSignatureBase
       
    41 		{
       
    42 	public:
       
    43 
       
    44 		/**
       
    45 		Verify the signature
       
    46 		@param aInput	The hash of the message to be verified
       
    47 		@param aSignature	The signature of the hash
       
    48 		@param aVerificationResult	Indicates the success or failure of the verification
       
    49 		*/
       
    50 		virtual void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult) = 0;
       
    51 
       
    52 		/**
       
    53 		Unsign the signature
       
    54 		@param aOutput	The unsigned hash
       
    55 		@param aSignature	The signature of the hash
       
    56 		*/
       
    57 		virtual void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature) = 0;
       
    58 		};
       
    59 
       
    60 	class MAsyncVerifier : public MSignatureBase
       
    61 		{
       
    62 	public:
       
    63 
       
    64 		/**
       
    65 		Verify the signature
       
    66 		@param aInput	The hash of the message to be verified
       
    67 		@param aSignature	The signature of the hash
       
    68 		@param aVerificationResult	Indicates the success or failure of the verification
       
    69 		@param aRequestStatus
       
    70 		*/
       
    71 		virtual void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult, TRequestStatus& aRequestStatus) = 0;
       
    72 
       
    73 		/**
       
    74 		Unsign the signature
       
    75 		@param aOutput	The unsigned hash
       
    76 		@param aSignature	The signature of the hash
       
    77 		@param aRequestStatus the request status.
       
    78 		*/
       
    79 		virtual void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature, TRequestStatus& aRequestStatus) = 0;
       
    80 		/**
       
    81 		Cancel the outstanding request
       
    82 		*/
       
    83 		virtual void Cancel() = 0;
       
    84 		};
       
    85 
       
    86 	} //namespace CryptoSpi
       
    87 
       
    88 #endif //__CRYPTOAPI_VERIFIER_H__
       
    89