⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csecret.h

📁 加密解密
💻 H
字号:
/*
*
*
*
*
*
*
*
*
*/

#ifndef  __CSECRET_H_
#define  __CSECRET_H_

#ifndef PGP_WIN32
#define PGP_WIN32 1 
#endif
#include "pgpErrors.h"
#include "pgpEncode.h"
#include "pgpFeatures.h"
#include "pgpOptionList.h"




class  CSecret
{


private :
	typedef enum   
	{
		kDecode_NoOption	= 0,
		kDecode_DumpTar,
		kDecode_UnpackTar,
		kDecode_MakeTarCache,
		kDecode_AllocOutput,
		kDecode_FileOutput,
		kDecode_Ignore_Output,
   		PGP_ENUM_FORCE( EventHandlerOptions )
	 } EventHandlerOptions;
	 
	 
	typedef struct 
	{
		EventHandlerOptions option;
  		PGPByte				*sessionKey;
		PGPSize				sessionKeySize;
		PGPFileSpecRef		outFile;
		PGPByte				*outBuf;
		PGPSize				outBufSize;
		PGPByte				*outDir;
		
		int					keyCount;
		PGPKeyIterRef		keyIter;
 		struct {
			PGPKeyID		keyID;
			const   char    *passPhrase;
		} key[8];
		
	 } DecodeInfo;


public:
	CSecret() ;
	~CSecret() ;
	bool  OnInit() ;
	void Clearup() ;
	PGPError importKeys(PGPContextRef context,  const PGPChar8 *path, PGPInputFormat format, PGPKeyDBRef *keyDB ) ;
	PGPError importKeys (PGPContextRef context,  const PGPChar8 *path, PGPFileSpecRef &fileSpec );
	PGPError EncryptingFile(const CString &strUserID ,const CString &strCer , const CString &strPlain , const CString &strScecret) ;

	PGPError EncryptingFile(const CString &strUserID ,const CString &strPublic , const CString &strPrivate , const CString &strPlain , const CString &strScecret) ;

	PGPError EncrptingBuffer(const CString &strUserID , const CString &strFile) ;
	PGPError ConsoleAcquireEntropy(PGPContextRef 	context , PGPUInt32	 entropyNeeded ,PGPUInt32 *	pEntropyAcquired ,PGPBoolean bOutputProgress) ;
	void  InitDecodeInfo( DecodeInfo* info) ;
	void  CleanUpDecodeInfo( DecodeInfo* info) ;

	static PGPError  OptestEventHandler(PGPContextRef context, PGPEvent *event, PGPUserValue userValue) ;
	PGPChar *	key_algor_table(int keytype);
	PGPChar *	hash_algor_table(int algor);
	static PGPChar *	cipher_algor_table(int algor);
	static char *extname (const char *name) ;
	PGPChar *	compression_algor_table(int algor);
	PGPChar *	email_encoding_table(int encoding);
protected :
	PGPContextRef  m_pContext ;

};








#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -