Created
November 13, 2015 03:40
-
-
Save alastairmccormack/e7b0bc65927b7987b7d4 to your computer and use it in GitHub Desktop.
Gets a SHA1 fingerprint from an x509 certificate using Python and OpenSSL crypto module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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