Lines Matching refs:creds
193 creds = self._store.get_credentials_for_name(name) if self._store else []
194 return creds[0] if len(creds) else None
206 creds = None
208 creds = self._store.load_credentials(
211 if creds is None:
212 creds = TestCA.create_credentials(spec=spec, issuer=self, key_type=key_type,
215 self._store.save(creds, single_file=spec.single_file)
217 self._store.save_chain(creds, "ca", with_root=True)
221 sub_store = CertStore(fpath=os.path.join(self._store.path, creds.name))
222 creds.set_store(sub_store)
225 creds.issue_certs(spec.sub_specs, chain=subchain)
226 return creds
241 def save(self, creds: Credentials, name: Optional[str] = None,
244 name = name if name is not None else creds.name
245 cert_file = self.get_cert_file(name=name, key_type=creds.key_type)
246 pkey_file = self.get_pkey_file(name=name, key_type=creds.key_type)
247 comb_file = self.get_combined_file(name=name, key_type=creds.key_type)
251 fd.write(creds.cert_pem)
256 fd.write(creds.pkey_pem)
259 fd.write(creds.pkey_pem)
261 fd.write(creds.cert_pem)
265 fd.write(creds.pkey_pem)
266 creds.set_files(cert_file, pkey_file, comb_file)
267 self._add_credentials(name, creds)
269 def save_chain(self, creds: Credentials, infix: str, with_root=False):
270 name = creds.name
271 chain = [creds]
272 while creds.issuer is not None:
273 creds = creds.issuer
274 chain.append(creds)
282 def _add_credentials(self, name: str, creds: Credentials):
285 self._creds_by_name[name].append(creds)
331 creds = Credentials(name=name, cert=cert, pkey=pkey, issuer=issuer)
332 creds.set_store(self)
333 creds.set_files(cert_file, pkey_file, comb_file)
334 self._add_credentials(name, creds)
335 return creds
344 creds = store.load_credentials(name="ca", key_type=key_type, issuer=None)
345 if creds is None:
346 creds = TestCA._make_ca_credentials(name=name, key_type=key_type)
347 store.save(creds, name="ca")
348 creds.set_store(store)
349 return creds
362 creds = TestCA._make_server_credentials(name=spec.name, domains=spec.domains,
366 creds = TestCA._make_client_credentials(name=spec.name, issuer=issuer,
370 creds = TestCA._make_ca_credentials(name=spec.name, issuer=issuer,
375 return creds