os/security/cryptoservices/certificateandkeymgmt/tcertstore/t_retrieve.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) 2004-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 * CRetrieveCertificate class implementation
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file 
    22  @internalTechnology
    23 */
    24  
    25 #ifndef __T_RETRIEVE_H__
    26 #define __T_RETRIEVE_H__
    27 
    28 #include "t_certstoreactions.h"
    29 
    30 class CCertificate;
    31 
    32 /**
    33  * An action to test retrieving certificate data.
    34  */
    35 class CRetrieveCertificate : public CCertStoreTestAction
    36 	{
    37 public:
    38 	static CTestAction* NewL(RFs& aFs,
    39 							 CConsoleBase& aConsole,
    40 							 Output& aOut,
    41 							 const TTestActionSpec& aTestActionSpec);
    42 	~CRetrieveCertificate();
    43 	
    44 	virtual void PerformAction(TRequestStatus& aStatus);
    45 	virtual void PerformCancel();
    46 	virtual void Reset();
    47 	virtual void DoReportAction();
    48 	virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
    49 	virtual void DoCheckResult(TInt aError);
    50 
    51 private:
    52 	CRetrieveCertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
    53 	void ConstructL(const TTestActionSpec& aTestActionSpec);
    54 
    55 	void SetDeletable(const TDesC8& aDeletableString);
    56 	void SetFormatL(const TDesC8& aFormatString);
    57 	TBool ValidCertInfo();
    58 	void DoWriteResultL();
    59 	
    60 private:
    61 	enum TState
    62 		{
    63 		EList,
    64 		ERetrieveData,
    65 		EParseData,
    66 		ERetrieveCert,
    67 		ECheckRetrieve,
    68 		EFinished
    69 		};
    70 
    71 	TState iState;
    72 	TCertLabel iLabel;
    73 	CCertAttributeFilter* iFilter;
    74 	RMPointerArray<CCTCertInfo> iCertInfos;
    75 	CCTCertInfo* iCertInfo;
    76 	HBufC8* iData;
    77 	TPtr8 iDataPtr;
    78 	CCertificate* iCert;
    79 	
    80 	// for format and deletable attribute tests
    81 	TCertificateFormat iFormat;
    82 	TBool iDeletable;
    83 	TBool iTestForDeletable;
    84 	};
    85 
    86 #endif