Skip to content

Instantly share code, notes, and snippets.

View aravindaran's full-sized avatar
🏠
Working from home

Aravind aravindaran

🏠
Working from home
View GitHub Profile
@alastairmccormack
alastairmccormack / x509_sha1_fingerprint.py
Created November 13, 2015 03:40
Gets a SHA1 fingerprint from an x509 certificate using Python and OpenSSL crypto module
from OpenSSL.crypto import load_certificate, FILETYPE_PEM
cert_file_string = open("esx.crt", "rb").read()
cert = load_certificate(FILETYPE_PEM, cert_file_string)
sha1_fingerprint = cert.digest("sha1")
print sha1_fingerprint