sl@0: /* sl@0: * Copyright (c) 2006-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: * Defines class used for testing pbe param internalization and externalization. sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: */ sl@0: sl@0: #ifndef TEXTERNPBEPARAMS_H sl@0: #define TEXTERNPBEPARAMS_H sl@0: sl@0: #include sl@0: #include "t_testaction.h" sl@0: #include "t_input.h" sl@0: sl@0: class CExternPbeParams : public CTestAction sl@0: /** sl@0: This class tests thatn encryption parameters can be sl@0: successfully externalized and restored. It is also used sl@0: to ensure pre-PKSC#12 parameters can be read when PKCS#12 sl@0: is enabled. sl@0: */ sl@0: { sl@0: public: sl@0: static CTestAction* NewL( sl@0: RFs& aFs, CConsoleBase& aConsole, sl@0: Output& aOut, const TTestActionSpec& aTestActionSpec); sl@0: virtual ~CExternPbeParams(); sl@0: sl@0: // implement CTestAction sl@0: virtual void PerformAction(TRequestStatus& aStatus); sl@0: virtual void DoReportAction(); sl@0: virtual void DoCheckResult(TInt aError); sl@0: sl@0: // override CTestAction sl@0: virtual void DoPerformPrerequisite(TRequestStatus& aStatus); sl@0: virtual void DoPerformPostrequisite(TRequestStatus& aStatus); sl@0: sl@0: private: sl@0: CExternPbeParams(CConsoleBase& aConsole, Output& aOut, RFs& aFs); sl@0: void ConstructL(const TTestActionSpec& aTestActionSpec); sl@0: sl@0: void DoPerformPrerequisiteL(); sl@0: sl@0: static HBufC8* ReadHexStringL(const TDesC8& aBody, const TDesC8& aTag); sl@0: static TInt ReadDecStringL(const TDesC8& aBody, const TDesC8& aTag); sl@0: static HBufC8* ReadStringLC(const TDesC8& aBody, const TDesC8& aTag); sl@0: sl@0: CPBEncryptParms* InternalizeEncryptionParamsLC(const TDesC& aFileName); sl@0: void CompareAgainstTestFileL(const TDesC& aFileName, const CPBEncryptParms& aParams); sl@0: void TestDecodeMatchesScriptL(const TDesC& aFileName); sl@0: void TestReExternMatchesL(const TDesC& aFileName); sl@0: void TestScratchExternL(const TDesC& aFileName); sl@0: sl@0: private: sl@0: /** File server session used to write params to, and read params from, files. */ sl@0: RFs& iFs; sl@0: sl@0: /** Element body text. */ sl@0: HBufC8* iBody; sl@0: sl@0: /** Original externalized filename. */ sl@0: HBufC8* iOrigFileName; sl@0: /** Numeric value of expected cipher. */ sl@0: TInt iExpCipher; sl@0: /** Expected salt. */ sl@0: HBufC8* iExpSalt; sl@0: /** Expected IV. */ sl@0: HBufC8* iExpIv; sl@0: /** Expected iteration count. */ sl@0: TInt iExpIterCount; sl@0: /** sl@0: Expected key derivation function. This is not stored sl@0: as CPBEncryptParms::TKdf, which is not available when sl@0: SYMBIAN_PKCS12 is not defined. sl@0: */ sl@0: TInt iExpKdf; sl@0: }; sl@0: sl@0: #endif // #ifndef TEXTERNPBEPARAMS_H sl@0: