Thursday, December 15, 2016

Conversion to Microsoft Compatible .p12 from a PEM certificate and key

The openssl shell commands work great on PEM certificates, but both Java (via keytool) and Windows (via certmgr.msc) work better with PKCS#12 certificates. This is the command you have to construct to join the entire keypair, which isn't obvious in the EXAMPLES section in openssl's man pkcs12:

openssl pkcs12 -export -out user.p12 -in user.crt -inkey user.key