diff options
author | michael-hart <michael.hart1994@gmail.com> | 2014-09-26 08:51:59 +0100 |
---|---|---|
committer | michael-hart <michael.hart1994@gmail.com> | 2014-09-26 08:51:59 +0100 |
commit | 8fee6049ae99c1f68f31d71759d56e4faf0847e2 (patch) | |
tree | 497b79135fc3c879a622d6c37a7737979869b9b4 /tests/hazmat/primitives/test_serialization.py | |
parent | 15b59ee8d0b8dc814439243c8dd9cfadd8999653 (diff) | |
download | cryptography-8fee6049ae99c1f68f31d71759d56e4faf0847e2.tar.gz cryptography-8fee6049ae99c1f68f31d71759d56e4faf0847e2.tar.bz2 cryptography-8fee6049ae99c1f68f31d71759d56e4faf0847e2.zip |
Added code and tests of EC public keys
Diffstat (limited to 'tests/hazmat/primitives/test_serialization.py')
-rw-r--r-- | tests/hazmat/primitives/test_serialization.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py index 7cbd3f71..a97e38f5 100644 --- a/tests/hazmat/primitives/test_serialization.py +++ b/tests/hazmat/primitives/test_serialization.py @@ -122,6 +122,18 @@ class TestPEMSerialization(object): assert key assert isinstance(key, interfaces.DSAPublicKey) + @pytest.mark.elliptic + def test_load_ec_public_key(self, backend): + _skip_curve_unsupported(backend, ec.SECP256R1()) + key = load_vectors_from_file( + os.path.join("asymmetric", "PEM_Serialization", "ec_public_key.pem"), + lambda pemfile: load_pem_public_key( + pemfile.read().encode(), backend + ) + ) + assert key + assert isinstance(key, interfaces.EllipticCurvePublicKey) + @pytest.mark.traditional_openssl_serialization class TestTraditionalOpenSSLSerialization(object): |