# true-license-spring-boot-starter **Repository Path**: LevelCoder/true-license-spring-boot-starter ## Basic Information - **Project Name**: true-license-spring-boot-starter - **Description**: true-license自定义starter - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-09-29 - **Last Updated**: 2024-09-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 工程简介 true-license starter jdk1.8 ## 1.使用keytool生产密钥对 ```shell ## 1. 生成私匙库 # validity:私钥的有效期多少天 # alias:私钥别称 # keystore: 指定私钥库文件的名称(生成在当前目录) # storepass:指定私钥库的密码(获取keystore信息所需的密码) # keypass:指定别名条目的密码(私钥的密码) keytool -genkeypair -keysize 1024 -validity 1 -alias "privateKey" -keystore "privateKeys.keystore" -storepass "a123456" -keypass "private_a123456" -dname "CN=localhost, OU=localhost, O=localhost, L=SH, ST=SH, C=CN" ## 2. 把私匙库内的公匙导出到一个文件当中 # alias:私钥别称 # keystore:指定私钥库的名称(在当前目录查找) # storepass: 指定私钥库的密码 # file:证书名称 keytool -exportcert -alias "privateKey" -keystore "privateKeys.keystore" -storepass "a123456" -file "certfile.cer" ## 3. 再把这个证书文件导入到公匙库 # alias:公钥别称 # file:证书名称 # keystore:公钥文件名称 # storepass:指定私钥库的密码 keytool -import -alias "publicCert" -file "certfile.cer" -keystore "publicCerts.keystore" -storepass "a123456" ``` ## 2.true-license starter 的使用 ### 2.1生成 .lic文件 参考com.cloudwise.truelicensespringbootstarter.TrueLicenseSpringBootStarterApplicationTests#licenseCreate ### 2.2 配置license的相关参数 ```yaml #License相关配置 license: subject: ioserver #主题 publicAlias: publicCert #公钥别称 storePass: a123456 #访问公钥的密码 licensePath: /Users/jeffery/Documents/temp/123/license.lic #license位置 publicKeysStorePath: /Users/jeffery/Documents/temp/123/publicCerts.keystore #公钥位置 ``` # 延伸阅读 https://www.yuque.com/qingfengaibiancheng/pe48ml/pql29f https://tuacy.blog.csdn.net/article/details/99692762