1
0

simplify x509 constructor

This commit is contained in:
ThomasV
2015-08-07 11:39:30 +02:00
parent 713fa00d86
commit ca3c320ef4
3 changed files with 5 additions and 9 deletions

View File

@@ -49,7 +49,7 @@ class CertificateError(Exception):
class X509(object):
def parseBinary(self, b):
def __init__(self, b):
self.bytes = bytearray(b)
@@ -178,9 +178,8 @@ def load_certificates(ca_path):
s = f.read()
bList = pem.dePemList(s, "CERTIFICATE")
for b in bList:
x = X509()
try:
x.parseBinary(b)
x = X509(b)
x.check_date()
except BaseException as e:
util.print_error("cert error:", e)