secureswitools/makekeys/src/MAKEKEYS.H
changeset 0 ba25891c3a9e
child 25 7333d7932ef7
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 1997-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 * makekeys main function
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @internalComponent 
       
    23 */
       
    24 
       
    25 #ifndef __MAKEKEYS_H__
       
    26 #define __MAKEKEYS_H__
       
    27 
       
    28 #define KMakeKeysVersion 100
       
    29 
       
    30 enum TAppError
       
    31 	{ErrOutOfMemory =-1
       
    32 	}; 
       
    33 
       
    34 // ===========================================================================
       
    35 // INCLUDES
       
    36 // ===========================================================================
       
    37 
       
    38 #include <stdio.h>
       
    39 #include "ParseCmd.h"
       
    40 #include "utils.h"
       
    41 #include "CertificateGenerator.h"
       
    42 #include "CertificateRequestGenerator.h"
       
    43 #include "DSAKeyGenerator.h"
       
    44 #include "RSAKeyGenerator.h"
       
    45 
       
    46 // ===========================================================================
       
    47 // CLASS DEFINITION
       
    48 // ===========================================================================
       
    49 
       
    50 class CMakeKeys
       
    51 // The main application object. Controls the Key / Certificate file generation process
       
    52 	{
       
    53 	public:
       
    54 		CMakeKeys();
       
    55 		
       
    56 		int  Run(const int argc, const _TCHAR *argv[], const _TCHAR *envp[]);
       
    57 			
       
    58 	public: 
       
    59 		CKeyGenerator* m_KeyGen;
       
    60 		CCertificateGenerator* pMakeCert;
       
    61 		CCertificateRequestGenerator* pReq;
       
    62 		
       
    63 		void DoVerbage(const _TCHAR* pszText) const;
       
    64 		void DoErrMsg(const _TCHAR* pszText) const;
       
    65 		BOOL Verbose() const				  { return m_fVerbose; };
       
    66 		BOOL SetVerbose(BOOL fVerbose)		  { BOOL v = m_fVerbose; m_fVerbose = fVerbose; return v; };
       
    67 		
       
    68 	private:
       
    69 		void DoMsg(const _TCHAR* pszText1, const _TCHAR* pszText2) const;
       
    70 		void ShowBanner();
       
    71 		void ShowUsage ();
       
    72 				
       
    73 		void ShowUtilsError(TUtilsException err);
       
    74 
       
    75 		BOOL m_fVerbose;
       
    76 				
       
    77 		CParseCmd m_CmdOptions;
       
    78 	protected:
       
    79 		Mode m_dwMode;
       
    80 	};
       
    81 
       
    82 #endif // __MAKEKEYS_H__