sl@0: /* sl@0: * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Key Pair Generator Abstract interface sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __CRYPTOAPI_KEYPAIRGENERATORPLUGIN_H__ sl@0: #define __CRYPTOAPI_KEYPAIRGENERATORPLUGIN_H__ sl@0: sl@0: #include <cryptospi/cryptoplugin.h> sl@0: sl@0: namespace CryptoSpi sl@0: { sl@0: class CKeyPair; sl@0: /** sl@0: The Key Pair Generator definition. Intended to allow plug-ins sl@0: to implement extensible Key Pair Generator functionality, and sl@0: to work with all known existing Key pair Generator algorithms sl@0: */ sl@0: sl@0: sl@0: class MKeyPairGenerator : public MPlugin sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Generates a key pair sl@0: @param aKeySize The algorithm-specific metric as a number of bits sl@0: @param aKeyParameters The list of algorithm-specific parameters used by the generator to generate the key pair sl@0: @param aKeyPair The generated key pair sl@0: sl@0: @leave ... Any of the crypto error codes defined in sl@0: cryptospi_errs.h or any of the system-wide error codes. sl@0: */ sl@0: virtual void GenerateKeyPairL(TInt aKeySize, const CCryptoParams& aKeyParameters, CKeyPair*& aKeyPair) = 0; sl@0: }; sl@0: sl@0: sl@0: class MAsyncKeyPairGenerator : public MPlugin sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Generates a key pair sl@0: @param aKeySize The algorithm-specific metric as a number of bits sl@0: @param aKeyParameters The list of algorithm-specific parameters used by the generator to generate the key pair sl@0: @param aKeyPair The generated key pair sl@0: @param aRequestStatus sl@0: sl@0: @leave ... Any of the crypto error codes defined in sl@0: cryptospi_errs.h or any of the system-wide error codes. sl@0: */ sl@0: virtual void GenerateKeyPairL(TInt aKeySize, const CCryptoParams& aKeyParameters, CKeyPair*& aKeyPair, TRequestStatus& aRequestStatus) = 0; sl@0: sl@0: /** sl@0: Cancel the outstanding request sl@0: */ sl@0: virtual void Cancel() = 0; sl@0: sl@0: }; sl@0: sl@0: } // namespace CryptoSpi sl@0: sl@0: #endif //__CRYPTOAPI_KEYPAIRGENERATORPLUGIN_H__