|
1 /* |
|
2 * Copyright (c) 2008 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 "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: A class that provides a decrypt operation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_PKISERVICEDECRYPTOR_H |
|
21 #define C_PKISERVICEDECRYPTOR_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <unifiedkeystore.h> |
|
25 |
|
26 #include "pkidefs.h" |
|
27 |
|
28 class MCTKeyStoreManager; |
|
29 class CLogonServices; |
|
30 |
|
31 |
|
32 /** |
|
33 * A class that decrypts data using a private key. |
|
34 * |
|
35 * This class handles the decryption of a data, which is |
|
36 * encrypted by using a public key from a stored keypair. |
|
37 */ |
|
38 class CPkiServiceDecryptor : public CActive |
|
39 { |
|
40 public: |
|
41 static CPkiServiceDecryptor* NewL(CLogonServices& aLogonServices); |
|
42 ~CPkiServiceDecryptor(); |
|
43 |
|
44 void Decrypt(const TPKIKeyIdentifier& aKeyId, |
|
45 const TDesC8& aEncryptedData, |
|
46 TPtr8& aPlainTextData, |
|
47 CUnifiedKeyStore& aUnifiedKeyStore, |
|
48 TInt aUsedKeyStore, |
|
49 TRequestStatus& aClientstatus); |
|
50 |
|
51 |
|
52 void RunL(); |
|
53 void DoCancel(); |
|
54 |
|
55 private: |
|
56 enum TDecryptorState |
|
57 { |
|
58 EDecryptorIdle = 0, |
|
59 EDecryptorGettingKey, |
|
60 EDecryptorOpeningDecryptor, |
|
61 EDecryptorDecrypting |
|
62 }; |
|
63 |
|
64 CPkiServiceDecryptor(CLogonServices& aLogonServices); |
|
65 void Cleanup(); |
|
66 |
|
67 CLogonServices& iLogonServices; |
|
68 TDecryptorState iState; |
|
69 CUnifiedKeyStore* iKeyStore; //Not owned by this class |
|
70 TInt iUsedKeyStore; |
|
71 const TDesC8* iInput; //Not owned by this class |
|
72 TPtr8* iPlainText;//Not owned by this class |
|
73 TRequestStatus* iClientStatus; |
|
74 |
|
75 MCTDecryptor* iDecryptor; |
|
76 RMPointerArray<CCTKeyInfo> iKeysList; |
|
77 |
|
78 CCTKeyInfo* iKeyInfo; |
|
79 }; |
|
80 |
|
81 #endif //C_PKISERVICEDECRYPTOR_H |