一、功能流程
- 密钥生成(gpg --full-gen-key)
生成密钥:gpg --full-gen-key
创建时需要留意的地方:RAS加密、userId
导出公钥:gpg --output public-key --export [userId]
导出私钥:gpg --output public-key --export-secret-key [userId]
- 项目中引入License3j
<dependency>
<groupId>com.verhas</groupId>
<artifactId>license3j</artifactId>
<version>2.0.0-JVM8</version>
</dependency>
- 使用密钥对员文件进行加密
OutputStream out;
try {
out = new FileOutputStream(licenseFile);
out.write(new License().setLicense(new File(originFile))
.loadKey(new File(privateKeyFile), userId)
.encodeLicense(privateProtectedPassword).getBytes("utf-8&#