How to export an EC private key from p12

I have a p12 store. I have read about export like this openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes but it doesn't export in EC format.

How do I do I use openssl to export the private key in EC format?

I read that the exported key should begin with -----BEGIN EC PRIVATE KEY-----

5

1 Answer

If you are certain that your key is in fact an EC key, you are halfway there.
Once exported the key with

 openssl pkcs12 -in path.p12 -nodes -nocerts -out newfile.key.pem

then convert it to EC PRIVATE KEY using below command

openssl ec -in newfile.key.pem -out ec.key.pem

More info here

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like