how to convert an openssl pem cert to pkcs12

combine key and cert, and convert to pkcs12:

cat example.com.key example.com.cert |
  openssl pkcs12 -export -out example.com.pkcs12 -name example.com

enter the password for the key when prompted. note that the password cannot be empty.

test with java’s keytool:

keytool -v -list -storetype pkcs12 -keystore example.com.pkcs12

enter password when prompted.