Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract certificate from .p12 (PFX) file using KEYTOOL commands

I want to extract certificate from a .p12 file. I can't use openssl as it is not allowed in my organization.

Is keytool able to extract the certificate, or is there any other way by which I can get this certificate extracted?

Do I require the password for the private key for this?

like image 737
Vaibhav Dwivedi Avatar asked Mar 21 '16 14:03

Vaibhav Dwivedi


1 Answers

You can use this Keytool command to export certificate from a KeyStore.

keytool -exportcert -keystore KEYSTORE_ABSOLUTE_PATH.p12 -storetype PKCS12 -storepass KEYSTORE_PASSWORD -alias ALIAS -file EXPORTED_CERT_NAME.crt

like image 148
always_a_rookie Avatar answered Oct 24 '22 10:10

always_a_rookie