如何替换JKS中已经过期的私钥证书

最近公司项目中有个JKS文件中的priviateEnty 过期了,导致不能和server端通讯,产生异常Issue。
解决思路:

  1. 导出JKS 文件中所有的公钥证书,CA根证书
  2. 合并证书到一个文件中
  3. 生成新的JKS文件,其中里面包含已更新的证书
  4. 在JKS中把步骤2合并的公钥证书重新导入到JKS JKS文件证书替换完毕。
    This isn’t really a programming or development question, even though you use the result on tomcat, and may get closed.

You need to create a file containing the whole chain – end-entity, intermediate and root certs, in that order, in PEM. If you don’t already have the EE cert in PEM you can extract it with keytool -export[cert] -keystore ksfile -alias tomcat -rfc -file eecert. Obviously you have the new intermedate cert that you just got, and if you don’t have the root already (and it didn’t change) export that also. You can combine the files with cat a b c >d on Unix or COPY a+b+c d on Windows, or use any text editor you like. Then import it to the privatekey entry like keytool -import[cert] -keystore ksfile -alias tomcat -file chainfile.

本段摘录自一下博客,感谢博主的分享。
https://blog.csdn.net/jamex/article/details/109226515

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值