os/security/crypto/weakcryptospi/inc/spi/keypairgeneratorplugin.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/crypto/weakcryptospi/inc/spi/keypairgeneratorplugin.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,83 @@
     1.4 +/*
     1.5 +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* Key Pair Generator Abstract interface
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file
    1.25 + @publishedPartner
    1.26 + @released
    1.27 +*/
    1.28 +
    1.29 +#ifndef __CRYPTOAPI_KEYPAIRGENERATORPLUGIN_H__
    1.30 +#define __CRYPTOAPI_KEYPAIRGENERATORPLUGIN_H__
    1.31 +
    1.32 +#include <cryptospi/cryptoplugin.h>
    1.33 +
    1.34 +namespace CryptoSpi
    1.35 +	{
    1.36 +	class CKeyPair;
    1.37 +	/**
    1.38 +	The Key Pair Generator definition. Intended to allow plug-ins
    1.39 +	to implement extensible Key Pair Generator functionality, and
    1.40 +	to work with all known existing Key pair Generator algorithms
    1.41 +	*/
    1.42 +
    1.43 +
    1.44 +	class MKeyPairGenerator : public MPlugin
    1.45 +		{
    1.46 +	public:
    1.47 +
    1.48 +		/**
    1.49 +		Generates a key pair
    1.50 +		@param aKeySize	The algorithm-specific metric as a number of bits
    1.51 +		@param aKeyParameters	The list of algorithm-specific parameters used by the generator to generate the key pair
    1.52 +		@param aKeyPair	The generated key pair
    1.53 +
    1.54 +		@leave ...	Any of the crypto error codes defined in 
    1.55 +  					cryptospi_errs.h or any of the system-wide error codes.
    1.56 +		*/
    1.57 +		virtual void GenerateKeyPairL(TInt aKeySize, const CCryptoParams& aKeyParameters, CKeyPair*& aKeyPair) = 0;
    1.58 +		};
    1.59 +
    1.60 +
    1.61 +	class MAsyncKeyPairGenerator : public MPlugin
    1.62 +		{
    1.63 +	public:
    1.64 +
    1.65 +		/**
    1.66 +		Generates a key pair
    1.67 +		@param aKeySize	The algorithm-specific metric as a number of bits
    1.68 +		@param aKeyParameters	The list of algorithm-specific parameters used by the generator to generate the key pair
    1.69 +		@param aKeyPair	The generated key pair
    1.70 +		@param aRequestStatus
    1.71 +
    1.72 +		@leave ...	Any of the crypto error codes defined in 
    1.73 +  					cryptospi_errs.h or any of the system-wide error codes.
    1.74 +		*/
    1.75 +		virtual void GenerateKeyPairL(TInt aKeySize, const CCryptoParams& aKeyParameters, CKeyPair*& aKeyPair, TRequestStatus& aRequestStatus) = 0;
    1.76 +
    1.77 +		/**
    1.78 +		Cancel the outstanding request
    1.79 +		*/
    1.80 +		virtual void Cancel() = 0;
    1.81 +
    1.82 +		};
    1.83 +
    1.84 +	} // namespace CryptoSpi
    1.85 +
    1.86 +#endif //__CRYPTOAPI_KEYPAIRGENERATORPLUGIN_H__