Do you of some reason need to convert a P12 certificate to a P8 certificate?
This is how you can do that.
Step 1.
openssl pkcs12 -in certificate.p12 -out certificate.pem -clcerts -nokeys
Step 2
openssl pkcs12 -in certificate.p12 -out key.pem -nocerts -nodes
Step 3
openssl pkcs8 -topk8 -inform PEM -outform PEM -in in.key -out out.pkcs8 -v1 PBE-MD5-DES