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