我正在尝试使用以下命令将 PKCS12 格式文件转换为 JKS keystore :
keytool -v -importkeystore -trustcacerts -srckeystore cert.p12 -srcstoretype PKCS12 -destkeystore md_keystore.jks -deststoretype JKS
这将返回以下消息:
0 entries successfully imported, 0 entries failed or cancelled
我使用 openSSL 查看了 cert.p12 文件,它似乎没问题 - 它包含完整的证书链和私钥。也没有返回堆栈跟踪,并且生成的 keystore 文件也是空的。
有人知道为什么 keystore 无法导入看似有效的证书,但不产生任何堆栈跟踪等吗?
最佳答案
我最近使用此命令行导入了一些 PKCS12 证书:
keytool -importkeystore -srckeystore cert.p12 -srcstoretype PKCS12 -srcstorepass certificatePassword -keystore keystore_file_name.jks -storepass keystore_password
关于java - PKCS12 到 JKS 转换失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10836126/