diff options
author | michael-hart <michael.hart1994@gmail.com> | 2014-09-23 23:10:32 +0100 |
---|---|---|
committer | michael-hart <michael.hart1994@gmail.com> | 2014-09-26 18:40:27 +0100 |
commit | 2ca899115b80dba47b65a8255bbbce1cce2ce238 (patch) | |
tree | ad628532f0bcefc258a88ce3c383dddce53a9e37 | |
parent | fe2cd085cffe05fbdec02164a93de7812acb44dd (diff) | |
download | cryptography-2ca899115b80dba47b65a8255bbbce1cce2ce238.tar.gz cryptography-2ca899115b80dba47b65a8255bbbce1cce2ce238.tar.bz2 cryptography-2ca899115b80dba47b65a8255bbbce1cce2ce238.zip |
Part 1 of rebase, with corrections for pep8
-rw-r--r-- | cryptography/hazmat/backends/interfaces.py | 2 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_serialization.py | 28 |
2 files changed, 6 insertions, 24 deletions
diff --git a/cryptography/hazmat/backends/interfaces.py b/cryptography/hazmat/backends/interfaces.py index dc720ad3..f3d64820 100644 --- a/cryptography/hazmat/backends/interfaces.py +++ b/cryptography/hazmat/backends/interfaces.py @@ -282,7 +282,7 @@ class PEMSerializationBackend(object): """ @abc.abstractmethod - def load_pem_public_key(self, data): + def load_pem_public_key(self, data, password): """ Loads a public key from PEM encoded data. """ diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py index 7cbd3f71..4bc7e811 100644 --- a/tests/hazmat/primitives/test_serialization.py +++ b/tests/hazmat/primitives/test_serialization.py @@ -82,39 +82,21 @@ class TestPEMSerialization(object): assert key assert isinstance(key, interfaces.EllipticCurvePrivateKey) - @pytest.mark.parametrize( - ("key_file"), - [ - os.path.join("asymmetric", "PKCS8", "unenc-rsa-pkcs8.pub.pem"), + def test_load_pem_rsa_public_key(self, backend): + key = load_vectors_from_file( os.path.join( "asymmetric", "PEM_Serialization", "rsa_public_key.pem"), - ] - ) - def test_load_pem_rsa_public_key(self, key_file, backend): - key = load_vectors_from_file( - key_file, lambda pemfile: load_pem_public_key( pemfile.read().encode(), backend ) ) assert key assert isinstance(key, interfaces.RSAPublicKey) - if isinstance(key, interfaces.RSAPublicKeyWithNumbers): - numbers = key.public_numbers() - assert numbers.e == 65537 - @pytest.mark.parametrize( - ("key_file"), - [ - os.path.join("asymmetric", "PKCS8", "unenc-dsa-pkcs8.pub.pem"), - os.path.join( - "asymmetric", "PEM_Serialization", - "dsa_public_key.pem"), - ] - ) - def test_load_pem_dsa_public_key(self, key_file, backend): + def test_load_pem_dsa_public_key(self, backend): key = load_vectors_from_file( - key_file, + os.path.join( + "asymmetric", "PEM_Serialization", "dsa_public_key.pem"), lambda pemfile: load_pem_public_key( pemfile.read().encode(), backend ) |