|
1 /* |
|
2 * Copyright (c) 2005 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: Wrapper class for Symbian's Security Framework's calls. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SECMODUISYNCWRAPPER_H |
|
20 #define SECMODUISYNCWRAPPER_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <f32file.h> |
|
26 #include <ct/rcpointerarray.h> |
|
27 #include <ct/rmpointerarray.h> |
|
28 |
|
29 // FORWARD DECLERATIONS |
|
30 class MCTToken; |
|
31 class MCTAuthenticationObject; |
|
32 class MCTAuthenticationObjectList; |
|
33 class CUnifiedKeyStore; |
|
34 class MCTTokenInterface; |
|
35 class CCTKeyInfo; |
|
36 class TCTKeyAttributeFilter; |
|
37 class MCTKeyStore; |
|
38 class TCTTokenObjectHandle; |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * class CSecModUISyncWrapper |
|
43 * Wrapper class for Symbian's Security Framework's calls. |
|
44 * |
|
45 * @lib wimmanui.dll |
|
46 * @since Series 60 2.0 |
|
47 */ |
|
48 class CSecModUISyncWrapper : public CActive |
|
49 { |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 */ |
|
55 static CSecModUISyncWrapper* NewLC(); |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 */ |
|
60 static CSecModUISyncWrapper* NewL(); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CSecModUISyncWrapper(); |
|
66 |
|
67 public: // New functions |
|
68 |
|
69 /** |
|
70 * TInt ListL |
|
71 * @since S60 2.0 |
|
72 * @param aStore reference to store where operation is done. |
|
73 * @param aArray certificates are stored here. |
|
74 * @param aFilter Information on what kind certificates are looked. |
|
75 * @return TInt Status Symbian's API's call. |
|
76 */ |
|
77 |
|
78 |
|
79 TInt Initialize(CUnifiedKeyStore& aKeyStore ); |
|
80 |
|
81 TInt OpenWIM(); |
|
82 |
|
83 TInt GetAuthObjectInterface( |
|
84 MCTToken& aToken, |
|
85 MCTTokenInterface*& aTokenInterface); |
|
86 |
|
87 TInt ListAuthObjects( |
|
88 MCTAuthenticationObjectList& aAuthObjList, |
|
89 RMPointerArray<MCTAuthenticationObject>& aAuthObjects ); |
|
90 |
|
91 TInt ListKeys( |
|
92 MCTKeyStore& aKeyStore, |
|
93 RMPointerArray<CCTKeyInfo>& aKeysInfos, |
|
94 const TCTKeyAttributeFilter& aFilter); |
|
95 |
|
96 TInt DeleteKey( |
|
97 CUnifiedKeyStore& aKeyStore, |
|
98 TCTTokenObjectHandle aHandle); |
|
99 |
|
100 TInt ChangeReferenceData( MCTAuthenticationObject& aAuthObject ); |
|
101 |
|
102 TInt UnblockAuthObject( MCTAuthenticationObject& aAuthObject ); |
|
103 |
|
104 TInt EnableAuthObject( MCTAuthenticationObject& aAuthObject ); |
|
105 |
|
106 TInt DisableAuthObject( MCTAuthenticationObject& aAuthObject ); |
|
107 |
|
108 TInt CloseAuthObject( MCTAuthenticationObject& aAuthObject ); |
|
109 |
|
110 TInt TimeRemaining( MCTAuthenticationObject& aAuthObject, TInt& aStime ); |
|
111 |
|
112 protected: |
|
113 |
|
114 void DoCancel(); |
|
115 void RunL(); |
|
116 |
|
117 private: |
|
118 |
|
119 CSecModUISyncWrapper(); |
|
120 void HandleErrorL(); |
|
121 |
|
122 private: //Data |
|
123 |
|
124 // Internal operation states. |
|
125 enum TOperation |
|
126 { |
|
127 EOperationInit, |
|
128 EOperationGetAOInterface, |
|
129 EOperationListAOs, |
|
130 EOperationListKeys, |
|
131 EOperationDelKey, |
|
132 EOperationChangeReferenceData, |
|
133 EOperationUnblockAO, |
|
134 EOperationEnableAO, |
|
135 EOperationDisableAO, |
|
136 EOperationCloseAO, |
|
137 EOperationTimeRemAO, |
|
138 EOperationNone |
|
139 }; |
|
140 |
|
141 // For wrapping asynchronous calls. |
|
142 CActiveSchedulerWait iWait; |
|
143 // Internal state of operation. |
|
144 TOperation iOperation; |
|
145 |
|
146 // CT objects |
|
147 TAny* iObject; |
|
148 }; |
|
149 |
|
150 #endif // SECMODUISYNCWRAPPER_H |
|
151 |
|
152 // End of File |