()
| 17968 | .add_extension(x509.SubjectAlternativeName(san_entries), critical=False) |
| 17969 | .add_extension(x509.BasicConstraints(ca=True, path_length=None), critical=True) |
| 17970 | .sign(private_key=key, algorithm=hashes.SHA256()) |
| 17971 | ) |
| 17972 | with open(key_path, "wb") as f: |
| 17973 | f.write(key.private_bytes( |
| 17974 | encoding=serialization.Encoding.PEM, |
| 17975 | format=serialization.PrivateFormat.TraditionalOpenSSL, |
| 17976 | encryption_algorithm=serialization.NoEncryption(), |
| 17977 | )) |
| 17978 | with open(cert_path, "wb") as f: |
| 17979 | f.write(cert.public_bytes(serialization.Encoding.PEM)) |
| 17980 | try: |
| 17981 | os.chmod(key_path, 0o600) |
| 17982 | except Exception: |
| 17983 | pass |
| 17984 |
nothing calls this directly
no test coverage detected