(csr: Any, issuer: Credentials, rfc82name: str = None)
| 362 | |
| 363 | @staticmethod |
| 364 | def _add_client_usages(csr: Any, issuer: Credentials, rfc82name: str = None) -> Any: |
| 365 | cert = csr.add_extension( |
| 366 | x509.BasicConstraints(ca=False, path_length=None), |
| 367 | critical=True, |
| 368 | ).add_extension( |
| 369 | x509.AuthorityKeyIdentifier.from_issuer_subject_key_identifier( |
| 370 | issuer.certificate.extensions.get_extension_for_class( |
| 371 | x509.SubjectKeyIdentifier).value), |
| 372 | critical=False |
| 373 | ) |
| 374 | if rfc82name: |
| 375 | cert.add_extension( |
| 376 | x509.SubjectAlternativeName([x509.RFC822Name(rfc82name)]), |
| 377 | critical=True, |
| 378 | ) |
| 379 | cert.add_extension( |
| 380 | x509.ExtendedKeyUsage([ |
| 381 | ExtendedKeyUsageOID.CLIENT_AUTH, |
| 382 | ]), |
| 383 | critical=True |
| 384 | ) |
| 385 | return cert |
| 386 | |
| 387 | @staticmethod |
| 388 | def _make_ca_credentials(name, key_type: Any, |
no outgoing calls
no test coverage detected