java

位置:IT落伍者 >> java >> 浏览文章

用Java实现KeyFile


发布日期:2022年07月16日
 
用Java实现KeyFile

KeyFile的实现是这样

/**

* KeyFile<br/>

* Date: <br/>

* Time: ::<br/>

*

* @author vhly[FR]

*/

public class KeyFile {

/*

<KeyType type=>

<LicenseKey keyVersion=>

<ExpireDate value=/>

<EMail value=/>

<MachinelInfo value=Java/>

<UserName value=vhly FR/>

<ProductName value=Smart Development Environment Enterprise Edition for IntelliJ/>

<ProductVersion value=/>

<ProductBuild value=/>

<ProductRegisterDate value=/>

<SerialNumber value=/>

<VerifyKey value=NTQRANjE+NzxOUA/PkIzNEdBOEEPgPUBbCATUFDPzycXRWalxfXNlhiFHVpYZIEZhmdXFZtIkVeeCcHFyctLFRnhGZaJzfWsiUGlzdxfSNrfXQjVnBcydVgPDUPzEMMNUAQEQQXfQ=/>

<Evaluation value=false/>

<Type value=/>

</LicenseKey>

</KeyType>

*/

private int keyType;

private String keyVersion;

private Date expiredDate;

private String email;

private String machinelInfo;

private String userName;

private String productName;

private String productVersion;

private String productBuild;

private Date registerDate;

private String serialNumber;

private String verifyKey;

private boolean evaluation;

private String upgradeSN;

private String tagValue;

private int type;

public String toXML(){

String ret = null;

StringBuffer ** = new StringBuffer();

**append(<?xml version=\\ encoding=\UTF\?>\n);

**append(<KeyType type=\+getKeyType()+\>\n);

**append(<LicenseKey keyVersion=\\>\n);

**append(<ExpireDate value=\+getExpiredDate()getTime()+\/>\n);

**append(<EMail value=\+getEmail()+\/>\n);

**append(<MachinelInfo value=\Java\/>\n);

**append(<UserName value=\+getUserName()+\/>\n);

**append(<ProductName value=\+getProductName()+\/>\n);

**append(<ProductVersion value=\+getProductVersion()+\/>\n);

**append(<ProductBuild value=\+getProductBuild()+\/>\n);

**append(<ProductRegisterDate value=\+getRegisterDate()getTime()+\/>\n);

**append(<SerialNumber value=\+getSerialNumber()+\/>\n);

**append(<VerifyKey value=\+getVerifyKeyResult()+\/>\n);

**append(<Evaluation value=\+isEvaluation()+\/>\n);

**append(<Type value=\\/>\n);

**append(</LicenseKey>\n);

**append(</KeyType>\n);

ret = **toString();

** = null;

return ret;

}

public KeyFile() {

keyType = ;

keyVersion = ;

Calendar cl = CalendargetInstance();

cladd(CalendarYEAR);

long d = clgetTime()getTime();

d /= ;

d *= ;

expiredDate = new Date(d);

email = ;

machinelInfo = Java;

userName = qqyang;

productName = Visual Paradigm for UML Enterprise Edition;

productVersion = ;

productBuild = ;

d = new Date()getTime();

d /= ;

d *= ;

registerDate = new Date(d);

serialNumber = LongtoString(SystemcurrentTimeMillis());

evaluation = false;

upgradeSN = ;

tagValue = ;

type = ;

}

public final String getVerifyKeyResult(){

String ret;

StringBuffer ** = new StringBuffer();

**append(getSerialNumber());

**append(getExpiredDate()getTime());

**append(getEmail());

**append(getMachinelInfo());

**append(getUserName());

**append(getProductName());

**append(getProductVersion());

**append();

**append(getRegisterDate()getTime());

**append(getType());

String s;

s = isEvaluation() ? true : false;

**append(s);

**append(tagValue);

ret = **toString();

** = null;

ret = eyji(ret);

return ret;

}

               

上一篇:防止JAVA代码被反编译的方法

下一篇:Java程序实现压缩某目录