os/security/cryptoservices/certificateandkeymgmt/tpkixcert_tef/src/validateteststep.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200 (2012-06-15)
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 */
    23 
    24 #ifndef VALIDATETESTSTEP_H
    25 #define VALIDATETESTSTEP_H
    26 
    27 #include "pkixcertstepbase.h"
    28 #include <pkixcertchain.h>
    29 #include <securitydefs.h>
    30 #include <x509certchain.h>
    31 #include <e32std.h>
    32 
    33 
    34 _LIT(KValidateCertChainStep, "ValidateCertChain");
    35 
    36 _LIT(KError, "error");
    37 _LIT(KErrorIndex, "errorindex");
    38 _LIT(KNumberOfCerts, "numberofcerts");
    39 _LIT(KCert, "cert");
    40 _LIT(KOldWarnings, "oldwarning");
    41 _LIT(KCritOid, "critoid");
    42 _LIT(KPolicyIndex, "policyindex");
    43 
    44 class CValidateCertChainStep;
    45 
    46 class CValidateCertChainHelper : public CActive
    47 	{
    48 public:
    49 	CValidateCertChainHelper(CTestExecuteLogger& aLogger);
    50 	~CValidateCertChainHelper();
    51 	
    52 	TInt PerformTestL(CPKIXCertChain* aCertChain, CPKIXValidationResult& aValidResult, TTime aValidateTime);
    53 	void DoCancel();
    54 	void RunL();
    55 	virtual TInt RunError(TInt aError);
    56 
    57 	CTestExecuteLogger& Logger(){return iLogger;}
    58 
    59 private:
    60 	CTestExecuteLogger& iLogger;
    61 	TInt iRunError;
    62 	CPKIXCertChain* iCertChain;	//not owned
    63 	
    64 	};
    65 	
    66 	
    67 	
    68 class CValidateCertChainStep : public CPkixCertStepBase
    69 	{
    70 public:
    71 	CValidateCertChainStep();
    72 	~CValidateCertChainStep();
    73 	
    74 	virtual TVerdict doTestStepPreambleL();
    75 	
    76 	virtual void PerformTestL();
    77 
    78 	void ValidateL(TTime aValidateTime, TDes& aConfigSection);
    79 	
    80 	void TransferToNewWarningsL(RArray<TInt>& aOldWarnings, RArray<TValidationStatus>& aNewWarnings, TInt aCertIndex);
    81 	//takes away from aWarningsToCheckIn
    82 	void CheckWarningsPresentAndRemoveL(const RArray<TValidationStatus>& aWarningsToCheckFor, RArray<TValidationStatus>& aWarningsToCheckIn);
    83 	TBool ValidationStatusEqual(const TValidationStatus& aValidationStatus1, const TValidationStatus& aValidationStatus2);
    84 	//takes away from aOidsToCheckAgainst
    85 	void CheckCriticalExtsPresentAndRemoveL(const RPointerArray<TDesC>& aOidsToLookFor, RArray<TPtrC>& aOidsToCheckAgainst);
    86 	
    87 private:
    88 	CValidateCertChainHelper*	iActiveObject;
    89 	TInt iNumberOfCerts;
    90 
    91 		
    92 	};	
    93 
    94 #endif // VALIDATETESTSTEP_H