Note: First you will need a linux based operating system that supports openssl command to run the following commands.
Extract the key-pair
#openssl pkcs12 -in sample.pfx -nocerts -nodes -out sample.key
Get the Private Key from the key-pair
#openssl rsa -in sample.key -out sample_private.key
Get the Public Key from key pair
#openssl rsa -in sample.key -pubout -out sample_public.key
Need to do some modification to the private key -> to pkcs8 format
#openssl pkcs8 -topk8 -inform PEM -in sample_private.key -outform PEM -nocrypt
Copy the output and save it as sample_private_pkcs8.key
Get those files
public key: sample_public.key
private key: sample_private_pkcs8.key