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 PEM, DER, PKCS#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
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
Format | File Extension | Description |
---|---|---|
PEM | .pem , .crt , .cer | Base64-encoded text file |
DER | .der , .cer | Binary format |
PKCS#12 | .p12 , .pfx | Binary with cert + private key |
JKS | .jks | Java KeyStore (Java-specific) |
Comments
Post a Comment