Convert a Java Keystore into a PFX or P12
This article explains the process of converting a Java Keystore file, into a PKCS12 file which is a .pfx or .p12 .
Requirements - A Java Keystore containing the root, intermediate, and your domain/end entity certificate which was imported by following these instructions.
In order to convert the Java Keystore file into a .pfx or .p12 file, you will need to run the following Java Keytool command:
keytool -v -importkeystore -srckeystore yourkeystore.keystore -srcalias mykey -destkeystore myp12file.p12 -deststoretype PKCS12
Replace yourkeystore.keystore with the name of your actual java keystore file, and myp12file.p12 file with the name of the .p12 or .pfx file which you would like the command to generate.
Enter destination keystore password: (enter in a password for the new .pfx/.p12 file)
This command will generate your PFX/P12 file (Combination of certificate, private key and certificate chain), which can be used to import the certificate into another server or appliance which accepts PKCS12 files.