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

📄 secretkeyedit.h

📁 一个用RSA算法实现加密通信的聊天程序。
💻 H
字号:
#if !defined(AFX_SECRETKEYEDIT_H__B7CE85F6_B33D_405D_9CF7_6984C61770E9__INCLUDED_)
#define AFX_SECRETKEYEDIT_H__B7CE85F6_B33D_405D_9CF7_6984C61770E9__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SecretKeyEdit.h : header file
//
#include "RSA.h"
#include "ColorEdit.h"
/////////////////////////////////////////////////////////////////////////////
// CSecretKeyEdit dialog

#define SECRETKEY_ID		632135278	//密钥文件表示符合
#define SECRETKEY_VERSION	1			//版本号
#define SECRETKEY_PRIVATE	1			//是私钥文件
#define SECRETKEY_PUBLIC	2			//是公钥文件
struct SecretKey	//私钥或公钥文件结构
{
	SK	sk;					//私钥
	PK	pk;					//公钥
	char userName[32];		//用户名,文件名和它相同
	char qq[32];			//qq号码
	char email[32];			//email地址
	char standby[64];		//留给升级版本用
	int version;			//版本号
	int	privateOrPublic;	//这个文件是私钥为1还是公钥为2
	int	ID;					//文件标识符(632135278)
};

//m_select选择密钥编辑的用途
#define SELECT_CREATE		0
#define SELECT_PRIVATE		1
#define SELECT_PUBLIC		2

class CSecretKeyEdit : public CDialog
{
// Construction
public:
	CString m_user_private_key_file_name;	//密钥的文件全路径
	BOOL m_bCreate;		//是否在创建密钥中
	BOOL CreatePublicKey(CString fileName);
	CString m_fileName;	//密钥文件名
	CString CharToCString(char * ch,int n);
	void CStringToChar(char * ch,CString str,int n);
	int validateSecretKey(CString fileName);
	CString CharToHexToString(char m);
	int	m_select;			//密钥编辑(用户私钥编辑或好友公钥编辑或生成密钥)
							//0为生成密钥,1为打开私钥,2为打开公钥
	SecretKey m_secretKey;	//密钥结构

	CSecretKeyEdit(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CSecretKeyEdit)
	enum { IDD = IDD_SECRETKEYEDIT };
	CString	m_email;
	CString	m_qq;
	CString	m_userName;
	CString	m_secretKeyEdit;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSecretKeyEdit)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CSecretKeyEdit)
	virtual void OnOK();
	virtual void OnCancel();
	virtual BOOL OnInitDialog();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SECRETKEYEDIT_H__B7CE85F6_B33D_405D_9CF7_6984C61770E9__INCLUDED_)

⌨️ 快捷键说明

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