os/security/crypto/weakcryptospi/inc/spi/keypairgeneratorplugin.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 * Key Pair Generator Abstract interface
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file
    22  @publishedPartner
    23  @released
    24 */
    25 
    26 #ifndef __CRYPTOAPI_KEYPAIRGENERATORPLUGIN_H__
    27 #define __CRYPTOAPI_KEYPAIRGENERATORPLUGIN_H__
    28 
    29 #include <cryptospi/cryptoplugin.h>
    30 
    31 namespace CryptoSpi
    32 	{
    33 	class CKeyPair;
    34 	/**
    35 	The Key Pair Generator definition. Intended to allow plug-ins
    36 	to implement extensible Key Pair Generator functionality, and
    37 	to work with all known existing Key pair Generator algorithms
    38 	*/
    39 
    40 
    41 	class MKeyPairGenerator : public MPlugin
    42 		{
    43 	public:
    44 
    45 		/**
    46 		Generates a key pair
    47 		@param aKeySize	The algorithm-specific metric as a number of bits
    48 		@param aKeyParameters	The list of algorithm-specific parameters used by the generator to generate the key pair
    49 		@param aKeyPair	The generated key pair
    50 
    51 		@leave ...	Any of the crypto error codes defined in 
    52   					cryptospi_errs.h or any of the system-wide error codes.
    53 		*/
    54 		virtual void GenerateKeyPairL(TInt aKeySize, const CCryptoParams& aKeyParameters, CKeyPair*& aKeyPair) = 0;
    55 		};
    56 
    57 
    58 	class MAsyncKeyPairGenerator : public MPlugin
    59 		{
    60 	public:
    61 
    62 		/**
    63 		Generates a key pair
    64 		@param aKeySize	The algorithm-specific metric as a number of bits
    65 		@param aKeyParameters	The list of algorithm-specific parameters used by the generator to generate the key pair
    66 		@param aKeyPair	The generated key pair
    67 		@param aRequestStatus
    68 
    69 		@leave ...	Any of the crypto error codes defined in 
    70   					cryptospi_errs.h or any of the system-wide error codes.
    71 		*/
    72 		virtual void GenerateKeyPairL(TInt aKeySize, const CCryptoParams& aKeyParameters, CKeyPair*& aKeyPair, TRequestStatus& aRequestStatus) = 0;
    73 
    74 		/**
    75 		Cancel the outstanding request
    76 		*/
    77 		virtual void Cancel() = 0;
    78 
    79 		};
    80 
    81 	} // namespace CryptoSpi
    82 
    83 #endif //__CRYPTOAPI_KEYPAIRGENERATORPLUGIN_H__