sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * CExtensionTest class implementation sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef __EXTENSIONTEST_H sl@0: #define __EXTENSIONTEST_H sl@0: sl@0: #include sl@0: sl@0: #include "t_testaction.h" sl@0: #include "tcertwriter.h" sl@0: sl@0: class CExtensionTest : public CTestAction sl@0: { sl@0: public: sl@0: static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, sl@0: Output& aOut, const TTestActionSpec& aTestActionSpec); sl@0: static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole, sl@0: Output& aOut, const TTestActionSpec& aTestActionSpec); sl@0: void TestValidation(TRequestStatus& aStatus); sl@0: ~CExtensionTest(); sl@0: sl@0: void PerformAction(TRequestStatus& aStatus); sl@0: void DoReportAction(); sl@0: void DoCheckResult(TInt aError); sl@0: sl@0: private: sl@0: CExtensionTest(RFs& aFs, CConsoleBase& aConsole, Output& aOut); sl@0: void ConstructL(const TTestActionSpec& aTestActionSpec); sl@0: sl@0: // compares arrays of things returning true if they are equal sl@0: TBool IsEqual(const RArray& aArray1, const RArray& aArray2); sl@0: TBool IsEqual(const RPointerArray& aArray1, const RPointerArray& aArray2); sl@0: sl@0: // return true if the extension data matches the expected value sl@0: void CheckExtensionsL(const CX509Certificate& cert, TBool& match, TBool& result); sl@0: TBool CheckDeviceIdListL(const CX509Certificate& cert); sl@0: TBool CheckSidListL(const CX509Certificate& cert); sl@0: TBool CheckVidListL(const CX509Certificate& cert); sl@0: TBool CheckCapabilitiesL(const CX509Certificate& cert); sl@0: sl@0: // populate expected value data structures from scritps sl@0: void BuildIntList(RArray& aInts, const TDesC& aBuf, const TDesC& aTag); sl@0: void BuildStringListL(RPointerArray& aStrings, const TDesC& aBuf, const TDesC& aTag); sl@0: void BuildCapabilitySet(TCapabilitySet& aCapabilitySet, const TDesC& aBuf); sl@0: sl@0: void PrintLine(const TDesC& aText); sl@0: void Print(const TDesC& aText); sl@0: sl@0: private: sl@0: RFs& iFs; sl@0: TFileName iCertFileName; sl@0: sl@0: // Whether the input data is expeceted to match the certificate extension. sl@0: TBool iExpectedMatch; sl@0: sl@0: // Whether the parsing of extension is expected to fail. sl@0: TBool iExpectedCorrupt; sl@0: sl@0: // Whether the constraints are expected within the certificate sl@0: TBool iDeviceIdsPresent; sl@0: TBool iSidsPresent; sl@0: TBool iVidsPresent; sl@0: TBool iCapabilitiesPresent; sl@0: sl@0: // The expected values associated with the extensions sl@0: RPointerArray iExpectedDeviceIdList; sl@0: RArray iExpectedSidList; sl@0: RArray iExpectedVidList; sl@0: TCapabilitySet iExpectedCapabilities; sl@0: }; sl@0: sl@0: #endif