Lines Matching refs:name
44 EC_SUPPORTED.update([(curve.name.upper(), curve) for curve in [
75 def __init__(self, name: Optional[str] = None,
85 self._name = name
97 def name(self) -> Optional[str]: member in CertificateSpec
110 elif self.name:
118 name: str,
122 self._name = name
132 def name(self) -> str: member in Credentials
192 def get_first(self, name) -> Optional['Credentials']: argument
193 creds = self._store.get_credentials_for_name(name) if self._store else []
196 def get_credentials_for_name(self, name) -> List['Credentials']: argument
197 return self._store.get_credentials_for_name(name) if self._store else []
209 name=spec.name, key_type=key_type, single_file=spec.single_file,
221 sub_store = CertStore(fpath=os.path.join(self._store.path, creds.name))
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)
267 self._add_credentials(name, creds)
270 name = creds.name
282 def _add_credentials(self, name: str, creds: Credentials):
283 if name not in self._creds_by_name:
284 self._creds_by_name[name] = []
285 self._creds_by_name[name].append(creds)
287 def get_credentials_for_name(self, name) -> List[Credentials]: argument
288 return self._creds_by_name[name] if name in self._creds_by_name else []
290 def get_cert_file(self, name: str, key_type=None) -> str:
294 def get_pkey_file(self, name: str, key_type=None) -> str:
298 def get_combined_file(self, name: str, key_type=None) -> str:
309 def load_credentials(self, name: str, key_type=None,
313 cert_file = self.get_cert_file(name=name, key_type=key_type)
314 pkey_file = cert_file if single_file else self.get_pkey_file(name=name, key_type=key_type)
315 comb_file = self.get_combined_file(name=name, key_type=key_type)
331 creds = Credentials(name=name, cert=cert, pkey=pkey, issuer=issuer)
334 self._add_credentials(name, creds)
342 def create_root(cls, name: str, store_dir: str, key_type: str = "rsa2048") -> Credentials:
344 creds = store.load_credentials(name="ca", key_type=key_type, issuer=None)
346 creds = TestCA._make_ca_credentials(name=name, key_type=key_type)
347 store.save(creds, name="ca")
362 creds = TestCA._make_server_credentials(name=spec.name, domains=spec.domains,
366 creds = TestCA._make_client_credentials(name=spec.name, issuer=issuer,
369 elif spec.name:
370 creds = TestCA._make_ca_credentials(name=spec.name, issuer=issuer,
450 for name in domains:
452 names.append(x509.IPAddress(ipaddress.ip_address(name)))
455 names.append(x509.DNSName(name))
499 def _make_ca_credentials(name, key_type: Any, argument
511 subject = TestCA._make_x509_name(org_name=name, parent=issuer.subject if issuer else None)
519 return Credentials(name=name, cert=cert, pkey=pkey, issuer=issuer)
522 def _make_server_credentials(name: str, domains: List[str], issuer: Credentials,
528 subject = TestCA._make_x509_name(common_name=name, parent=issuer.subject)
536 return Credentials(name=name, cert=cert, pkey=pkey, issuer=issuer)
539 def _make_client_credentials(name: str,
546 subject = TestCA._make_x509_name(common_name=name, parent=issuer.subject)
554 return Credentials(name=name, cert=cert, pkey=pkey, issuer=issuer)