os/security/cryptoservices/certificateandkeymgmt/tpkixcert/taction_build.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptoservices/certificateandkeymgmt/tpkixcert/taction_build.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,112 @@
     1.4 +/*
     1.5 +* Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +/**
    1.23 + @file 
    1.24 + @internalTechnology
    1.25 +*/
    1.26 + 
    1.27 +#ifndef __TACTION_BUILD_H__
    1.28 +#define __TACTION_BUILD_H__
    1.29 +
    1.30 +#include "t_testaction.h"
    1.31 +#include <unifiedcertstore.h>
    1.32 +#include "tcertutils.h"
    1.33 +
    1.34 +class CAddCall : public CBase
    1.35 +	{
    1.36 +public:
    1.37 +	static CAddCall* NewL(const TDesC& aBuf);
    1.38 +	static CAddCall* NewLC(const TDesC& aBuf);
    1.39 +	~CAddCall();
    1.40 +	CAddCall();
    1.41 +	virtual void ConstructL(const TDesC& aBuf);
    1.42 +	TBool AddCert(const TDesC& aBuf, const TDesC& aStart, const TDesC& aEnd, TInt& aPos, CDesCArray& aCerts);
    1.43 +	//
    1.44 +	CDesCArray* iCertsToAdd;
    1.45 +	};
    1.46 +
    1.47 +class CTestActionBuild : public CTestAction
    1.48 +{
    1.49 +public:
    1.50 +	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole,
    1.51 +		Output& aOut, const TTestActionSpec& aTestActionSpec);
    1.52 +	static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole,
    1.53 +		Output& aOut, const TTestActionSpec& aTestActionSpec);
    1.54 +	virtual ~CTestActionBuild();
    1.55 +
    1.56 +private:
    1.57 +	CTestActionBuild(RFs& aFs, CConsoleBase& aConsole,Output& aOut);
    1.58 +	void ConstructL(const TTestActionSpec& aTestActionSpec);
    1.59 +
    1.60 +public:
    1.61 +	virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
    1.62 +	virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
    1.63 +	virtual void PerformAction(TRequestStatus& aStatus);
    1.64 +	TBool TestResult(TInt aError);
    1.65 +	virtual void PerformCancel();
    1.66 +	virtual void Reset();
    1.67 +
    1.68 +	virtual void DoReportAction();
    1.69 +	virtual void DoCheckResult(TInt aError);
    1.70 +
    1.71 +private:
    1.72 +	TBool AddCert(const TDesC& aBuf, const TDesC& aStart,
    1.73 +		const TDesC& aEnd, TInt& aPos, CDesCArray& aCertsFileName, 
    1.74 +		CDesCArray& aCertsLabel);
    1.75 +	TBool AddAddCallsL(const TDesC& aBuf, TInt& aPos);
    1.76 +	TBool CompareChainsL(const CPKIXCertChain& aChain);
    1.77 +	TBool CompareCertL(const CX509Certificate& aCert, const TDesC& aFilename);
    1.78 +
    1.79 +private:
    1.80 +	enum TState
    1.81 +		{
    1.82 +		EInitCertStoreManager1,
    1.83 +		ERemoveCertsBeforeTest,
    1.84 +		EAddRoot,
    1.85 +		EAddIntermediateCerts,
    1.86 +		EDoBuildTestStart,
    1.87 +		EDoBuildTestFinished,
    1.88 +		EInitCertStoreManager2,
    1.89 +		ERemoveCertsAfterTest,
    1.90 +		EEnd
    1.91 +		};
    1.92 +
    1.93 +private:
    1.94 +	TState iState;
    1.95 +	RFs& iFs;
    1.96 +	CUnifiedCertStore* iUnifiedCertStore;
    1.97 +	CCertUtils* iCertUtils;
    1.98 +
    1.99 +	TBuf<128> iRootCertFileName;
   1.100 +	TBuf<128> iRootCertLabel;
   1.101 +	CDesCArray* iExtraCertsFileName;
   1.102 +	CDesCArray* iExtraCertsLabel;
   1.103 +	CDesCArray* iInitCertsFileName;
   1.104 +	CDesCArray* iInitCertsLabel;
   1.105 +
   1.106 +	CPKIXCertChain* iChain;
   1.107 +	RPointerArray<CAddCall> iAddCalls;
   1.108 +
   1.109 +	TTime iTime;
   1.110 +
   1.111 +	CPKIXValidationResult* iValidationResult;
   1.112 +	TBuf<128> iCertPath;
   1.113 +};
   1.114 +
   1.115 +#endif