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

Method load_credentials

test/modules/md/md_certs.py:223–234  ·  view source on GitHub ↗
(self, name: str, key_type=None, single_file: bool = False)

Source from the content-addressed store, hash-verified

221 return load_pem_private_key("".join(fd.readlines()).encode(), password=None)
222
223 def load_credentials(self, name: str, key_type=None, single_file: bool = False):
224 cert_file = self.get_cert_file(name=name, key_type=key_type)
225 pkey_file = cert_file if single_file else self.get_pkey_file(name=name, key_type=key_type)
226 if os.path.isfile(cert_file) and os.path.isfile(pkey_file):
227 cert = self.load_pem_cert(cert_file)
228 pkey = self.load_pem_pkey(pkey_file)
229 creds = Credentials(name=name, cert=cert, pkey=pkey)
230 creds.set_store(self)
231 creds.set_files(cert_file, pkey_file)
232 self._add_credentials(name, creds)
233 return creds
234 return None
235
236
237class MDTestCA:

Callers 2

create_rootMethod · 0.95
issue_certMethod · 0.45

Calls 8

get_cert_fileMethod · 0.95
get_pkey_fileMethod · 0.95
load_pem_certMethod · 0.95
load_pem_pkeyMethod · 0.95
set_storeMethod · 0.95
set_filesMethod · 0.95
_add_credentialsMethod · 0.95
CredentialsClass · 0.70

Tested by

no test coverage detected