Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.