License 校验

1:了解keytool 的一些命令  http://www.micmiu.com/lang/java/keytool-start-guide/

本人在github找的一个demo:https://github.com/jingshauizh/JavaSpringSurmmary/tree/master/java-license-jar

2:生成备用的 privateKeys.store(认证端) 和 publicCerts.store(使用端)

 生成privateKeys.store,执行如下命令

keytool -genkey -alias privatekey -keystore privateKeys.store -storepass bug55555 -keypass aa123456 -validity 365

生成certfile.cer

keytool -export -alias privatekey -file certfile.cer -keystore privateKeys.store

生成publicCerts.store

keytool -import -alias publiccert -file certfile.cer -keystore publicCerts.store -storepass bug55555

注意: 创建的license.lic文件 和 验证的文件必须在同一个包位置

原文地址:https://www.cnblogs.com/eason-d/p/7724371.html