MCPcopy
hub / github.com/pyca/cryptography / load_key

Method load_key

tests/x509/test_x509.py:6982–6990  ·  view source on GitHub ↗
(self, backend)

Source from the content-addressed store, hash-verified

6980 """Test if signing rejects DH keys properly."""
6981
6982 def load_key(self, backend):
6983 vector = load_vectors_from_file(
6984 os.path.join("asymmetric", "DH", "rfc3526.txt"),
6985 load_nist_vectors,
6986 )[1]
6987 p = int.from_bytes(binascii.unhexlify(vector["p"]), "big")
6988 params = dh.DHParameterNumbers(p, int(vector["g"]))
6989 param = params.parameters(backend)
6990 return param.generate_private_key()
6991
6992 def test_crt_signing_check(self, rsa_key_2048: rsa.RSAPrivateKey, backend):
6993 issuer_private_key = self.load_key(backend)

Callers 3

Calls 5

load_vectors_from_fileFunction · 0.85
from_bytesMethod · 0.80
unhexlifyMethod · 0.80
parametersMethod · 0.45
generate_private_keyMethod · 0.45

Tested by

no test coverage detected