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: Certificate handling model in advanced security settings
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef ADVSECSETTINGSCERTIFICATEMODEL_H
|
|
19 |
#define ADVSECSETTINGSCERTIFICATEMODEL_H
|
|
20 |
|
|
21 |
#include <QObject>
|
|
22 |
#include <QList>
|
|
23 |
#include <QMap>
|
|
24 |
|
|
25 |
class AdvSecSettingsCertificateModelPrivate;
|
|
26 |
class AdvSecSettingsCertificate;
|
|
27 |
|
|
28 |
|
|
29 |
/**
|
|
30 |
* Certificate handling engine in advanced security settings control panel plugin.
|
|
31 |
*/
|
|
32 |
class AdvSecSettingsCertificateModel : public QObject
|
|
33 |
{
|
|
34 |
Q_OBJECT
|
|
35 |
|
|
36 |
public: // constructor and destructor
|
|
37 |
explicit AdvSecSettingsCertificateModel(QObject *parent = 0);
|
|
38 |
virtual ~AdvSecSettingsCertificateModel();
|
|
39 |
|
|
40 |
public: // new definitions
|
|
41 |
enum AdvSecSettingsCertificateDetailsField {
|
|
42 |
Label,
|
|
43 |
Issuer,
|
|
44 |
Subject,
|
|
45 |
ValidFrom,
|
|
46 |
ValidTo,
|
|
47 |
Location,
|
|
48 |
Format,
|
|
49 |
KeyUsage,
|
|
50 |
KeyLocation,
|
|
51 |
Algorithm,
|
|
52 |
SerialNumber,
|
|
53 |
FingerprintSHA1,
|
|
54 |
FingerprintMD5,
|
|
55 |
PublicKey,
|
|
56 |
TrustedSites
|
|
57 |
};
|
|
58 |
|
|
59 |
public: // new functions
|
|
60 |
void initialize(); // asynchronous
|
|
61 |
void getCertificates(QList<AdvSecSettingsCertificate*> &certList); // asynchronous
|
|
62 |
void getCertificateDetails(const AdvSecSettingsCertificate &cert,
|
|
63 |
QMap<int,QString> &details); // asynchronous
|
|
64 |
bool isDeletable(const AdvSecSettingsCertificate &cert) const;
|
|
65 |
void deleteCertificate(const AdvSecSettingsCertificate &cert); // asynchronous
|
|
66 |
void getTrustSettings(const AdvSecSettingsCertificate &cert,
|
|
67 |
QMap<int,bool> &usageIdAndTrust); // asynchronous
|
|
68 |
void setTrustSettings(const AdvSecSettingsCertificate &cert,
|
|
69 |
const QMap<int,bool> &usageIdAndTrust); // asynchronous
|
|
70 |
void getCertificateUsageNames(QMap<int,QString> &usageIdAndName);
|
|
71 |
void moveToPersonalCertificates(const AdvSecSettingsCertificate &cert); // asynchronous
|
|
72 |
void moveToDeviceCertificates(const AdvSecSettingsCertificate &cert); // asynchronous
|
|
73 |
|
|
74 |
signals: // new signals
|
|
75 |
void initializeCompleted();
|
|
76 |
void getCertificatesCompleted();
|
|
77 |
void getCertificateDetailsCompleted();
|
|
78 |
void deleteCertificateCompleted();
|
|
79 |
void getTrustSettingsCompleted();
|
|
80 |
void setTrustSettingsCompleted();
|
|
81 |
void moveToPersonalCertificatesCompleted();
|
|
82 |
void moveToDeviceCertificatesCompleted();
|
|
83 |
void errorOccurred(int error);
|
|
84 |
|
|
85 |
protected: // new functions
|
|
86 |
void handleInitializeCompleted();
|
|
87 |
void handleGetCertificatesCompleted();
|
|
88 |
void handleGetCertificateDetailsCompleted();
|
|
89 |
void handleDeleteCertificateCompleted();
|
|
90 |
void handleGetTrustSettingsCompleted();
|
|
91 |
void handleSetTrustSettingsCompleted();
|
|
92 |
void handleMoveToPersonalCertificateCompleted();
|
|
93 |
void handleMoveToDeviceCertificatesCompleted();
|
|
94 |
void handleError(int error);
|
|
95 |
|
|
96 |
private: // data
|
|
97 |
Q_DISABLE_COPY(AdvSecSettingsCertificateModel)
|
|
98 |
friend class AdvSecSettingsCertificateModelPrivate;
|
|
99 |
AdvSecSettingsCertificateModelPrivate *d_ptr;
|
|
100 |
};
|
|
101 |
|
|
102 |
#endif // ADVSECSETTINGSCERTIFICATEMODEL_H
|