How to Convert a .pfx/.p12 File to a Java Keystore (.jks) with the Java keytool

Java keytool alone is capable of converting .pfx file into .jks file. Please make sure that java is configured in your system.We need java version JDK 1.6 or later.
First step in this process we need to extract the alias name stored in the .pfx file.Run the below command in the command prompt to generate the aliasfile. This generated file contains the alias name.
keytool -v -list -storetype pkcs12 -keystore fileName.pfx > aliasfile.txt
Open the alias file and search the Alias name,So now we know the source alias name and destination alias name we can give anything.Generally we will give the company name
keytool -importkeystore -srckeystore fileName.pfx -srcstoretype pkcs12 -srcalias “[SOURCE ALIAS NAME]”
-destkeystore resultFile.jks -deststoretype jks -destalias “[DESTINATION ALIAS NAME]“


Post a Comment

Powered by Blogger.