Update contrib.
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Defines class used for testing pbe param internalization and externalization.
26 #ifndef TEXTERNPBEPARAMS_H
27 #define TEXTERNPBEPARAMS_H
30 #include "t_testaction.h"
33 class CExternPbeParams : public CTestAction
35 This class tests thatn encryption parameters can be
36 successfully externalized and restored. It is also used
37 to ensure pre-PKSC#12 parameters can be read when PKCS#12
42 static CTestAction* NewL(
43 RFs& aFs, CConsoleBase& aConsole,
44 Output& aOut, const TTestActionSpec& aTestActionSpec);
45 virtual ~CExternPbeParams();
47 // implement CTestAction
48 virtual void PerformAction(TRequestStatus& aStatus);
49 virtual void DoReportAction();
50 virtual void DoCheckResult(TInt aError);
52 // override CTestAction
53 virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
54 virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
57 CExternPbeParams(CConsoleBase& aConsole, Output& aOut, RFs& aFs);
58 void ConstructL(const TTestActionSpec& aTestActionSpec);
60 void DoPerformPrerequisiteL();
62 static HBufC8* ReadHexStringL(const TDesC8& aBody, const TDesC8& aTag);
63 static TInt ReadDecStringL(const TDesC8& aBody, const TDesC8& aTag);
64 static HBufC8* ReadStringLC(const TDesC8& aBody, const TDesC8& aTag);
66 CPBEncryptParms* InternalizeEncryptionParamsLC(const TDesC& aFileName);
67 void CompareAgainstTestFileL(const TDesC& aFileName, const CPBEncryptParms& aParams);
68 void TestDecodeMatchesScriptL(const TDesC& aFileName);
69 void TestReExternMatchesL(const TDesC& aFileName);
70 void TestScratchExternL(const TDesC& aFileName);
73 /** File server session used to write params to, and read params from, files. */
76 /** Element body text. */
79 /** Original externalized filename. */
80 HBufC8* iOrigFileName;
81 /** Numeric value of expected cipher. */
87 /** Expected iteration count. */
90 Expected key derivation function. This is not stored
91 as CPBEncryptParms::TKdf, which is not available when
92 SYMBIAN_PKCS12 is not defined.
97 #endif // #ifndef TEXTERNPBEPARAMS_H