|
1 /* |
|
2 * Copyright (c) 2006 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: The header file of DevCertKeyStoreSession |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __DEVTOKENKEYSTORESESSION_H__ |
|
21 #define __DEVTOKENKEYSTORESESSION_H__ |
|
22 |
|
23 #include "DevTokenServer.h" |
|
24 |
|
25 class CDevCertKeyStoreConduit; |
|
26 class CDevCertOpenedKeySrv; |
|
27 |
|
28 /** |
|
29 * Encapsulates an opened key object and its handle. |
|
30 */ |
|
31 struct TObjectIndex |
|
32 { |
|
33 TInt iHandle; |
|
34 CDevCertOpenedKeySrv* iObject; |
|
35 }; |
|
36 |
|
37 /** |
|
38 * A keystore session. |
|
39 * Handles client requests by passing them to the keystore conduit. Keeps track |
|
40 * of uids/passphrases for the session. |
|
41 * |
|
42 * @lib |
|
43 * @since S60 v3.2 |
|
44 */ |
|
45 class CDevCertKeyStoreSession : public CDevTokenServerSession |
|
46 { |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Create a new session object. |
|
51 * |
|
52 * @param aConduit The keystore conduit used to service user requests. |
|
53 * @return |
|
54 */ |
|
55 static CDevCertKeyStoreSession* NewL(CDevCertKeyStoreServer& aServer ); |
|
56 |
|
57 virtual ~CDevCertKeyStoreSession(); |
|
58 |
|
59 TInt AddOpenedKeyL(CDevCertOpenedKeySrv& aObject); |
|
60 |
|
61 void RemoveOpenedKeyL(TInt aHandle); |
|
62 |
|
63 CDevCertOpenedKeySrv* OpenedKey(TInt aHandle); |
|
64 |
|
65 /** |
|
66 * Determine if this session has a key open. |
|
67 * |
|
68 * @param aHandle The key data handle - not the session's open key handle! |
|
69 * @return ETrue if has open key |
|
70 */ |
|
71 TBool HasOpenKey(TInt aHandle); |
|
72 |
|
73 CDevCertKeyStoreSession(CDevCertKeyStoreServer& aServer ); |
|
74 |
|
75 private: |
|
76 |
|
77 virtual void DoServiceL(const RMessage2& aMessage); |
|
78 |
|
79 private: |
|
80 |
|
81 CDevCertKeyStoreServer& iServer; |
|
82 TInt iLastHandle; |
|
83 RArray<TObjectIndex> iOpenedKeys; |
|
84 }; |
|
85 |
|
86 #endif |