os/security/cryptoservices/certificateandkeymgmt/tx509/comparisontest.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) 2008-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 /**
    20  @file 
    21  @internalTechnology
    22  @test
    23 */
    24  
    25 #ifndef __COMPARISONTEST_H
    26 #define __COMPARISONTEST_H
    27 
    28 #include <e32base.h>
    29 #include <e32cmn.h>
    30 
    31 #include "t_testaction.h"
    32 
    33 class CX509Certificate;
    34 
    35 /**
    36 Validates the comparison of certificates and issuer-names.
    37 */
    38 class CComparisonTest : public CTestAction  
    39 {
    40 public:
    41 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, 
    42 		Output& aOut, const TTestActionSpec& aTestActionSpec);
    43 	static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole,
    44 		Output& aOut, const TTestActionSpec& aTestActionSpec);
    45 	~CComparisonTest();
    46 
    47 public:
    48 	// From CTestAction
    49 	void DoPerformPrerequisite(TRequestStatus& aStatus);
    50 	void DoPerformPostrequisite(TRequestStatus& aStatus);
    51 	void PerformAction(TRequestStatus& aStatus);
    52 
    53 	void DoReportAction();
    54 	void DoCheckResult(TInt aError);
    55     
    56 private:
    57 	void ConstructL(const TTestActionSpec& aTestActionSpec);
    58 	CX509Certificate* ReadCertificateL(const TDesC8& aFileName);
    59 	CComparisonTest(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
    60 	void DoActionL();	
    61 
    62 private:
    63 	RFs& iFs;						/// shared file server session
    64 	CX509Certificate* iCert1;		/// LHS of comparison
    65 	CX509Certificate* iCert2;		/// RHS of comparison
    66 	TBool iMatchExpected;			/// ETrue if CX509Certificate::IsEqualL is expected to return ETrue
    67 };
    68 
    69 #endif