os/security/cryptoservices/filebasedcertificateandkeystores/test/certtool/certtool_engine.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptoservices/filebasedcertificateandkeystores/test/certtool/certtool_engine.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,96 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef __CERTTOOL_ENGINE_H_
    1.23 +#define __CERTTOOL_ENGINE_H_
    1.24 +
    1.25 +#include <e32base.h>
    1.26 +#include <unifiedcertstore.h>
    1.27 +
    1.28 +#include "certtool_commands.h"
    1.29 +#include "keytool_commands.h"
    1.30 +
    1.31 +class CCertToolController;
    1.32 +
    1.33 +class CCertToolEngine : public CActive
    1.34 +	{
    1.35 +public:
    1.36 +	static CCertToolEngine* NewLC(CCertToolController* aController);
    1.37 +	static CCertToolEngine* NewL(CCertToolController* aController);
    1.38 +	~CCertToolEngine();
    1.39 +	void ConstructL();	
    1.40 +		
    1.41 +public: // Actual commands
    1.42 +	void ListL(CKeyToolParameters* aParam);
    1.43 +	void ImportPrivateL(CKeyToolParameters* aParam);
    1.44 +	void RemovePrivateL(CKeyToolParameters* aParam);
    1.45 +	void ImportL(CKeyToolParameters* aParam);
    1.46 +	void RemoveL(CKeyToolParameters* aParam);
    1.47 +	void SetAppsL(CKeyToolParameters* aParam);
    1.48 +	void ListStoresL(CKeyToolParameters* aParam);	
    1.49 +	void AddAppsL(CKeyToolParameters* aParam);
    1.50 +	void RemoveAppsL(CKeyToolParameters* aParam);
    1.51 +	void DisplayUsageL(CKeyToolParameters* aParam);
    1.52 +	void SetManagerPolicyL(CKeyToolParameters* aParam);
    1.53 +	
    1.54 +public: // From CActive
    1.55 +	void RunL();
    1.56 +	void DoCancel();
    1.57 +	TInt RunError(TInt aError);
    1.58 +
    1.59 +private:
    1.60 +	CCertToolEngine(CCertToolController* aController);
    1.61 +	void SetupUidCommandL(CKeyToolParameters* aParam);
    1.62 +		
    1.63 +private:
    1.64 +	enum 
    1.65 +		{		
    1.66 +		EInitialiseKeyStore,
    1.67 +		EInitialise,
    1.68 +		EExecuting,
    1.69 +		EDone
    1.70 +		} iState;
    1.71 +	enum 
    1.72 +		{
    1.73 +		EIdle,
    1.74 +		EList,
    1.75 +		EImport,
    1.76 +		ERemove,
    1.77 +		EAddApps,
    1.78 +		ESetApps,
    1.79 +		ERemoveApps,
    1.80 +		ESetPolicy
    1.81 +		} iCurrentAction;
    1.82 +		
    1.83 +	CCertToolCommand* iHandler;		
    1.84 +	CKeyToolParameters* iParam;
    1.85 +	CCertToolController* iController;
    1.86 +	
    1.87 +	RFs iFs;
    1.88 +	CUnifiedCertStore* iCertStore;
    1.89 +
    1.90 +	RFs iFsKeyStore;
    1.91 +	CUnifiedKeyStore* iKeyStore;
    1.92 +	CKeyToolCommand* iKeyHandler;		
    1.93 +	CKeyToolController* iKeyController;
    1.94 +	
    1.95 +	CActiveScheduler* iScheduler;	
    1.96 +	};
    1.97 +	
    1.98 +#endif 
    1.99 +