This script will extract the certificate & private key from a .p12 file. The .p12 file must not have a password (lulz).
I made it for supporting Apple push notifications on Twilio originally, but you could use for anything that needs this.
Will not work with files containing spaces. Lame, i know.
I've only tested on MacOS with a .p12 export from the Keychain Access app.
MIT