Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 488
Christian Berg Avatar asked Feb 09 '09 10:02

Christian Berg


People also ask

Is PFX a keystore file?

PFX is a keystore format used by some applications. A PFX keystore can contain private keys or public keys. The information that follows explains how to transform your PFX or PEM keystore into a PKCS12 keystore. PEM and PFX files usually carry the private and public key of a certificate.

How do I save a file as PFX?

pfx file. In the File name box, click … to browse for and select the location and file name where you want to save the . pfx file, provide a file name (i.e. mySSLCertificate), click Save, and then, click Finish. After you receive the "Your certificate and key have been successfully exported" message, click OK.

How do I get my PFX JKS?

To convert your certificates to a format that is usable by a Java-based server, you need to extract the certificates and keys from the . pfx file using OpenSSL, and then import the certificates to keystore using keytool. The following steps require keytool, OpenSSL, and a Weblogic-specific utility.


2 Answers

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

like image 181
Bruno Avatar answered Sep 20 '22 18:09

Bruno


Check guideline at http://teddyhai.blogspot.com/2009/06/how-to-convert-java-jks-keystore-to.html

like image 26
happy.cze Avatar answered Sep 17 '22 18:09

happy.cze