sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <mctkeystore.h>
|
sl@0
|
20 |
#include <f32file.h>
|
sl@0
|
21 |
#include <barsc.h>
|
sl@0
|
22 |
#include <barsread.h>
|
sl@0
|
23 |
#include <utf.h>
|
sl@0
|
24 |
|
sl@0
|
25 |
#include "keytool_utils.h"
|
sl@0
|
26 |
#include "keytool_commands.h"
|
sl@0
|
27 |
#include "keytool_controller.h"
|
sl@0
|
28 |
|
sl@0
|
29 |
#include <keytool.rsg>
|
sl@0
|
30 |
|
sl@0
|
31 |
/*static*/ CKeytoolUsage* CKeytoolUsage::NewLC(CKeyToolController* aController)
|
sl@0
|
32 |
{
|
sl@0
|
33 |
CKeytoolUsage* self = new (ELeave) CKeytoolUsage(aController);
|
sl@0
|
34 |
CleanupStack::PushL(self);
|
sl@0
|
35 |
self->ConstructL();
|
sl@0
|
36 |
return self;
|
sl@0
|
37 |
}
|
sl@0
|
38 |
|
sl@0
|
39 |
/*static*/ CKeytoolUsage* CKeytoolUsage::NewL(CKeyToolController* aController)
|
sl@0
|
40 |
{
|
sl@0
|
41 |
CKeytoolUsage* self = CKeytoolUsage::NewLC(aController);
|
sl@0
|
42 |
CleanupStack::Pop(self);
|
sl@0
|
43 |
return self;
|
sl@0
|
44 |
}
|
sl@0
|
45 |
|
sl@0
|
46 |
CKeytoolUsage::CKeytoolUsage(CKeyToolController* aController) : CKeyToolCommand(aController)
|
sl@0
|
47 |
{
|
sl@0
|
48 |
}
|
sl@0
|
49 |
|
sl@0
|
50 |
void CKeytoolUsage::ConstructL()
|
sl@0
|
51 |
{
|
sl@0
|
52 |
}
|
sl@0
|
53 |
|
sl@0
|
54 |
CKeytoolUsage::~CKeytoolUsage()
|
sl@0
|
55 |
{
|
sl@0
|
56 |
}
|
sl@0
|
57 |
|
sl@0
|
58 |
void CKeytoolUsage::RunL()
|
sl@0
|
59 |
{
|
sl@0
|
60 |
|
sl@0
|
61 |
}
|
sl@0
|
62 |
|
sl@0
|
63 |
void CKeytoolUsage::DoCancel()
|
sl@0
|
64 |
{
|
sl@0
|
65 |
|
sl@0
|
66 |
}
|
sl@0
|
67 |
|
sl@0
|
68 |
void CKeytoolUsage::DoCommandL(CUnifiedKeyStore& /*aKeyStore*/, CKeyToolParameters* aParam)
|
sl@0
|
69 |
{
|
sl@0
|
70 |
// Depending on parameters show the help!
|
sl@0
|
71 |
if (!aParam->iDefault)
|
sl@0
|
72 |
{
|
sl@0
|
73 |
// Display general usage!
|
sl@0
|
74 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE);
|
sl@0
|
75 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE2);
|
sl@0
|
76 |
#ifdef SYMBIAN_AUTH_SERVER
|
sl@0
|
77 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE5);
|
sl@0
|
78 |
#endif // SYMBIAN_AUTH_SERVER
|
sl@0
|
79 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE3);
|
sl@0
|
80 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE4);
|
sl@0
|
81 |
return;
|
sl@0
|
82 |
}
|
sl@0
|
83 |
|
sl@0
|
84 |
if (!aParam->iDefault->Compare(_L("import")) )
|
sl@0
|
85 |
{
|
sl@0
|
86 |
// Display detailed *import* help
|
sl@0
|
87 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_IMPORT);
|
sl@0
|
88 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_IMPORT2);
|
sl@0
|
89 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_IMPORT3);
|
sl@0
|
90 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_IMPORT4);
|
sl@0
|
91 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_KEYUSAGES);
|
sl@0
|
92 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_KEYACCESSES);
|
sl@0
|
93 |
}
|
sl@0
|
94 |
else
|
sl@0
|
95 |
if (!aParam->iDefault->Compare(_L("list")) )
|
sl@0
|
96 |
{
|
sl@0
|
97 |
// Display detailed *import* help
|
sl@0
|
98 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_LIST);
|
sl@0
|
99 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_LIST2);
|
sl@0
|
100 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_LIST3);
|
sl@0
|
101 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_LIST4);
|
sl@0
|
102 |
}
|
sl@0
|
103 |
else
|
sl@0
|
104 |
if (!aParam->iDefault->Compare(_L("liststores")) )
|
sl@0
|
105 |
{
|
sl@0
|
106 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_LISTSTORES);
|
sl@0
|
107 |
}
|
sl@0
|
108 |
else
|
sl@0
|
109 |
if (!aParam->iDefault->Compare(_L("page")) )
|
sl@0
|
110 |
{
|
sl@0
|
111 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_PAGE);
|
sl@0
|
112 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_PAGE2);
|
sl@0
|
113 |
}
|
sl@0
|
114 |
else
|
sl@0
|
115 |
if (!aParam->iDefault->Compare(_L("remove")) )
|
sl@0
|
116 |
{
|
sl@0
|
117 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_REMOVE);
|
sl@0
|
118 |
}
|
sl@0
|
119 |
else
|
sl@0
|
120 |
if (!aParam->iDefault->Compare(_L("usage")) )
|
sl@0
|
121 |
{
|
sl@0
|
122 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_KEYUSAGE);
|
sl@0
|
123 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_KEYUSAGES);
|
sl@0
|
124 |
}
|
sl@0
|
125 |
else
|
sl@0
|
126 |
if (!aParam->iDefault->Compare(_L("removeuser")) )
|
sl@0
|
127 |
{
|
sl@0
|
128 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_REMOVEUSER);
|
sl@0
|
129 |
}
|
sl@0
|
130 |
else
|
sl@0
|
131 |
if (!aParam->iDefault->Compare(_L("setuser")) )
|
sl@0
|
132 |
{
|
sl@0
|
133 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_SETUSER);
|
sl@0
|
134 |
}
|
sl@0
|
135 |
else
|
sl@0
|
136 |
if (!aParam->iDefault->Compare(_L("setmanager")) )
|
sl@0
|
137 |
{
|
sl@0
|
138 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_SETMANAGER);
|
sl@0
|
139 |
}
|
sl@0
|
140 |
else
|
sl@0
|
141 |
if (!aParam->iDefault->Compare(_L("setallusers")) )
|
sl@0
|
142 |
{
|
sl@0
|
143 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_SETALLUSERS);
|
sl@0
|
144 |
}
|
sl@0
|
145 |
else
|
sl@0
|
146 |
if (!aParam->iDefault->Compare(_L("noninteractive")) )
|
sl@0
|
147 |
{
|
sl@0
|
148 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_NONINTERACTIVE);
|
sl@0
|
149 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_NONINTERACTIVE1);
|
sl@0
|
150 |
}
|
sl@0
|
151 |
else
|
sl@0
|
152 |
if (!aParam->iDefault->Compare(_L("access")) )
|
sl@0
|
153 |
{
|
sl@0
|
154 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_KEYACCESS);
|
sl@0
|
155 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_KEYACCESSES);
|
sl@0
|
156 |
}
|
sl@0
|
157 |
|
sl@0
|
158 |
#ifdef KEYTOOL
|
sl@0
|
159 |
else if( !aParam->iDefault->Compare(_L("migratestore")) )
|
sl@0
|
160 |
{
|
sl@0
|
161 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_MIGRATE);
|
sl@0
|
162 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_MIGRATE1);
|
sl@0
|
163 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_MIGRATE2);
|
sl@0
|
164 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_MIGRATE3);
|
sl@0
|
165 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_MIGRATE4);
|
sl@0
|
166 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_MIGRATE5);
|
sl@0
|
167 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_MIGRATE6);
|
sl@0
|
168 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_MIGRATE7);
|
sl@0
|
169 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_MIGRATE8);
|
sl@0
|
170 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE_MIGRATE9);
|
sl@0
|
171 |
}
|
sl@0
|
172 |
#endif // KEYTOOL
|
sl@0
|
173 |
else
|
sl@0
|
174 |
{
|
sl@0
|
175 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE);
|
sl@0
|
176 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE2);
|
sl@0
|
177 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE3);
|
sl@0
|
178 |
iController->DisplayLocalisedMsgL(R_KEYTOOL_USAGE4);
|
sl@0
|
179 |
}
|
sl@0
|
180 |
}
|