|
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 virtual void GenerateKeyPairL(TInt aKeySize, const CCryptoParams& aKeyParameters, CKeyPair*& aKeyPair) = 0; |
|
52 }; |
|
53 |
|
54 |
|
55 class MAsyncKeyPairGenerator : public MPlugin |
|
56 { |
|
57 public: |
|
58 |
|
59 /** |
|
60 Generates a key pair |
|
61 @param aKeySize The algorithm-specific metric as a number of bits |
|
62 @param aKeyParameters The list of algorithm-specific parameters used by the generator to generate the key pair |
|
63 @param aKeyPair The generated key pair |
|
64 @param aRequestStatus |
|
65 */ |
|
66 virtual void GenerateKeyPairL(TInt aKeySize, const CCryptoParams& aKeyParameters, CKeyPair*& aKeyPair, TRequestStatus& aRequestStatus) = 0; |
|
67 |
|
68 /** |
|
69 Cancel the outstanding request |
|
70 */ |
|
71 virtual void Cancel() = 0; |
|
72 |
|
73 }; |
|
74 |
|
75 } // namespace CryptoSpi |
|
76 |
|
77 #endif //__CRYPTOAPI_KEYPAIRGENERATORPLUGIN_H__ |