os/security/cryptoservices/certificateandkeymgmt/tcertstore/t_certstoreactionsclient.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-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 
    27 #ifndef __T_CERTSTOREACTIONSCLIENT_H__
    28 #define __T_CERTSTOREACTIONSCLIENT_H__
    29 
    30 #include "t_certstoreactions.h"
    31 
    32 class CInitCertificateAppInfoManager : public CCertStoreTestAction
    33 	{
    34 public:
    35 	static CTestAction* NewL(RFs &aFs,
    36 		CConsoleBase& aConsole, Output& aOut, const TTestActionSpec& aTestActionSpec);
    37 	static CTestAction* NewLC(RFs &aFs, 
    38 		CConsoleBase& aConsole, Output& aOut, const TTestActionSpec& aTestActionSpec);
    39 	virtual ~CInitCertificateAppInfoManager();
    40 	virtual void PerformAction(TRequestStatus& aStatus);
    41 	virtual void PerformCancel();
    42 	virtual void Reset();
    43 
    44 private:
    45 	CInitCertificateAppInfoManager(RFs &aFs, 
    46 		CConsoleBase& aConsole, Output& aOut);
    47 	void ConstructL(const TTestActionSpec& aTestActionSpec);
    48 
    49 	void HandleEInit();
    50 
    51 	void DoReportAction();
    52 	void DoCheckResult(TInt aError);
    53 
    54 private:
    55 	enum TState
    56 		{
    57 		EInit,
    58 		EFinished
    59 		};
    60 
    61 private:
    62 	TState iState;
    63 	RFs& iFs;
    64 	};
    65 
    66 class CDeleteCertificateAppInfoManager : public CCertStoreTestAction
    67 	{
    68 public:
    69 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, 
    70 		const TTestActionSpec& aTestActionSpec);
    71 	~CDeleteCertificateAppInfoManager();
    72 	virtual void PerformAction(TRequestStatus& aStatus);
    73 	virtual void PerformCancel();
    74 	virtual void Reset();
    75 
    76 private:
    77 	CDeleteCertificateAppInfoManager(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
    78 	void ConstructL(const TTestActionSpec& aTestActionSpec);
    79 	void DoReportAction();
    80 	void DoCheckResult(TInt aError);
    81 
    82 private:
    83 	enum TState
    84 		{
    85 		EDelete,
    86 		EFinished
    87 		};
    88 
    89 private:
    90 	TState iState;
    91 	};
    92 
    93 /**
    94  * Client management tests
    95  */
    96 class CAddClient : public CCertStoreTestAction
    97 	{
    98 public:
    99 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, 
   100 		const TTestActionSpec& aTestActionSpec);
   101 	~CAddClient();
   102 	virtual void PerformAction(TRequestStatus& aStatus);
   103 	virtual void PerformCancel();
   104 	virtual void Reset();
   105 
   106 private:
   107 	CAddClient(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
   108 	void ConstructL(const TTestActionSpec& aTestActionSpec);
   109 	void DoReportAction();
   110 	void DoCheckResult(TInt aError);
   111 
   112 private:
   113 	enum TState
   114 		{
   115 		EAdd,
   116 		EFinished
   117 		};
   118 
   119 private:
   120 	TState iState;
   121 	TCertificateAppInfo* iClientInfo;
   122 	};
   123 
   124 class CGetClients : public CCertStoreTestAction
   125 	{
   126 public:
   127 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, 
   128 		const TTestActionSpec& aTestActionSpec);
   129 	~CGetClients();
   130 	virtual void PerformAction(TRequestStatus& aStatus);
   131 	virtual void PerformCancel();
   132 	virtual void Reset();
   133 
   134 private:
   135 	CGetClients(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
   136 	void ConstructL(const TTestActionSpec& aTestActionSpec);
   137 	void DoReportAction();
   138 	void DoCheckResult(TInt aError);
   139 
   140 private:
   141 	enum TState
   142 		{
   143 		EGet,
   144 		EFinished
   145 		};
   146 
   147 private:
   148 	TState iState;
   149 	const RArray<TCertificateAppInfo>* iClients;
   150 	RArray<TUid> iExpectedClients;
   151 	};
   152 
   153 class CRemoveClient : public CCertStoreTestAction
   154 	{
   155 public:
   156 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
   157 		const TTestActionSpec& aTestActionSpec);
   158 	~CRemoveClient();
   159 	virtual void PerformAction(TRequestStatus& aStatus);
   160 	virtual void PerformCancel();
   161 	virtual void Reset();
   162 
   163 private:
   164 	CRemoveClient(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
   165 	void ConstructL(const TTestActionSpec& aTestActionSpec);
   166 	void DoReportAction();
   167 	void DoCheckResult(TInt aError);
   168 
   169 private:
   170 	enum TState
   171 		{
   172 		ERemove,
   173 		EFinished
   174 		};
   175 
   176 private:
   177 	TState iState;
   178 	TUid iUid;
   179 	};
   180 
   181 #endif