sl@0: /* sl@0: * Copyright (c) 2004-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: * CRetrieveCertificate class implementation sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef __T_RETRIEVE_H__ sl@0: #define __T_RETRIEVE_H__ sl@0: sl@0: #include "t_certstoreactions.h" sl@0: sl@0: class CCertificate; sl@0: sl@0: /** sl@0: * An action to test retrieving certificate data. sl@0: */ sl@0: class CRetrieveCertificate : public CCertStoreTestAction sl@0: { sl@0: public: sl@0: static CTestAction* NewL(RFs& aFs, sl@0: CConsoleBase& aConsole, sl@0: Output& aOut, sl@0: const TTestActionSpec& aTestActionSpec); sl@0: ~CRetrieveCertificate(); sl@0: sl@0: virtual void PerformAction(TRequestStatus& aStatus); sl@0: virtual void PerformCancel(); sl@0: virtual void Reset(); sl@0: virtual void DoReportAction(); sl@0: virtual void DoPerformPostrequisite(TRequestStatus& aStatus); sl@0: virtual void DoCheckResult(TInt aError); sl@0: sl@0: private: sl@0: CRetrieveCertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut); sl@0: void ConstructL(const TTestActionSpec& aTestActionSpec); sl@0: sl@0: void SetDeletable(const TDesC8& aDeletableString); sl@0: void SetFormatL(const TDesC8& aFormatString); sl@0: TBool ValidCertInfo(); sl@0: void DoWriteResultL(); sl@0: sl@0: private: sl@0: enum TState sl@0: { sl@0: EList, sl@0: ERetrieveData, sl@0: EParseData, sl@0: ERetrieveCert, sl@0: ECheckRetrieve, sl@0: EFinished sl@0: }; sl@0: sl@0: TState iState; sl@0: TCertLabel iLabel; sl@0: CCertAttributeFilter* iFilter; sl@0: RMPointerArray iCertInfos; sl@0: CCTCertInfo* iCertInfo; sl@0: HBufC8* iData; sl@0: TPtr8 iDataPtr; sl@0: CCertificate* iCert; sl@0: sl@0: // for format and deletable attribute tests sl@0: TCertificateFormat iFormat; sl@0: TBool iDeletable; sl@0: TBool iTestForDeletable; sl@0: }; sl@0: sl@0: #endif