2004-02-15 04:47:32 +00:00
|
|
|
#ifndef CryptManager_H
|
|
|
|
|
#define CryptManager_H
|
|
|
|
|
|
2004-02-22 02:15:34 +00:00
|
|
|
const CString SIGNATURE_APPEND = ".sig";
|
|
|
|
|
|
2004-02-15 04:47:32 +00:00
|
|
|
class CryptManager
|
|
|
|
|
{
|
|
|
|
|
public:
|
2004-02-15 05:45:18 +00:00
|
|
|
CryptManager();
|
|
|
|
|
~CryptManager();
|
|
|
|
|
|
2004-02-20 02:28:23 +00:00
|
|
|
static void GenerateRSAKey( unsigned int keyLength, CString privFilename, CString pubFilename, CString seed );
|
2004-02-15 04:47:32 +00:00
|
|
|
|
2004-02-22 02:15:34 +00:00
|
|
|
static void SignFileToFile( CString sPath, CString sSignatureFile = "" );
|
|
|
|
|
static bool VerifyFileWithFile( CString sPath, CString sSignatureFile = "" );
|
2004-02-15 04:47:32 +00:00
|
|
|
|
2004-02-22 02:15:34 +00:00
|
|
|
static CString Sign( CString sPath );
|
|
|
|
|
static bool Verify( CString sPath, CString sSignature );
|
2004-02-17 01:16:57 +00:00
|
|
|
|
2004-02-22 02:15:34 +00:00
|
|
|
static CString GetMD5( CString fn ); // in Hex
|
2004-02-16 05:35:06 +00:00
|
|
|
|
|
|
|
|
static CString GetPublicKeyFileName();
|
2004-02-15 04:47:32 +00:00
|
|
|
};
|
|
|
|
|
|
2004-02-15 05:45:18 +00:00
|
|
|
extern CryptManager* CRYPTMAN; // global and accessable from anywhere in our program
|
|
|
|
|
|
2004-02-15 04:47:32 +00:00
|
|
|
#endif
|