MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / _write_cert

Function _write_cert

tests/certs/gen.py:132–151  ·  view source on GitHub ↗
(path, cert_key_pair, password=None)

Source from the content-addressed store, hash-verified

130
131
132def _write_cert(path, cert_key_pair, password=None):
133 certificate, private_key = cert_key_pair
134 if password:
135 encryption = serialization.BestAvailableEncryption(password)
136 else:
137 encryption = serialization.NoEncryption()
138 with open(path + ".key.pem", "wb") as f:
139 f.write(
140 private_key.private_bytes(
141 encoding=serialization.Encoding.PEM,
142 format=serialization.PrivateFormat.TraditionalOpenSSL,
143 encryption_algorithm=encryption,
144 )
145 )
146 with open(path + ".cert.pem", "wb") as f:
147 f.write(
148 certificate.public_bytes(
149 encoding=serialization.Encoding.PEM,
150 )
151 )
152
153
154def new_ca(path, **subject):

Callers 2

new_caFunction · 0.85
new_certFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…