(csr: Any, issuer: Credentials, rfc82name: str = None)
| 413 | |
| 414 | @staticmethod |
| 415 | def _add_client_usages(csr: Any, issuer: Credentials, rfc82name: str = None) -> Any: |
| 416 | cert = csr.add_extension( |
| 417 | x509.BasicConstraints(ca=False, path_length=None), |
| 418 | critical=True, |
| 419 | ).add_extension( |
| 420 | x509.AuthorityKeyIdentifier.from_issuer_subject_key_identifier( |
| 421 | issuer.certificate.extensions.get_extension_for_class( |
| 422 | x509.SubjectKeyIdentifier).value), |
| 423 | critical=False |
| 424 | ) |
| 425 | if rfc82name: |
| 426 | cert.add_extension( |
| 427 | x509.SubjectAlternativeName([x509.RFC822Name(rfc82name)]), |
| 428 | critical=True, |
| 429 | ) |
| 430 | cert.add_extension( |
| 431 | x509.ExtendedKeyUsage([ |
| 432 | ExtendedKeyUsageOID.CLIENT_AUTH, |
| 433 | ]), |
| 434 | critical=True |
| 435 | ) |
| 436 | return cert |
| 437 | |
| 438 | @staticmethod |
| 439 | def _make_ca_credentials(name, key_type: Any, |
no outgoing calls
no test coverage detected