sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 1998-2010 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 |
/**
|
sl@0
|
20 |
@file
|
sl@0
|
21 |
@internalTechnology
|
sl@0
|
22 |
*/
|
sl@0
|
23 |
|
sl@0
|
24 |
#ifndef __TACTION_BUILD_H__
|
sl@0
|
25 |
#define __TACTION_BUILD_H__
|
sl@0
|
26 |
|
sl@0
|
27 |
#include "t_testaction.h"
|
sl@0
|
28 |
#include <unifiedcertstore.h>
|
sl@0
|
29 |
#include "tcertutils.h"
|
sl@0
|
30 |
|
sl@0
|
31 |
class CAddCall : public CBase
|
sl@0
|
32 |
{
|
sl@0
|
33 |
public:
|
sl@0
|
34 |
static CAddCall* NewL(const TDesC& aBuf);
|
sl@0
|
35 |
static CAddCall* NewLC(const TDesC& aBuf);
|
sl@0
|
36 |
~CAddCall();
|
sl@0
|
37 |
CAddCall();
|
sl@0
|
38 |
virtual void ConstructL(const TDesC& aBuf);
|
sl@0
|
39 |
TBool AddCert(const TDesC& aBuf, const TDesC& aStart, const TDesC& aEnd, TInt& aPos, CDesCArray& aCerts);
|
sl@0
|
40 |
//
|
sl@0
|
41 |
CDesCArray* iCertsToAdd;
|
sl@0
|
42 |
};
|
sl@0
|
43 |
|
sl@0
|
44 |
class CTestActionBuild : public CTestAction
|
sl@0
|
45 |
{
|
sl@0
|
46 |
public:
|
sl@0
|
47 |
static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole,
|
sl@0
|
48 |
Output& aOut, const TTestActionSpec& aTestActionSpec);
|
sl@0
|
49 |
static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole,
|
sl@0
|
50 |
Output& aOut, const TTestActionSpec& aTestActionSpec);
|
sl@0
|
51 |
virtual ~CTestActionBuild();
|
sl@0
|
52 |
|
sl@0
|
53 |
private:
|
sl@0
|
54 |
CTestActionBuild(RFs& aFs, CConsoleBase& aConsole,Output& aOut);
|
sl@0
|
55 |
void ConstructL(const TTestActionSpec& aTestActionSpec);
|
sl@0
|
56 |
|
sl@0
|
57 |
public:
|
sl@0
|
58 |
virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
|
sl@0
|
59 |
virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
|
sl@0
|
60 |
virtual void PerformAction(TRequestStatus& aStatus);
|
sl@0
|
61 |
TBool TestResult(TInt aError);
|
sl@0
|
62 |
virtual void PerformCancel();
|
sl@0
|
63 |
virtual void Reset();
|
sl@0
|
64 |
|
sl@0
|
65 |
virtual void DoReportAction();
|
sl@0
|
66 |
virtual void DoCheckResult(TInt aError);
|
sl@0
|
67 |
|
sl@0
|
68 |
private:
|
sl@0
|
69 |
TBool AddCert(const TDesC& aBuf, const TDesC& aStart,
|
sl@0
|
70 |
const TDesC& aEnd, TInt& aPos, CDesCArray& aCertsFileName,
|
sl@0
|
71 |
CDesCArray& aCertsLabel);
|
sl@0
|
72 |
TBool AddAddCallsL(const TDesC& aBuf, TInt& aPos);
|
sl@0
|
73 |
TBool CompareChainsL(const CPKIXCertChain& aChain);
|
sl@0
|
74 |
TBool CompareCertL(const CX509Certificate& aCert, const TDesC& aFilename);
|
sl@0
|
75 |
|
sl@0
|
76 |
private:
|
sl@0
|
77 |
enum TState
|
sl@0
|
78 |
{
|
sl@0
|
79 |
EInitCertStoreManager1,
|
sl@0
|
80 |
ERemoveCertsBeforeTest,
|
sl@0
|
81 |
EAddRoot,
|
sl@0
|
82 |
EAddIntermediateCerts,
|
sl@0
|
83 |
EDoBuildTestStart,
|
sl@0
|
84 |
EDoBuildTestFinished,
|
sl@0
|
85 |
EInitCertStoreManager2,
|
sl@0
|
86 |
ERemoveCertsAfterTest,
|
sl@0
|
87 |
EEnd
|
sl@0
|
88 |
};
|
sl@0
|
89 |
|
sl@0
|
90 |
private:
|
sl@0
|
91 |
TState iState;
|
sl@0
|
92 |
RFs& iFs;
|
sl@0
|
93 |
CUnifiedCertStore* iUnifiedCertStore;
|
sl@0
|
94 |
CCertUtils* iCertUtils;
|
sl@0
|
95 |
|
sl@0
|
96 |
TBuf<128> iRootCertFileName;
|
sl@0
|
97 |
TBuf<128> iRootCertLabel;
|
sl@0
|
98 |
CDesCArray* iExtraCertsFileName;
|
sl@0
|
99 |
CDesCArray* iExtraCertsLabel;
|
sl@0
|
100 |
CDesCArray* iInitCertsFileName;
|
sl@0
|
101 |
CDesCArray* iInitCertsLabel;
|
sl@0
|
102 |
|
sl@0
|
103 |
CPKIXCertChain* iChain;
|
sl@0
|
104 |
RPointerArray<CAddCall> iAddCalls;
|
sl@0
|
105 |
|
sl@0
|
106 |
TTime iTime;
|
sl@0
|
107 |
|
sl@0
|
108 |
CPKIXValidationResult* iValidationResult;
|
sl@0
|
109 |
TBuf<128> iCertPath;
|
sl@0
|
110 |
};
|
sl@0
|
111 |
|
sl@0
|
112 |
#endif
|