Created
July 20, 2012 19:03
-
-
Save jbowes/3152602 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python | |
import sys | |
from rhsm import _certificate | |
import zlib | |
fp = open(sys.argv[1], "r") | |
x509 = _certificate.load(pem=fp.read()) | |
#x509 = _certificate.load(sys.argv[1]) | |
print _certificate.get_all_extensions(x509) | |
print _certificate.get_serial_number(x509) | |
print _certificate.get_subject(x509) | |
print _certificate.get_not_before(x509) | |
print _certificate.get_not_after(x509) | |
print _certificate.get_extension(x509, "1.3.6.1.4.1.2312.9.6") | |
print zlib.decompress(_certificate.get_extension(x509, "1.3.6.1.4.1.2312.9.7")) | |
print _certificate.get_extension(x509, name="subjectAltName") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment