MCPcopy Create free account
hub / github.com/mpdavis/python-jose / test_wrap

Method test_wrap

tests/algorithms/test_AES.py:46–51  ·  view source on GitHub ↗
(self, alg, hex_key, hex_kek, expected)

Source from the content-addressed store, hash-verified

44class TestCryptographyAesKeywrap:
45 @pytest.mark.parametrize("alg,hex_key,hex_kek,expected", VECTORS)
46 def test_wrap(self, alg, hex_key, hex_kek, expected):
47 bin_key = unhexlify(hex_key)
48 bin_kek = unhexlify(hex_kek)
49 aes_key = CryptographyAESKey(bin_kek, alg)
50 actual = hexlify(aes_key.wrap_key(bin_key)).upper()
51 assert actual == expected
52
53 @pytest.mark.parametrize("alg,expected,hex_kek,hex_wrapped", VECTORS)
54 def test_unwrap(self, alg, expected, hex_kek, hex_wrapped):

Callers

nothing calls this directly

Calls 2

wrap_keyMethod · 0.95
CryptographyAESKeyClass · 0.90

Tested by

no test coverage detected