os/security/crypto/weakcrypto/test/tasymmetric/trsaencryptfb.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 #ifndef __TRSAENCRYPTFB_H__
    20 #define __TRSAENCRYPTFB_H__
    21 
    22 #include "t_testaction.h"
    23 #include <e32std.h>
    24 #include <asymmetric.h>
    25 #include <asymmetrickeys.h>
    26 #include <random.h>
    27 
    28 class CRSAEncryptFB : public CTestAction
    29 {
    30 public:
    31 	~CRSAEncryptFB();
    32 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole,
    33 		Output& aOut, const TTestActionSpec& aTestActionSpec);
    34 	static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole,
    35 		Output& aOut, const TTestActionSpec& aTestActionSpec);
    36 	void DoPerformPrerequisite(TRequestStatus& aStatus);
    37 	void DoPerformPostrequisite(TRequestStatus& aStatus);
    38 	void DoReportAction(void);
    39 	void DoCheckResult(TInt);
    40 	void PerformAction(TRequestStatus& aStatus);
    41 
    42 private:
    43 	CRSAEncryptFB(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
    44 	inline TRSAPrivateKeyType TypeOfCrypto() {return iCryptoType;}
    45 	void ConstructL(const TTestActionSpec& aTestActionSpec);
    46 	void Hex(HBufC8& string);
    47 	void DoPerformActionL();
    48 	void DoPerformanceTestActionL();
    49 	void LogKeyData(const CRSAPublicKey* aPublicKey,
    50 							const CRSAPrivateKeyCRT* aPrivateKeyCRT, const TDesC8& aCipherText);
    51 
    52 private:
    53 	RFs& iFs;
    54 	HBufC8* iBody;
    55 	HBufC8* iInput;
    56 	TInt iActionResult;
    57 	TInt iKeyBits;
    58 	TInt iPerfTestIterations;
    59 	TRSAPrivateKeyType iCryptoType;
    60 };
    61 
    62 #endif