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 "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: Helper class to construct certificate details
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef ADVSECSETTINGSCERTDETAILSBUILDER_SYMBIAN_H
|
|
19 |
#define ADVSECSETTINGSCERTDETAILSBUILDER_SYMBIAN_H
|
|
20 |
|
|
21 |
#include <e32base.h> // CActive
|
|
22 |
#include <ct/rmpointerarray.h> // RMPointerArray
|
|
23 |
#include <unifiedcertstore.h> // CUnifiedCertStore
|
|
24 |
#include <QMap>
|
|
25 |
|
|
26 |
class RFs;
|
|
27 |
class CUnifiedCertStore;
|
|
28 |
class CUnifiedKeyStore;
|
|
29 |
class CCTCertInfo;
|
|
30 |
class CCTKeyInfo;
|
|
31 |
class CCertAttributeFilter;
|
|
32 |
class TCTKeyAttributeFilter;
|
|
33 |
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Certificate details helper class.
|
|
37 |
*/
|
|
38 |
class CAdvSecSettingsCertDetailsBuilder : public CActive
|
|
39 |
{
|
|
40 |
public: // constructor and destructor
|
|
41 |
static CAdvSecSettingsCertDetailsBuilder *NewL(RFs &aFs, CUnifiedCertStore &aCertStore);
|
|
42 |
~CAdvSecSettingsCertDetailsBuilder();
|
|
43 |
|
|
44 |
public: // new functions
|
|
45 |
void GetDetailsL(const CCTCertInfo &aCert, QMap<int,QString> &aDetails,
|
|
46 |
TRequestStatus &aStatus);
|
|
47 |
|
|
48 |
protected: // from CActive
|
|
49 |
void DoCancel();
|
|
50 |
void RunL();
|
|
51 |
TInt RunError(TInt aError);
|
|
52 |
|
|
53 |
private: // new functions
|
|
54 |
CAdvSecSettingsCertDetailsBuilder(RFs &aFs, CUnifiedCertStore &aCertStore);
|
|
55 |
void ConstructL();
|
|
56 |
void InitializeKeyStoreL();
|
|
57 |
void RetrieveCertificateL();
|
|
58 |
void ListKeysL();
|
|
59 |
void ReturnCertificateDetailsL();
|
|
60 |
void AppendLabelL();
|
|
61 |
void AppendIssuerL();
|
|
62 |
void AppendSubjectL();
|
|
63 |
void AppendValidityPeriodL();
|
|
64 |
void AppendLocationL();
|
|
65 |
void AppendFormatL();
|
|
66 |
void AppendKeyUsageL();
|
|
67 |
void AppendAlgorithmL();
|
|
68 |
void AppendSerialNumberL();
|
|
69 |
void AppendFingerprintsL();
|
|
70 |
void AppendPublicKeyL();
|
|
71 |
void AppendTrustedSitesL();
|
|
72 |
QString CertificateFormatStringL(const TCertificateFormat aFormat) const;
|
|
73 |
QString AlgorithmNameStringL(TAlgorithmId aAlgorithmId) const;
|
|
74 |
|
|
75 |
private: // data
|
|
76 |
RFs &iFs;
|
|
77 |
CUnifiedCertStore &iCertStore;
|
|
78 |
const CCTCertInfo *iCertInfo; // not owned
|
|
79 |
TRequestStatus *iClientStatus; // not owned
|
|
80 |
QMap<int,QString> *iDetails; // not owned
|
|
81 |
|
|
82 |
CCertificate *iCertificate;
|
|
83 |
HBufC8 *iCertificateUrl;
|
|
84 |
TPtr8 iCertUrlPtr;
|
|
85 |
|
|
86 |
CUnifiedKeyStore *iKeyStore;
|
|
87 |
TCTKeyAttributeFilter *iKeyFilter;
|
|
88 |
RMPointerArray<CCTKeyInfo> iKeys;
|
|
89 |
|
|
90 |
enum TDetailsBuilderState {
|
|
91 |
ENotInitialized,
|
|
92 |
EInitializingKeyStore,
|
|
93 |
ERetrievingCertificate,
|
|
94 |
EListingKeys,
|
|
95 |
EIdle,
|
|
96 |
EFailed
|
|
97 |
} iState;
|
|
98 |
};
|
|
99 |
|
|
100 |
#endif // ADVSECSETTINGSCERTDETAILSBUILDER_SYMBIAN_H
|