|
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 DevandTruSrvCertStore |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __DEVANDTRUSRVCERTSTORE_H__ |
|
21 #define __DEVANDTRUSRVCERTSTORE_H__ |
|
22 |
|
23 #include <mctwritablecertstore.h> |
|
24 #include "DevTokenMarshaller.h" |
|
25 #include "DevTokenDataTypes.h" |
|
26 #include "DTClient.h" |
|
27 |
|
28 |
|
29 /** |
|
30 * The device tokens Certstore client interface. |
|
31 * |
|
32 * Implements the MCTWritableCertStore interface, with inheritance from |
|
33 * CFSClient. Instances of this class are created by CClientInterfaceFactory. |
|
34 * Marshals client data for server requests and unpacks returned parameter data |
|
35 * across IPC boundary. |
|
36 * Note that although this class is derived from CActive (via CDTClient) is does |
|
37 * not act an active object, or use CActive functionality. |
|
38 * |
|
39 * @lib DevTokenClient.dll |
|
40 * @since S60 v3.2 |
|
41 */ |
|
42 class CDevandTruSrvCertStore : public CDTClient, public MCTWritableCertStore |
|
43 { |
|
44 public: |
|
45 |
|
46 static MCTTokenInterface* NewWritableInterfaceL(MCTToken& aToken, RDevTokenClientSession& aClient); |
|
47 |
|
48 static MCTTokenInterface* NewReadableInterfaceL(MCTToken& aToken, RDevTokenClientSession& aClient); |
|
49 |
|
50 public: |
|
51 |
|
52 virtual ~CDevandTruSrvCertStore(); |
|
53 |
|
54 public: |
|
55 |
|
56 // From MCTTokenInterface |
|
57 virtual MCTToken& Token(); |
|
58 |
|
59 virtual void DoRelease(); |
|
60 |
|
61 public: |
|
62 |
|
63 // From MCTCertStore |
|
64 virtual void List(RMPointerArray<CCTCertInfo>& aCerts, |
|
65 const CCertAttributeFilter& aFilter, |
|
66 TRequestStatus& aStatus); |
|
67 |
|
68 virtual void CancelList(); |
|
69 |
|
70 virtual void GetCert(CCTCertInfo*& aCertInfo, const TCTTokenObjectHandle& aHandle, |
|
71 TRequestStatus& aStatus); |
|
72 |
|
73 virtual void CancelGetCert(); |
|
74 |
|
75 virtual void Applications(const CCTCertInfo& aCertInfo, RArray<TUid>& aApplications, |
|
76 TRequestStatus& aStatus); |
|
77 |
|
78 virtual void CancelApplications(); |
|
79 |
|
80 virtual void IsApplicable(const CCTCertInfo& aCertInfo, TUid aApplication, |
|
81 TBool& aIsApplicable, TRequestStatus& aStatus); |
|
82 |
|
83 virtual void CancelIsApplicable(); |
|
84 |
|
85 virtual void Trusted(const CCTCertInfo& aCertInfo, TBool& aTrusted, |
|
86 TRequestStatus& aStatus); |
|
87 |
|
88 virtual void CancelTrusted(); |
|
89 |
|
90 virtual void Retrieve(const CCTCertInfo& aCertInfo, TDes8& aEncodedCert, |
|
91 TRequestStatus& aStatus); |
|
92 |
|
93 virtual void CancelRetrieve(); |
|
94 |
|
95 // From MCTWritableCertStore |
|
96 virtual void Add(const TDesC& aLabel, TCertificateFormat aFormat, |
|
97 TCertificateOwnerType aCertificateOwnerType, |
|
98 const TKeyIdentifier* aSubjectKeyId, const TKeyIdentifier* aIssuerKeyId, |
|
99 const TDesC8& aCert, TRequestStatus& aStatus); |
|
100 |
|
101 virtual void Add(const TDesC& aLabel, TCertificateFormat aFormat, |
|
102 TCertificateOwnerType aCertificateOwnerType, |
|
103 const TKeyIdentifier* aSubjectKeyId, const TKeyIdentifier* aIssuerKeyId, |
|
104 const TDesC8& aCert, const TBool aDeletable, |
|
105 TRequestStatus& aStatus); |
|
106 |
|
107 virtual void CancelAdd(); |
|
108 |
|
109 virtual void Remove(const CCTCertInfo& aCertInfo, TRequestStatus& aStatus); |
|
110 |
|
111 virtual void CancelRemove(); |
|
112 |
|
113 virtual void SetApplicability(const CCTCertInfo& aCertInfo, |
|
114 |
|
115 const RArray<TUid>& aApplications, TRequestStatus &aStatus); |
|
116 |
|
117 virtual void CancelSetApplicability(); |
|
118 |
|
119 virtual void SetTrust(const CCTCertInfo& aCertInfo, TBool aTrusted, |
|
120 TRequestStatus& aStatus); |
|
121 |
|
122 virtual void CancelSetTrust(); |
|
123 |
|
124 protected: |
|
125 |
|
126 // From CActive |
|
127 virtual void RunL(); |
|
128 |
|
129 private: |
|
130 |
|
131 CDevandTruSrvCertStore(TInt aUID, MCTToken& aToken, RDevTokenClientSession& aClient); |
|
132 |
|
133 void ConstructL(); |
|
134 |
|
135 void DoListL(RMPointerArray<CCTCertInfo>& aCerts, const CCertAttributeFilter& aFilter); |
|
136 |
|
137 void DoGetCertL(CCTCertInfo*& aCertInfo, const TCTTokenObjectHandle& aHandle); |
|
138 |
|
139 void DoApplicationsL(const CCTCertInfo& aCertInfo, RArray<TUid>& aApplications); |
|
140 |
|
141 TInt DoRetrieve(const CCTCertInfo& aCertInfo, TDes8& aEncodedCert); |
|
142 |
|
143 void CopyFilter( CCertAttributeFilter* aDesFilter, const CCertAttributeFilter& aSrcFilter); |
|
144 |
|
145 private: |
|
146 |
|
147 CCertAttributeFilter* iFilter; |
|
148 }; |
|
149 |
|
150 #endif //__DEVANDTRUSRVCERTSTORE_H__ |
|
151 |
|
152 //EOF |