How to convert certificate from PEM to JKS?

You aren’t clear which files you combined, but it should work to use openssl to combine the cert and private key to a PKCS#12: cat cert_public_key.pem cert_private_key.pem >combined.pem openssl pkcs12 -export -in combined.pem -out cert.p12 or on the fly but (update:) the privatekey must be first: cat cert_private_key.pem cert_public_key.pem | openssl pkcs12 -export -out cert.p12 … Read more

Converting pfx to pem using openssl

Another perspective for doing it on Linux… here is how to do it so that the resulting single file contains the decrypted private key so that something like HAProxy can use it without prompting you for passphrase. openssl pkcs12 -in file.pfx -out file.pem -nodes Then you can configure HAProxy to use the file.pem file. This … Read more

Differences between “BEGIN RSA PRIVATE KEY” and “BEGIN PRIVATE KEY”

See https://polarssl.org/kb/cryptography/asn1-key-structures-in-der-and-pem (search the page for “BEGIN RSA PRIVATE KEY”) (archive link for posterity, just in case). BEGIN RSA PRIVATE KEY is PKCS#1 and is just an RSA key. It is essentially just the key object from PKCS#8, but without the version or algorithm identifier in front. BEGIN PRIVATE KEY is PKCS#8 and indicates that … Read more