PFX to JKS keytool conversion: Alias <*> does not exist

懵懂的女人 提交于 2019-11-30 19:16:21

I had the exact same problem. I've solved using '1' instead of 2. Don't know why but it worked.

if set alias in pkcs12:

openssl pkcs12 -export -in certificate.pem -inkey private_key.pem -out keystore.p12 -name "myalias"

aftet alias setted successfully:

keytool -importkeystore -srckeystore keystore.p12 -srcstoretype pkcs12 -destkeystore keystore.jks -deststoretype JKS -alias myalias
daniel

your command should looks a bit more like this

keytool -importkeystore -srckeystore x.pfx -srcstoretype pkcs12 -***alias*** 2 -destkeystore x.jks -deststoretype jks -destalias xyz

Maybe "2" can't be found, because there are whitespaces included (e.g. "2 ")

If you don't wanna change the alias just remove the options -srcalias and -destalias and it will be imported with the original alias.

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