Here you find some easy OpenSSL oneliners that I’ve used (or still use) in the past. In general not much special but proven it’sa worth time after time.
Exctracting the Private Key out of your PFX file:
openssl pkcs12 -in PFXFile.pfx -nocerts -out keyfile-PFXFile.key
Exctracting the Private Key out of your PFX file:
openssl pkcs12 -in PFXFile.pfx -clcerts -nokeys -out CRTFile.crt
Export your certificate hash for use HTTP Public Key Pinning (HPKP)
openssl x509 -in CRTFile.crt -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64