PKCS12 to JKS conversion failure

烂漫一生 提交于 2019-12-07 19:41:30

问题


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

This returns the following message:

0 entries successfully imported, 0 entries failed or cancelled

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?


回答1:


I have imported some PKCS12 certificates recently using this command line:

keytool -importkeystore -srckeystore cert.p12 -srcstoretype PKCS12 -srcstorepass certificatePassword -keystore keystore_file_name.jks -storepass keystore_password



回答2:


Tims, I bet you you set an empty passphrase to encrypt your p12 key store.

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.



来源:https://stackoverflow.com/questions/10836126/pkcs12-to-jks-conversion-failure

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!