First of all install update and upgrade your system:
$ sudo apt update
$ sudo apt upgrade
Then, install required libraries:
#!/usr/bin/python | |
# | |
# Derived from: | |
# | |
# MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm | |
# | |
# Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All | |
# rights reserved. | |
# | |
# License to copy and use this software is granted provided that it |
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 |