PKCS12到JKS转换失败 [英] PKCS12 to JKS conversion failure
问题描述
我正在尝试使用以下命令将PKCS12格式文件转换为JKS密钥库:
I'm trying to convert a PKCS12 format file to a JKS keystore using the command:
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文件,看起来很好 - 它包含完整的证书链和私钥。也没有返回堆栈跟踪,并且生成的密钥库文件也是空的。
I've taken a look at the cert.p12 file using openSSL and it appears to be fine - it contains the full certificate chain and the private key. There is no stacktrace being returned either and the resulting keystore file is also empty.
任何人都知道为什么密钥库无法导入看似有效的证书,但却没有生成任何堆栈跟踪等?
Anyone have any ideas why keystore would fail to import a seemingly valid certificate, and yet not produce any stacktraces etc?
推荐答案
Tims,我打赌你设置了一个空密码加密你的p12密钥库。
Tims, I bet you you set an empty passphrase to encrypt your p12 key store.
尝试使用非空值再次创建p12。我有同样的问题,这解决了我。我还没弄明白如何让keytool接受带有空密码的p12文件。
Try to create the p12 again with a non empty value. I had the same problem and this solved for me. I have not figured out how to make keytool to accept p12 files with an empty passphrese though.
这篇关于PKCS12到JKS转换失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!