os/security/cryptoservices/filebasedcertificateandkeystores/test/keytool/keytool_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 __KEYTOOL_ENGINE_H_
    20 #define __KEYTOOL_ENGINE_H_
    21 
    22 #include <e32base.h>
    23 #include <unifiedkeystore.h>
    24 
    25 #include "keytool_commands.h"
    26 
    27 class CKeyToolController;
    28 
    29 class CKeyToolEngine : public CActive
    30 	{
    31 public:
    32 	static CKeyToolEngine* NewLC(CKeyToolController* aController);
    33 	static CKeyToolEngine* NewL(CKeyToolController* aController);
    34 	~CKeyToolEngine();
    35 	void ConstructL();	
    36 		
    37 public: // Actual commands
    38 	void ListL(CKeyToolParameters* aParam);
    39 	void ImportL(CKeyToolParameters* aParam);
    40 	void RemoveL(CKeyToolParameters* aParam);
    41 	void DisplayUsageL(CKeyToolParameters* aParam);
    42 	void ListStoresL(CKeyToolParameters* aParam);	
    43 	void SetPolicyL(CKeyToolParameters* aParam);
    44 #ifdef KEYTOOL
    45 	void MigrateStoreL(CKeyToolParameters* aParam);
    46 #endif // KEYTOOL
    47 	
    48 public: // From CActive
    49 	void RunL();
    50 	void DoCancel();
    51 	TInt RunError(TInt aError);
    52 
    53 protected:
    54 	void InitializeL();
    55 
    56 private:
    57 	CKeyToolEngine(CKeyToolController* aController);
    58 		
    59 private:
    60 	enum 
    61 		{		
    62 		EInitialise,
    63 		EExecuting,
    64 		EDone
    65 		} iState;
    66 	enum 
    67 		{
    68 		EIdle,
    69 		EList,
    70 		EImport,
    71 		ERemove,
    72 		ESetPolicy,
    73 #ifdef KEYTOOL
    74 		EMigrateStore,
    75 #endif // KEYTOOL
    76 		} iCurrentAction;
    77 		
    78 	TBool iInitialized;
    79 	TBool iActiveStarted;	
    80 	CKeyToolCommand* iHandler;		
    81 	CKeyToolParameters* iParam;
    82 	CKeyToolController* iController;
    83 	
    84 	RFs iFs;
    85 	CUnifiedKeyStore* iKeyStore;
    86 	CActiveScheduler* iScheduler;	
    87 #ifdef KEYTOOL
    88 	CKeytoolMigrateStore* iMigrateStoreHandler;
    89 #endif // KEYTOOL
    90 	};
    91 	
    92 #endif 
    93