MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / _load_key

Function _load_key

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

Source from the content-addressed store, hash-verified

164
165
166def _load_key(path, password=None):
167 try:
168 with open(path, "rb") as f:
169 return serialization.load_pem_private_key(
170 f.read(),
171 password=password,
172 backend=backends.default_backend(),
173 )
174 except FileNotFoundError:
175 return None
176
177
178def _write_cert(path, cert_key_pair, password=None):

Callers 1

existing_keyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected