MCPcopy Create free account
hub / github.com/apache/httpd / __init__

Method __init__

test/modules/md/md_cert_util.py:74–92  ·  view source on GitHub ↗
(self, cert_path, cert=None)

Source from the content-addressed store, hash-verified

72 return None
73
74 def __init__(self, cert_path, cert=None):
75 if cert_path is not None:
76 self.cert_path = cert_path
77 # load certificate and private key
78 if cert_path.startswith("http"):
79 cert_data = self.get_plain(cert_path, 1)
80 else:
81 cert_data = MDCertUtil._load_binary_file(cert_path)
82
83 for file_type in (OpenSSL.crypto.FILETYPE_PEM, OpenSSL.crypto.FILETYPE_ASN1):
84 try:
85 self.cert = OpenSSL.crypto.load_certificate(file_type, cert_data)
86 except Exception as error:
87 self.error = error
88 if cert is not None:
89 self.cert = cert
90
91 if self.cert is None:
92 raise self.error
93
94 def get_issuer(self):
95 return self.cert.get_issuer()

Callers

nothing calls this directly

Calls 2

get_plainMethod · 0.95
_load_binary_fileMethod · 0.80

Tested by

no test coverage detected