sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 1998-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 |
* CValidateTest class implementation
|
sl@0
|
16 |
*
|
sl@0
|
17 |
*/
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
/**
|
sl@0
|
21 |
@file
|
sl@0
|
22 |
@internalTechnology
|
sl@0
|
23 |
*/
|
sl@0
|
24 |
|
sl@0
|
25 |
#ifndef __TWTLSCERTVAL_H
|
sl@0
|
26 |
#define __TWTLSCERTVAL_H
|
sl@0
|
27 |
|
sl@0
|
28 |
#include "TestChain.h"
|
sl@0
|
29 |
#include "tcertutils.h"
|
sl@0
|
30 |
#include "t_testaction.h"
|
sl@0
|
31 |
|
sl@0
|
32 |
class CValidateTest : public CTestAction
|
sl@0
|
33 |
{
|
sl@0
|
34 |
public:
|
sl@0
|
35 |
static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole,
|
sl@0
|
36 |
Output& aOut, const TTestActionSpec& aTestActionSpec);
|
sl@0
|
37 |
static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole,
|
sl@0
|
38 |
Output& aOut, const TTestActionSpec& aTestActionSpec);
|
sl@0
|
39 |
void TestValidation(TRequestStatus& aStatus);
|
sl@0
|
40 |
~CValidateTest();
|
sl@0
|
41 |
|
sl@0
|
42 |
public:
|
sl@0
|
43 |
virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
|
sl@0
|
44 |
virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
|
sl@0
|
45 |
virtual void PerformAction(TRequestStatus& aStatus);
|
sl@0
|
46 |
virtual void DoReportAction();
|
sl@0
|
47 |
virtual void DoCheckResult(TInt aError);
|
sl@0
|
48 |
|
sl@0
|
49 |
private:
|
sl@0
|
50 |
CValidateTest(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
|
sl@0
|
51 |
void ConstructL(const TTestActionSpec& aTestActionSpec);
|
sl@0
|
52 |
HBufC8* ReadFileLC(const TDesC& aFilename);
|
sl@0
|
53 |
HBufC8* ReadFilesLC(CDesCArray& aServerCerts);
|
sl@0
|
54 |
void WriteError(TValidationError aError);
|
sl@0
|
55 |
static void CleanupCertArray(TAny* aCertArray);
|
sl@0
|
56 |
|
sl@0
|
57 |
private:
|
sl@0
|
58 |
void HandleEInitL(TRequestStatus& aStatus);
|
sl@0
|
59 |
void HandleEValidationInitStoreManager1L(TRequestStatus& aStatus);
|
sl@0
|
60 |
|
sl@0
|
61 |
private:
|
sl@0
|
62 |
enum TState
|
sl@0
|
63 |
{
|
sl@0
|
64 |
EInit,
|
sl@0
|
65 |
EValidationStoreInitStoreManager1,
|
sl@0
|
66 |
EValidationStoreDepopulateStore1,
|
sl@0
|
67 |
EValidationStorePopulateStoreRoots,
|
sl@0
|
68 |
EValidationStorePopulateStoreExtras,
|
sl@0
|
69 |
EValidationStoreValidate,
|
sl@0
|
70 |
EValidationStoreValidated,
|
sl@0
|
71 |
EValidationStoreInitStoreManager2,
|
sl@0
|
72 |
EValidationStoreDepopulateStore2,
|
sl@0
|
73 |
EValidationStoreEnd,
|
sl@0
|
74 |
EValidationSuppliedInit,
|
sl@0
|
75 |
EValidationSuppliedValidate,
|
sl@0
|
76 |
EValidationSuppliedValidated,
|
sl@0
|
77 |
EFinished
|
sl@0
|
78 |
};
|
sl@0
|
79 |
|
sl@0
|
80 |
private:
|
sl@0
|
81 |
RFs& iFs;
|
sl@0
|
82 |
TRequestStatus *iOriginalRequestStatus;
|
sl@0
|
83 |
TState iState;
|
sl@0
|
84 |
TTime iStart;
|
sl@0
|
85 |
CTestChainValidate* iTestChain;
|
sl@0
|
86 |
CCertUtils* iCertUtils;
|
sl@0
|
87 |
CWTLSValidationResult* iValidationResult;
|
sl@0
|
88 |
TTime iTime;
|
sl@0
|
89 |
CWTLSCertChain* iChain;
|
sl@0
|
90 |
};
|
sl@0
|
91 |
|
sl@0
|
92 |
#endif
|