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: Symbian specific private security module model
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef ADVSECSETTINGSSECURITYMODULEMODELPRIVATE_SYMBIAN_H
|
|
19 |
#define ADVSECSETTINGSSECURITYMODULEMODELPRIVATE_SYMBIAN_H
|
|
20 |
|
|
21 |
#include <e32base.h> // CActive
|
|
22 |
#include <f32file.h> // RFs
|
|
23 |
#include <ct/rmpointerarray.h> // RMPointerArray
|
|
24 |
#include <QMap>
|
|
25 |
|
|
26 |
class AdvSecSettingsSecurityModuleModel;
|
|
27 |
class CAdvSecSettingsSecurityModuleEraser;
|
|
28 |
class CUnifiedKeyStore;
|
|
29 |
class MCTKeyStore;
|
|
30 |
class MCTAuthenticationObject;
|
|
31 |
class CCTKeyInfo;
|
|
32 |
class TCTKeyAttributeFilter;
|
|
33 |
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Symbian specific private security module model.
|
|
37 |
*/
|
|
38 |
class AdvSecSettingsSecurityModuleModelPrivate : public CActive
|
|
39 |
{
|
|
40 |
public: // constructor and destructor
|
|
41 |
explicit AdvSecSettingsSecurityModuleModelPrivate(AdvSecSettingsSecurityModuleModel *q);
|
|
42 |
~AdvSecSettingsSecurityModuleModelPrivate();
|
|
43 |
|
|
44 |
public: // new functions
|
|
45 |
void initialize();
|
|
46 |
int moduleCount() const;
|
|
47 |
QMap<QString,QString> moduleLabelsAndLocations() const;
|
|
48 |
void getModuleStatus(int moduleIndex);
|
|
49 |
void setPinCodeRequestState(int moduleIndex, bool isRequested);
|
|
50 |
void changePinCode(int moduleIndex); // unblocks PIN code if EPinBlocked
|
|
51 |
void closeModule(int moduleIndex);
|
|
52 |
bool isSigningPinSupported(int moduleIndex) const;
|
|
53 |
void changeSigningPinCode(int moduleIndex);
|
|
54 |
bool isDeletable(int moduleIndex) const;
|
|
55 |
void deleteModule(int moduleIndex);
|
|
56 |
|
|
57 |
protected: // from CActive
|
|
58 |
void DoCancel();
|
|
59 |
void RunL();
|
|
60 |
TInt RunError(TInt aError);
|
|
61 |
|
|
62 |
private: // new functions
|
|
63 |
void ConstructL();
|
|
64 |
void ListKeysFromFirstKeyStoreL();
|
|
65 |
void ListKeysFromOneKeyStoreL();
|
|
66 |
void ListKeysFromNextKeyStoreL();
|
|
67 |
void AppendKeyStoresWithProtectedKeysL();
|
|
68 |
void ChangeCurrentAuthObjectPinCode();
|
|
69 |
TInt DoStartDeletingModule(TInt aModuleIndex);
|
|
70 |
void ReturnModuleStatusL();
|
|
71 |
void ReturnPinChanged();
|
|
72 |
void ReturnPinRequestStateChanged();
|
|
73 |
void ReturnModuleClosed();
|
|
74 |
void ReturnModuleDeleted();
|
|
75 |
|
|
76 |
private: // data
|
|
77 |
AdvSecSettingsSecurityModuleModel *q_ptr; // not owned
|
|
78 |
RFs iFs;
|
|
79 |
CUnifiedKeyStore *iUnifiedKeyStore;
|
|
80 |
RMPointerArray<MCTKeyStore> iProtectedKeyStores; // items not owned
|
|
81 |
RMPointerArray<MCTAuthenticationObject> iAuthenticationObjects; // items not owned
|
|
82 |
TInt iKeyStoreIndex;
|
|
83 |
RMPointerArray<CCTKeyInfo> iKeys;
|
|
84 |
TCTKeyAttributeFilter *iAllKeysFilter;
|
|
85 |
MCTKeyStore *iCurrentKeyStore; // not owned
|
|
86 |
MCTAuthenticationObject *iCurrentAuthObject; // not owned
|
|
87 |
TInt iTimeRemaining;
|
|
88 |
CAdvSecSettingsSecurityModuleEraser *iModuleEraser;
|
|
89 |
enum TState {
|
|
90 |
ENotInitialized,
|
|
91 |
EInitializing,
|
|
92 |
EListingKeys,
|
|
93 |
EReadingTimeRemaining,
|
|
94 |
EChangingPinCode,
|
|
95 |
EUnblockingToChangePinCode,
|
|
96 |
EEnablingPinCodeRequest,
|
|
97 |
EDisablingPinCodeRequest,
|
|
98 |
EClosingAuthObject,
|
|
99 |
EDeletingModule,
|
|
100 |
EIdle
|
|
101 |
} iState;
|
|
102 |
};
|
|
103 |
|
|
104 |
#endif // ADVSECSETTINGSSECURITYMODULEMODELPRIVATE_SYMBIAN_H
|