Convert a pfx certificate to crt and key files

Extract the key and decrypt it:

openssl pkcs12 -in cert.pfx -nocerts -out cert-encrypted.key
openssl rsa -in cert-encrypted.key -out cert.key

extract the certificate:

openssl pkcs12 -in cert.pfx -clcerts -nokeys -out cert.crt

extract the bundle:

openssl pkcs12 -in cert.pfx -nokeys -nodes -cacerts -out ca-bundle.crt