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

📄 dhkeyobject.java

📁 Application to generate Diffie-Hellman algorith encryption
💻 JAVA
字号:
package src;

import java.io.*;
import java.util.Date;
import java.math.BigInteger;
import java.security.*;

/*
* This object is used for Public Key Exchange. 
* The Crypto routines require it.  I haven't put the heavy
* duty methods in here because I want it to stay small
*/ 

class DHKeyObject implements Serializable {

	BigInteger n,g;    /* These two make up the public Key */
	
	String Description;
	Date created;
	
	DHKeyObject(BigInteger N, BigInteger G,String what) {
		
		n = N;
		g = G;
		
		Description = what;
		created = new Date();
	}
	
	/* You may wish to customize the following */

	public String toString() {
		
		StringBuffer scratch = new StringBuffer();
		
		scratch.append("Public Key(n): " + n.toString(32) + "\n" );
		scratch.append("Public Key(g): " + g.toString(32) + "\n" );
		scratch.append("Description: "   + Description  + "\n" );
		scratch.append("Created: "       + created );
		
		return scratch.toString();
	}
}

⌨️ 快捷键说明

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