MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / load_private_key

Function load_private_key

opcua/crypto/uacrypto.py:30–36  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

28
29
30def load_private_key(path):
31 _, ext = os.path.splitext(path)
32 with open(path, "rb") as f:
33 if ext == ".pem":
34 return serialization.load_pem_private_key(f.read(), password=None, backend=default_backend())
35 else:
36 return serialization.load_der_private_key(f.read(), password=None, backend=default_backend())
37
38
39def der_from_x509(certificate):

Callers 1

uacrypto.pyFile · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected