Lines Matching refs:x509
33 from cryptography import x509
40 from cryptography.x509 import ExtendedKeyUsageOID, NameOID
136 def subject(self) -> x509.Name:
301 def load_pem_cert(self, fpath: str) -> x509.Certificate:
303 return x509.load_pem_x509_certificate("".join(fd.readlines()).encode())
378 …e: Optional[str] = None, common_name: Optional[str] = None, parent: x509.Name = None) -> x509.Name:
382 name_pieces.append(x509.NameAttribute(oid, org_name))
384 name_pieces.append(x509.NameAttribute(NameOID.COMMON_NAME, common_name))
387 return x509.Name(name_pieces)
391 subject: x509.Name,
408 x509.CertificateBuilder()
414 .serial_number(x509.random_serial_number())
416 x509.SubjectKeyIdentifier.from_public_key(pubkey),
424 x509.BasicConstraints(ca=True, path_length=9),
427 x509.KeyUsage(
439 x509.ExtendedKeyUsage([
452 names.append(x509.IPAddress(ipaddress.ip_address(name)))
455 names.append(x509.DNSName(name))
458 x509.BasicConstraints(ca=False, path_length=None),
461 x509.AuthorityKeyIdentifier.from_issuer_subject_key_identifier(
463 x509.SubjectKeyIdentifier).value),
466 x509.SubjectAlternativeName(names), critical=True,
468 x509.ExtendedKeyUsage([
477 x509.BasicConstraints(ca=False, path_length=None),
480 x509.AuthorityKeyIdentifier.from_issuer_subject_key_identifier(
482 x509.SubjectKeyIdentifier).value),
487 x509.SubjectAlternativeName([x509.RFC822Name(rfc82name)]),
491 x509.ExtendedKeyUsage([