将.jks转换为p12

如何将.jks文件转换为p12jks是一个Java密钥存储文件,所以我怎样才能将其转换为p12格式?

将JKS文件转换为PKCS12格式(Java 1.6.x及更高版本)

 keytool -importkeystore -srckeystore KEYSTORE.jks -destkeystore KEYSTORE.p12 -srcstoretype JKS -deststoretype PKCS12 -srcstorepass mysecret -deststorepass mysecret -srcalias myalias -destalias myalias -srckeypass mykeypass -destkeypass mykeypass -noprompt 

来自几个常用的SSL命令

JKS→P12:

keytool -importkeystore -srckeystore keystore.jks -srcstoretype JKS -deststoretype PKCS12 -destkeystore keystore.p12

P12→JKS:

keytool -importkeystore -srckeystore keystore.p12 -srcstoretype PKCS12 -deststoretype JKS -destkeystore keystore.jks

以下页面为您提供了一组有用的SSL命令,您将find答案。

这是一个一行命令相同。

keytool -importkeystore -srckeystore <MY_KEYSTORE.jks> -destkeystore <MY_FILE.p12> -srcstoretype JKS -deststoretype PKCS12 -deststorepass <PASSWORD_PKCS12> -srcalias <ALIAS_SRC> -destalias <ALIAS_DEST>

解释参数:

 MY_FILE.p12: path to the PKCS#12 file (.p12 or .pfx extension) that is going to be created. MY_KEYSTORE.jks: path to the keystore that you want to convert. PASSWORD_PKCS12: password that will be requested at the PKCS#12 file opening. ALIAS_SRC: name matching your certificate entry in the JKS keystore, "tomcat" for example. ALIAS_DEST: name that will match your certificate entry in the PKCS#12 file, "tomcat" for example.