How to Convert .pfx File to .jks File? Print

  • 0

This article will guide you in changing the .pfx to a .jks file in a few simple steps. But first, you need a Windows environment and a JDK setup to execute the steps.

1. Export the certificate from the server to your Windows system. 

2. Open the command prompt, and navigate to the path where you have stored the .pfx file

3. Run the command below in the command prompt to extract the certificate and keys from the .pfx file – 

Command: openssl pkcs12 -in Yourfilename.pfx -out Yourcertfile.crt -nodes

Do not forget to replace the name of your file (yourfilename.pfx) from the above command. 

Now, Yourcertfile.crt file has been created.

4. Copy and paste the .crt file to the path given below – 

Path: C:\Program Files\Java\jdk-17.0.1\bin 

5. Navigate to the C:\Program Files\Java\jdk-17.0.1\bin path and run the following command – 

Command: keytool -import -file Yourcertfile.crt -keystore certfile.jks 

Once you execute the command mentioned above in the command prompt, it will ask for the password to create the .jks file. 

When you enter the password, your .jks file will be ready.


Was this answer helpful?

« Back