我有ca.crt、client.crt和client.key文件,有人能解释我如何生成keystore.p12和truststore.p12文件吗?
发布于 2022-01-06 00:58:00
好吧,所以我解决了这个问题。张贴答案以供参考。
步骤1:从ca.crt、client.crt和client.key文件生成client.crt
openssl pkcs12 -export -in client.crt -inkey client.key -certfile ca.crt -out keystore.p12
步骤2:从truststore.JKS文件生成keystore.p12
keytool -importkeystore -srckeystore keystore.p12 -srcstoretype pkcs12 -destkeystore truststore.jks -deststoretype JKS
现在,我们有了信任存储文件,但是,它以JKS格式将其转换为.p12。
keytool -importkeystore -srckeystore truststore.jks -destkeystore truststore.p12 -deststoretype pkcs12就这样,您现在应该有keystore.p12和truststore.p12文件了。当您运行这些命令时,它将要求您输入源代码和目标密码,您可以在这两个命令中输入.same值。
https://stackoverflow.com/questions/70591943
复制相似问题