cryptoservices/certificateandkeymgmt/tcertstore/t_unifiedcertstoreremove.h
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 1998-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 
       
    21 /**
       
    22  @file 
       
    23  @internalTechnology
       
    24 */
       
    25  
       
    26 #ifndef __T_UNIFIEDCERTSTOREREMOVE_H__
       
    27 #define __T_UNIFIEDCERTSTOREREMOVE_H__
       
    28 
       
    29 #include "t_certstoreactions.h"
       
    30 class CDeleteCertificate : public CSubscriberAction
       
    31 	{
       
    32 	
       
    33 public:
       
    34 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, 
       
    35 		const TTestActionSpec& aTestActionSpec);
       
    36 	~CDeleteCertificate();
       
    37 	
       
    38 public:
       
    39 	virtual void PerformAction(TRequestStatus& aStatus);
       
    40 	virtual void PerformCancel();
       
    41 	virtual void Reset();
       
    42 
       
    43 protected:
       
    44 	CDeleteCertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
       
    45 	void GetCerts(TRequestStatus& aStatus);
       
    46 	void DeleteCert(TRequestStatus& aStatus);
       
    47 	void ConstructL(const TTestActionSpec& aTestActionSpec);
       
    48 	void DoReportAction();
       
    49 	void DoCheckResult(TInt aError);
       
    50 	TBool CheckCertType( CCTCertInfo& aCertInfo);
       
    51 	
       
    52 protected:
       
    53 	enum TDeleteCertState
       
    54 		{
       
    55 		EIdle,
       
    56 		EGettingCerts,
       
    57 		EDeletingCert,
       
    58 		ECheckNotification,
       
    59 		EFinished
       
    60 		};
       
    61 
       
    62 protected:
       
    63 	TDeleteCertState iState;
       
    64 	TCertLabel iCertLabel;
       
    65 	RMPointerArray<CCTCertInfo> iCertInfos;
       
    66 	CCTCertInfo* iCertInfoToDelete;
       
    67 	CCertAttributeFilter* iFilter;
       
    68 	TBool iDeleteAllCerts;
       
    69 	HBufC8* iCertDeleteType;
       
    70 	};
       
    71 
       
    72 class CDeleteRetrieveCertificate : public CSubscriberAction
       
    73 	{
       
    74 public:
       
    75 	virtual void PerformAction(TRequestStatus& aStatus);
       
    76 	virtual void PerformCancel();
       
    77 	virtual void Reset();
       
    78 
       
    79 protected:
       
    80 	CDeleteRetrieveCertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
       
    81 	virtual void GetCerts(TRequestStatus& aStatus) = 0;
       
    82 	virtual void RetrieveCerts(TRequestStatus& aStatus)	 = 0;
       
    83 	virtual void DeleteCert(TRequestStatus& aStatus) = 0;
       
    84 
       
    85 protected:
       
    86 	enum TDeleteCertState
       
    87 		{
       
    88 		EIdle,
       
    89 		EGettingCerts,
       
    90 		EDeletingCert,
       
    91 		ECheckNotification,
       
    92 		EFinished
       
    93 		};
       
    94 
       
    95 protected:
       
    96 	TDeleteCertState iState;
       
    97 	TCertLabel iCertLabel;
       
    98 	RPointerArray<HBufC8>* iCertlisted;
       
    99 	RMPointerArray<CCTCertInfo> iCertInfos;
       
   100 	CCTCertInfo* iCertInfoToDelete;
       
   101 	CCTCertInfo* iCertInfoToRetrieve;
       
   102 	TPtr8* iBuf;
       
   103 	};
       
   104 
       
   105 class CDeleteRetrieveCACertificate : public CDeleteRetrieveCertificate
       
   106 	{
       
   107 public:
       
   108 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
       
   109 		const TTestActionSpec& aTestActionSpec);
       
   110 	~CDeleteRetrieveCACertificate();
       
   111 
       
   112 private:
       
   113 	CDeleteRetrieveCACertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
       
   114 	void ConstructL(const TTestActionSpec& aTestActionSpec);
       
   115 	void GetCerts(TRequestStatus& aStatus);
       
   116 	void RetrieveCerts(TRequestStatus& aStatus);
       
   117 	void DeleteCert(TRequestStatus& aStatus);
       
   118 	void DoReportAction();
       
   119 	void DoCheckResult(TInt aError);
       
   120 
       
   121 private:
       
   122 	CCertAttributeFilter* iFilter;
       
   123 	};
       
   124 
       
   125 class CDeleteRetrieveUserCertificate : public CDeleteRetrieveCertificate
       
   126 	{
       
   127 public:
       
   128 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, 
       
   129 		const TTestActionSpec& aTestActionSpec);
       
   130 	~CDeleteRetrieveUserCertificate();
       
   131 private:
       
   132 	CDeleteRetrieveUserCertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
       
   133 	void ConstructL(const TTestActionSpec& aTestActionSpec);
       
   134 	void GetCerts(TRequestStatus& aStatus);
       
   135 	void RetrieveCerts(TRequestStatus& aStatus);
       
   136 	void DeleteCert(TRequestStatus& aStatus);
       
   137 	void DoReportAction();
       
   138 	void DoCheckResult(TInt aError);
       
   139 
       
   140 private:
       
   141 	CCertAttributeFilter* iFilter;
       
   142 	};
       
   143 
       
   144 #endif