os/security/cryptoservices/filebasedcertificateandkeystores/test/certtool/certtool_engine.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
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
#ifndef __CERTTOOL_ENGINE_H_
sl@0
    20
#define __CERTTOOL_ENGINE_H_
sl@0
    21
sl@0
    22
#include <e32base.h>
sl@0
    23
#include <unifiedcertstore.h>
sl@0
    24
sl@0
    25
#include "certtool_commands.h"
sl@0
    26
#include "keytool_commands.h"
sl@0
    27
sl@0
    28
class CCertToolController;
sl@0
    29
sl@0
    30
class CCertToolEngine : public CActive
sl@0
    31
	{
sl@0
    32
public:
sl@0
    33
	static CCertToolEngine* NewLC(CCertToolController* aController);
sl@0
    34
	static CCertToolEngine* NewL(CCertToolController* aController);
sl@0
    35
	~CCertToolEngine();
sl@0
    36
	void ConstructL();	
sl@0
    37
		
sl@0
    38
public: // Actual commands
sl@0
    39
	void ListL(CKeyToolParameters* aParam);
sl@0
    40
	void ImportPrivateL(CKeyToolParameters* aParam);
sl@0
    41
	void RemovePrivateL(CKeyToolParameters* aParam);
sl@0
    42
	void ImportL(CKeyToolParameters* aParam);
sl@0
    43
	void RemoveL(CKeyToolParameters* aParam);
sl@0
    44
	void SetAppsL(CKeyToolParameters* aParam);
sl@0
    45
	void ListStoresL(CKeyToolParameters* aParam);	
sl@0
    46
	void AddAppsL(CKeyToolParameters* aParam);
sl@0
    47
	void RemoveAppsL(CKeyToolParameters* aParam);
sl@0
    48
	void DisplayUsageL(CKeyToolParameters* aParam);
sl@0
    49
	void SetManagerPolicyL(CKeyToolParameters* aParam);
sl@0
    50
	
sl@0
    51
public: // From CActive
sl@0
    52
	void RunL();
sl@0
    53
	void DoCancel();
sl@0
    54
	TInt RunError(TInt aError);
sl@0
    55
sl@0
    56
private:
sl@0
    57
	CCertToolEngine(CCertToolController* aController);
sl@0
    58
	void SetupUidCommandL(CKeyToolParameters* aParam);
sl@0
    59
		
sl@0
    60
private:
sl@0
    61
	enum 
sl@0
    62
		{		
sl@0
    63
		EInitialiseKeyStore,
sl@0
    64
		EInitialise,
sl@0
    65
		EExecuting,
sl@0
    66
		EDone
sl@0
    67
		} iState;
sl@0
    68
	enum 
sl@0
    69
		{
sl@0
    70
		EIdle,
sl@0
    71
		EList,
sl@0
    72
		EImport,
sl@0
    73
		ERemove,
sl@0
    74
		EAddApps,
sl@0
    75
		ESetApps,
sl@0
    76
		ERemoveApps,
sl@0
    77
		ESetPolicy
sl@0
    78
		} iCurrentAction;
sl@0
    79
		
sl@0
    80
	CCertToolCommand* iHandler;		
sl@0
    81
	CKeyToolParameters* iParam;
sl@0
    82
	CCertToolController* iController;
sl@0
    83
	
sl@0
    84
	RFs iFs;
sl@0
    85
	CUnifiedCertStore* iCertStore;
sl@0
    86
sl@0
    87
	RFs iFsKeyStore;
sl@0
    88
	CUnifiedKeyStore* iKeyStore;
sl@0
    89
	CKeyToolCommand* iKeyHandler;		
sl@0
    90
	CKeyToolController* iKeyController;
sl@0
    91
	
sl@0
    92
	CActiveScheduler* iScheduler;	
sl@0
    93
	};
sl@0
    94
	
sl@0
    95
#endif 
sl@0
    96