SSL
Extracting private and public keys from a p12 file
Private key:
openssl pkcs12 -in file_name.p12 -nocerts -out private.key
with pass warning !!!
Certificates
openssl pkcs12 -in file_name.p12 -clcerts -nokeys -out public.crt
Ca certificates:
openssl pkcs12 -in file_name.p12 -cacerts -nokeys -out ca.crt
Generate a bundle:
openssl pkcs12 -in file_name.p12 -out cert.pem -nodes
then just use the parts wanted
Generate certificates bundle file
openssl pkcs12 -nokeys -in server-cert-key-bundle.p12 -out server-ca-cert-bundle.pem
Generate server key file
openssl pkcs12 -nocerts -nodes -in server-cert-key-bundle.p12 -out server.key