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