23

Given a P12 certificate file on Windows, what's the quickest way to see the details such as common name?

Say i have a file mycertificate.p12, ideally I'm looking for a command line tool that I can run against the file to show me the details and doesn't require anything extra to be installed.

It looks like openssl has something similar:

openssl pkcs12 -in file.p12 -info -noout
Iain
  • 688
  • 3
  • 8
  • 16
  • Are you talking about an installed certificate, or a certificate file you have yet to install? – James P May 21 '14 at 15:23
  • A file. I've clarified the question. – Iain May 21 '14 at 15:41
  • 1
    Try opening a new command window and entering **certutil -dump ** – James P May 21 '14 at 15:42
  • I would use OpenSSL – Ramhound May 21 '14 at 15:44
  • 3
    There is a question here which seems to be the same as I think the process is the same as for a PFX file: http://superuser.com/questions/580697/how-do-i-view-the-contents-of-a-pfx-file-on-windows – James P May 21 '14 at 15:45
  • Portecle is also very useful for that: http://portecle.sourceforge.net/ (requires Java installed on your PC) – endo64 Dec 28 '18 at 07:31
  • Does this answer your question? [How do I view the contents of a PFX file on Windows?](https://superuser.com/questions/580697/how-do-i-view-the-contents-of-a-pfx-file-on-windows) – miken32 Aug 30 '22 at 20:11

1 Answers1

53

I think the simplest way is probably this:

  • Open a new command window
  • Type certutil -dump <certificate full path>

The certutil tool is built in to Windows so you don't need anything to be installed.

Edit:

As Iain mentioned, since the file can contain a private key you may be prompted for a password. It's possible to specify the password when you run the command, which would have the advantage of allowing you to use command redirection to send the output directly to a text file:

e.g.

certutil -p MyPassword -dump D:\MyCertificate.p12 > D:\CertDetails.txt

James P
  • 11,206
  • 5
  • 43
  • 50