环境
- MacOS 10.14.6
- JDK1.8
生成私钥公钥
-
应用 JDK 自带的
keytool
工具生成签名keytool -genkeypair -keysize 1024 -validity 3650 -alias "zuiyuPrivateKey" -keypass "zuiyu_private_password_1234" -keystore "zuiyuPrivateKeys.keystore" -storepass "zuiyu_public_password_1234" -dname "CN=zuiyu,OU=zuiyu,O=zuiyu,L=BJ,ST=BJ,C=CN"
-
导出签名文件 zuiyuCertfile.cer
keytool -exportcert -alias "zuiyuPrivateKey" -keystore "zuiyuPrivateKeys.keystore" -storepass "zuiyu_public_password_1234" -file "zuiyuCertfile.cer"
-
导入签名文件
keytool -import -alias "zuiyuPublicCert" -file "zuiyuCertfile.cer" -keystore "zuiyuPublicCerts.keystore" -storepass "zuiyu_public_password_1234"
-
帮忙命令(依据须要食用)
# 删除 keytool -delete -alias zuiyuPrivateKey -keystore "zuiyuPrivateKeys.keystore" -storepass "zuiyu_public_password_1234" # 查看 keytool -list -v -keystore zuiyuPrivateKeys.keystore -storepass "zuiyu_public_password_1234"
-
最初
上述命令执行实现之后,会在以后门路下生成三个文件,别离是:
zuiyuPrivateKeys.keystore
、zuiyuPublicCerts.keystore
、zuiyuCertfile.cer
。其中文件zuiyuCertfile.cer
不再须要能够删除,文件zuiyuPrivateKeys.keystore
用于以后的license-server
我的项目给客户生成license
文件,而文件zuiyuPublicCerts.keystore
则随利用代码部署到客户服务器,用户解密 license 文件并校验其许可信息。
license-server 我的项目参考
https://github.com/zuiyu-main…
本文由 mdnice 多平台公布