Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting .jks to p12

Tags:

jks

pkcs#12

How can I convert a .jks file to p12. jks is a java key store file so how can I convert it to the p12 format?

like image 827
Matrix Avatar asked May 17 '10 05:05

Matrix


2 Answers

Convert a JKS file to PKCS12 format (Java 1.6.x and above)

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 

from A few frequently used SSL commands

like image 131
Daniel Silveira Avatar answered Nov 07 '22 08:11

Daniel Silveira


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 
like image 24
bob Avatar answered Nov 07 '22 09:11

bob