Ensure openssl is installed on the system, I used Ubuntu Server and run the following command to extract the private key:
openssl pkcs12 -in yourpfxfile.pfx -nocerts -out privatekey.pem -nodes
Now run the following command to extract the public cert:
openssl pkcs12 -in yourpfxfile.pfx -nokeys -out publiccert.pem -nodes