Converting certificate formats PEM, DER, PKCS#12 (.pfx/.p12), and JKS

Converting certificate formats is a common task when working with SSL/TLS, web servers, keystores, and certificate authorities. Here’s a guide to help you convert between formats like PEMDERPKCS#12 (.pfx/.p12), and JKS.
Converting Certificate from JKS to P12 Format
keytool -importkeystore -srckeystore Fabrizio.jks -destkeystore Fabrizio.p12 -srcstoretype JKS -deststoretype PKCS12 -srcstorepass weblogic1 -deststorepass weblogic1 -srcalias {4d390f81-7f7a-4a0a-ae76-9a5ea5ba567f} -destalias {4d390f81-7f7a-4a0a-ae76-9a5ea5ba567f} -srckeypass weblogic1 -destkeypass weblogic1
Converting certificate from PFX to JKS Format
java -classpath ./jetty-6.1.1.jar org.mortbay.jetty.security.PKCS12Import Fabrizio.pfx Fabrizio.jks
Converting certificate from P12 to PFX Format
Import the certificate in the browser using certificate import wiward by double clicking on the p12 certificate.
Go to Internet Options > Content > Certificates > Personal
Choose your certificate and click export.
Select Yes Export the Private Key
Select Personal Information Exchange Format and provide the password.
Store the file as .pfx
Common Extensions Summary
FormatFile ExtensionDescription
PEM.pem.crt.cerBase64-encoded text file
DER.der.cerBinary format
PKCS#12.p12.pfxBinary with cert + private key
JKS.jksJava KeyStore (Java-specific)

Comments

Popular posts from this blog

Interview question for File and FTP Adapter

What is boot.properties file and how to create

SSL Exceptions in Admin Server and Node Manager.