Posted on Leave a comment

how to check fingerprint of a certificate

how to check fingerprint of a certificate?

Needed tools:

Access to a server, desktop, or a docker container via SSH.

Create a file named fingerprint.sh in Linux and add the following lines to the file.

#!/bin/bash
file="ssl.cert" || $1; 
echo "sha256"; 
openssl x509 -noout -fingerprint -sha256 -inform pem -in $file; 
echo "sha1"; 
openssl x509 -noout -fingerprint -sha1 -inform pem -in $file;
echo "md5"; 
openssl x509 -noout -fingerprint -md5 -inform pem -in $file;

Make the file executable

chmod +x fingerprint.sh

Run the program/script:

./fingerprint.sh

You will see a result similar to the following.

-sh-4.2$ ./ssl/fingerprint.sh path/to/certificate.crt

sha256

SHA256 Fingerprint=FB:3F:9D:7B:EA:56:84:BE:3D:AB:94:09:BA:85:4C:8A:BA:3A:84:10:A3:50:A2:CF:A7:B5:2F:C2:D4:56:3D:10

sha1

SHA1 Fingerprint=23:3B:66:BA:E0:00:7C:2C:91:84:87:37:FB:E6:A3:64:DC:84:81:66

md5

MD5 Fingerprint=A8:17:88:63:39:D0:40:7A:44:B4:87:EA:E8:86:1A:04

That’s it.