EN
Bash - display fingerprint / thumbprint for certificate (DER format)
8 points
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):
xxxxxxxxxx
1
cat /path/to/my_certificate.der | openssl sha1 -c
Example output:
xxxxxxxxxx
1
(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
parameteropenssl
returns:xxxxxxxxxx
1(stdin)= 21493c2d01401442da70ef359ce2dcce243d0ee4
Hint: depending on the used program fingerprint is called thumbprint too.
Fingerprint can be calculated with different algorithms: MD5, SHA-1, SHA-256, etc.
Example:
xxxxxxxxxx
1
cat /path/to/my_certificate.der | openssl md5 -c
2
cat /path/to/my_certificate.der | openssl sha1 -c
3
cat /path/to/my_certificate.der | openssl sha256 -c