"keytool -printcert" Command Examples - Print Certificate Info

Q

How to use the "keytool -printcert" command? I want to see what to see more information about a certificate.

✍: FYIcenter.com

A

Here is an example of using "keytool -printcert" command to extract owner, issuer, serial number, expiration date and other information from a certificate:

C:\Users\fyicenter> keytool -printcert -file 2nd_cert.pem

Owner: CN=jar.fyicenter.com
Issuer: CN=jar.fyicenter.com
Serial number: e307f73
Valid from: Wed Jul 4 10:57:50 EDT 2012 until: Tue Oct 2 10:57:50 EDT 2012
Certificate fingerprints:
      MD5:  39:84:77:A9:11:9F:D0:72:A3:10:03:A2:2A:56:1A:57
      SHA1: 8C:35:4B:1A:25:02:74:32:A8:2D:E4:01:E4:F3:93:13:F5:EE:C0:DA
      SHA256: 0E:53:6C:0F:D4:44:59:6B:38:24:C3:E5:D4:BB:F1:89:14:D5:39:
              00:10:E0:C1:09:77:0A:6F:64:27:BE:4F:BE
      Signature algorithm name: SHA1withDSA
      Version: 3

Extensions:

#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 72 5C D2 77 D4 D0 3A B9   33 B0 1B EE F8 2D 84 87  r\.w..:.3....-..
0010: 32 58 2B DB                                        2X+.
]
]

What this command did for you:

  • Read the specified certificate from the specified file: 2nd_cert.pem.
  • Print out owner, issuer, serial number, expiration date and other information from the certificate.

Note that this is a self-signed certificate, because the issuer is the same as the owner: jar.fyicenter.com

 

"keytool -printcert" Command Examples - Download Certificate

Java "keytool -printcert" Command Options

Managing Certificates with Java Keytool

⇑⇑ Java Keytool: Certificate Management Tool

2012-07-20, 19039👍, 0💬