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.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: 
sl@0
    15
* CRetrieveCertificate class implementation
sl@0
    16
*
sl@0
    17
*/
sl@0
    18
sl@0
    19
sl@0
    20
/**
sl@0
    21
 @file 
sl@0
    22
 @internalTechnology
sl@0
    23
*/
sl@0
    24
 
sl@0
    25
#ifndef __T_RETRIEVE_H__
sl@0
    26
#define __T_RETRIEVE_H__
sl@0
    27
sl@0
    28
#include "t_certstoreactions.h"
sl@0
    29
sl@0
    30
class CCertificate;
sl@0
    31
sl@0
    32
/**
sl@0
    33
 * An action to test retrieving certificate data.
sl@0
    34
 */
sl@0
    35
class CRetrieveCertificate : public CCertStoreTestAction
sl@0
    36
	{
sl@0
    37
public:
sl@0
    38
	static CTestAction* NewL(RFs& aFs,
sl@0
    39
							 CConsoleBase& aConsole,
sl@0
    40
							 Output& aOut,
sl@0
    41
							 const TTestActionSpec& aTestActionSpec);
sl@0
    42
	~CRetrieveCertificate();
sl@0
    43
	
sl@0
    44
	virtual void PerformAction(TRequestStatus& aStatus);
sl@0
    45
	virtual void PerformCancel();
sl@0
    46
	virtual void Reset();
sl@0
    47
	virtual void DoReportAction();
sl@0
    48
	virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
sl@0
    49
	virtual void DoCheckResult(TInt aError);
sl@0
    50
sl@0
    51
private:
sl@0
    52
	CRetrieveCertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
sl@0
    53
	void ConstructL(const TTestActionSpec& aTestActionSpec);
sl@0
    54
sl@0
    55
	void SetDeletable(const TDesC8& aDeletableString);
sl@0
    56
	void SetFormatL(const TDesC8& aFormatString);
sl@0
    57
	TBool ValidCertInfo();
sl@0
    58
	void DoWriteResultL();
sl@0
    59
	
sl@0
    60
private:
sl@0
    61
	enum TState
sl@0
    62
		{
sl@0
    63
		EList,
sl@0
    64
		ERetrieveData,
sl@0
    65
		EParseData,
sl@0
    66
		ERetrieveCert,
sl@0
    67
		ECheckRetrieve,
sl@0
    68
		EFinished
sl@0
    69
		};
sl@0
    70
sl@0
    71
	TState iState;
sl@0
    72
	TCertLabel iLabel;
sl@0
    73
	CCertAttributeFilter* iFilter;
sl@0
    74
	RMPointerArray<CCTCertInfo> iCertInfos;
sl@0
    75
	CCTCertInfo* iCertInfo;
sl@0
    76
	HBufC8* iData;
sl@0
    77
	TPtr8 iDataPtr;
sl@0
    78
	CCertificate* iCert;
sl@0
    79
	
sl@0
    80
	// for format and deletable attribute tests
sl@0
    81
	TCertificateFormat iFormat;
sl@0
    82
	TBool iDeletable;
sl@0
    83
	TBool iTestForDeletable;
sl@0
    84
	};
sl@0
    85
sl@0
    86
#endif