Search This Blog

2020-10-16

Viewing SSL Certificate with OpenSSL Utility

Product: OpenSSL

Version: Any

OS: Windows, Linux, HP-UX, AIX, Solaris

Command: openssl

This is a small post sharing OpenSSL utility's usage to display SSL certificate.

Following are 4 openssl syntax to view 4 different SSL certificate file types:

FormatCommandUsage
DER X.509openssl x509 -noout -text -in [ssl_cert].crt -inform DERWindows default
DER PKCS#7openssl pkcs7 -print_certs -in [ssl_cert].p7b -inform DERWindows default
PEM Base-64 X.509openssl x509 -noout -text -in [ssl_cert].crtNot Windows default
PEM PKCS#7openssl pkcs7 -print_certs -in [ssl_cert].p7bNot available in Windows

Following is the trick to determine whether the file is DER or PEM encoded by opening using text editor:

  • DER - file content is binary format that is not human readable
  • PEM - file content is human readable text format, which is Base-64 encoded
For clarification, "PEM X.509" SSL file format is called as "Base-64 X.509" format in Windows OS

No comments: