diff --git a/cert_deets.py b/cert_deets.py index be6fc9a..b597b69 100644 --- a/cert_deets.py +++ b/cert_deets.py @@ -11,6 +11,7 @@ from urllib.parse import urlparse from cryptography import x509 from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import hashes from tabulate import tabulate SAN_GROUPING = 4 @@ -111,6 +112,10 @@ if __name__ == "__main__": ["Valid from", cert.not_valid_before_utc], ["Valid to", cert.not_valid_after_utc], ["Issuer", cert.issuer.rfc4514_string()], + [ + "SHA1 fingerprint", + ":".join([format(i, "02x") for i in cert.fingerprint(hashes.SHA1())]), + ], ] print(tabulate(table, tablefmt="plain"))