Languages
[Edit]
EN

Bash - display fingerprint / thumbprint for certificate (DER format)

8 points
Created by:
Wade
352

In this short article, we would like to show how to get a SHA-1 fingerprint from a certificate saved as *.der using openssl under Bash.

Quick solution (SHA-1 fingerprint):

cat /path/to/my_certificate.der | openssl sha1 -c

Example output:

(stdin)= 21:49:3c:2d:01:40:14:42:da:70:ef:35:9c:e2:dc:ce:24:3d:0e:e4

Where:

  • -c adds : separator to fingerprint.
    Without -c parameter openssl returns:
    (stdin)= 21493c2d01401442da70ef359ce2dcce243d0ee4

 

Hint: depending on the used program fingerprint is called thumbprint too.

 

Different algorithms

Fingerprint can be calculated with different algorithms: MD5, SHA-1, SHA-256, etc.

Example:

cat /path/to/my_certificate.der | openssl md5 -c
cat /path/to/my_certificate.der | openssl sha1 -c
cat /path/to/my_certificate.der | openssl sha256 -c

 

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join