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

Method issue_cert

test/pyhttpd/certs.py:161–182  ·  view source on GitHub ↗
(self, spec: CertificateSpec, chain: List['Credentials'] = None)

Source from the content-addressed store, hash-verified

159 return [self.issue_cert(spec=spec, chain=chain) for spec in specs]
160
161 def issue_cert(self, spec: CertificateSpec, chain: List['Credentials'] = None) -> 'Credentials':
162 key_type = spec.key_type if spec.key_type else self.key_type
163 creds = None
164 if self._store:
165 creds = self._store.load_credentials(
166 name=spec.name, key_type=key_type, single_file=spec.single_file, issuer=self)
167 if creds is None:
168 creds = HttpdTestCA.create_credentials(spec=spec, issuer=self, key_type=key_type,
169 valid_from=spec.valid_from, valid_to=spec.valid_to)
170 if self._store:
171 self._store.save(creds, single_file=spec.single_file)
172 if spec.type == "ca":
173 self._store.save_chain(creds, "ca", with_root=True)
174
175 if spec.sub_specs:
176 if self._store:
177 sub_store = CertStore(fpath=os.path.join(self._store.path, creds.name))
178 creds.set_store(sub_store)
179 subchain = chain.copy() if chain else []
180 subchain.append(self)
181 creds.issue_certs(spec.sub_specs, chain=subchain)
182 return creds
183
184 def save_cert_pem(self, fpath):
185 with open(fpath, "wb") as fd:

Callers 1

issue_certsMethod · 0.95

Calls 8

save_chainMethod · 0.80
joinMethod · 0.80
CertStoreClass · 0.70
load_credentialsMethod · 0.45
create_credentialsMethod · 0.45
saveMethod · 0.45
set_storeMethod · 0.45
issue_certsMethod · 0.45

Tested by

no test coverage detected