63
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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: Symbian specific advanced security settings certificate model
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CPADVSECSETTINGSMODELPRIVATE_SYMBIAN_H
|
|
19 |
#define CPADVSECSETTINGSMODELPRIVATE_SYMBIAN_H
|
|
20 |
|
|
21 |
#include <e32base.h> // CActive
|
|
22 |
#include <f32file.h> // RFs
|
|
23 |
#include <unifiedcertstore.h> // CUnifiedCertStore related
|
|
24 |
#include <QMap>
|
|
25 |
|
|
26 |
class AdvSecSettingsCertificateModel;
|
|
27 |
class AdvSecSettingsCertificate;
|
|
28 |
class CAdvSecSettingsCertListBuilder;
|
|
29 |
class CAdvSecSettingsCertDetailsBuilder;
|
|
30 |
class CCertificateAppInfoManager;
|
|
31 |
class CAdvSecSettingsCertMover;
|
|
32 |
|
|
33 |
|
|
34 |
/**
|
|
35 |
* Symbian specific advanced security settings certificate model.
|
|
36 |
*/
|
|
37 |
class AdvSecSettingsCertificateModelPrivate : public CActive
|
|
38 |
{
|
|
39 |
public: // constructor and destructor
|
|
40 |
explicit AdvSecSettingsCertificateModelPrivate(
|
|
41 |
AdvSecSettingsCertificateModel *q = 0);
|
|
42 |
~AdvSecSettingsCertificateModelPrivate();
|
|
43 |
|
|
44 |
public: // new functions
|
|
45 |
void initialize();
|
|
46 |
void getCertificates(QList<AdvSecSettingsCertificate*> &certList);
|
|
47 |
void getCertificateDetails(const AdvSecSettingsCertificate &cert,
|
|
48 |
QMap<int,QString> &details);
|
|
49 |
bool isDeletable(const AdvSecSettingsCertificate &cert) const;
|
|
50 |
void deleteCertificate(const AdvSecSettingsCertificate &cert);
|
|
51 |
void getTrustSettings(const AdvSecSettingsCertificate &cert,
|
|
52 |
QMap<int,bool> &usageIdAndTrust);
|
|
53 |
void setTrustSettings(const AdvSecSettingsCertificate &cert,
|
|
54 |
const QMap<int,bool> &usageIdAndTrust);
|
|
55 |
void getCertificateUsageNames(QMap<int,QString> &usageIdAndName);
|
|
56 |
void moveToPersonalCertificates(const AdvSecSettingsCertificate &cert);
|
|
57 |
void moveToDeviceCertificates(const AdvSecSettingsCertificate &cert);
|
|
58 |
|
|
59 |
protected: // from CActive
|
|
60 |
void DoCancel();
|
|
61 |
void RunL();
|
|
62 |
TInt RunError(TInt aError);
|
|
63 |
|
|
64 |
private: // new functions
|
|
65 |
Q_DISABLE_COPY(AdvSecSettingsCertificateModelPrivate)
|
|
66 |
void ConstructL();
|
|
67 |
TInt ResetCertAttributeFilter();
|
|
68 |
TInt ResetCertInfoArray();
|
|
69 |
void ReturnTrustSettingsDetails();
|
|
70 |
void DoGetCertificateUsageNamesL(QMap<int,QString> &usageIdAndName);
|
|
71 |
const CCTCertInfo *CertificateInfo(const AdvSecSettingsCertificate &cert) const;
|
|
72 |
|
|
73 |
private: // data
|
|
74 |
AdvSecSettingsCertificateModel *q_ptr;
|
|
75 |
|
|
76 |
enum TState {
|
|
77 |
ENotInitialized,
|
|
78 |
EInitializing,
|
|
79 |
EIdle,
|
|
80 |
EGettingCertificatesList,
|
|
81 |
EGettingCertificatesRetrieve,
|
|
82 |
EBuildingCertificateDetails,
|
|
83 |
EDeletingCertificate,
|
|
84 |
EReadingApplications,
|
|
85 |
EWritingApplications,
|
|
86 |
EMovingCertificateToPersonalStore,
|
|
87 |
EMovingCertificateToDeviceStore
|
|
88 |
} iState;
|
|
89 |
|
|
90 |
RFs iFs;
|
|
91 |
CUnifiedCertStore *iCertStore;
|
|
92 |
|
|
93 |
/*
|
|
94 |
* Common to all certificate specific asynchronous methods. Member iCertInfo
|
|
95 |
* contains pointer to the current certificate being processed. Member
|
|
96 |
* iCertInfoArray contains all certificates read from certificate databases.
|
|
97 |
*/
|
|
98 |
const CCTCertInfo *iCertInfo; // not owned
|
|
99 |
RMPointerArray<CCTCertInfo> iCertInfoArray;
|
|
100 |
|
|
101 |
/*
|
|
102 |
* for getCertificates method. Certificate list is constructed using
|
|
103 |
* iCertListBuilder member, which returns data directly to the client.
|
|
104 |
*/
|
|
105 |
CAdvSecSettingsCertListBuilder *iCertListBuilder;
|
|
106 |
|
|
107 |
/*
|
|
108 |
* For getCertificateDetails method. Certificate details are constructed
|
|
109 |
* using iDetailsBuilder member, which returns data directly to the client.
|
|
110 |
*/
|
|
111 |
CAdvSecSettingsCertDetailsBuilder *iDetailsBuilder;
|
|
112 |
|
|
113 |
/*
|
|
114 |
* For getTrustSettings method. Data is retrieved from certificate store into
|
|
115 |
* iApplications member, and then returned to client via iTrustedUids member.
|
|
116 |
*/
|
|
117 |
QMap<int,bool> *iTrustedUids; // not owned
|
|
118 |
RArray<TUid> iApplications;
|
|
119 |
|
|
120 |
/*
|
|
121 |
* For getTrustSettings and getCertificateUsageNames methods to get possible
|
|
122 |
* certificate application (usage) ids and their names.
|
|
123 |
*/
|
|
124 |
CCertificateAppInfoManager *iCertAppInfoManager;
|
|
125 |
|
|
126 |
/*
|
|
127 |
* For moveToPersonalCertificates and moveToDeviceCertificates methods.
|
|
128 |
* Takes care of moving certificate and it's key to given target store.
|
|
129 |
*/
|
|
130 |
CAdvSecSettingsCertMover *iMover;
|
|
131 |
};
|
|
132 |
|
|
133 |
#endif // CPADVSECSETTINGSMODELPRIVATE_SYMBIAN_H
|
|
134 |
|