How can I create a PFX file from a Java Keystore?

Christian Berg picture Christian Berg · Feb 9, 2009 · Viewed 44.4k times · Source

I have a Java keystore (.jks file) holding a single certificate. How can I create a .pfx file from this keystore?

Answer

Bruno picture Bruno · Jan 12, 2012

From Java 6 onwards, keytool has an -importkeystore option, which should be able to convert a JKS store into a PKCS#12 store (.p12/.pfx):

keytool -importkeystore -srckeystore thekeystore.jks \
            -srcstoretype JKS \
            -destkeystore thekeystore.pfx \
            -deststoretype PKCS12

It will ask you to enter a password for source and destination (jks, pfx) files