diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-23 22:03:09 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-25 07:50:25 -0600 |
commit | 8aad028501ef434071d3969bce41c4e6375b4c61 (patch) | |
tree | a06d8e93e8ff50d2e419f6524a8495a644e5f4a6 /tests | |
parent | 4d236049529bc1ab1b301756a6c9be7a30ce8f8a (diff) | |
download | cryptography-8aad028501ef434071d3969bce41c4e6375b4c61.tar.gz cryptography-8aad028501ef434071d3969bce41c4e6375b4c61.tar.bz2 cryptography-8aad028501ef434071d3969bce41c4e6375b4c61.zip |
rename dump to as_bytes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hazmat/backends/test_openssl.py | 4 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_rsa.py | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index b5de702d..8cf14b98 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -502,7 +502,7 @@ class TestRSAPEMSerialization(object): password = b"x" * 1024 key = RSA_KEY_2048.private_key(backend) with pytest.raises(ValueError): - key.dump( + key.as_bytes( serialization.Encoding.PEM, serialization.Format.PKCS8, serialization.BestAvailableEncryption(password) @@ -511,7 +511,7 @@ class TestRSAPEMSerialization(object): def test_unsupported_key_encoding(self): key = RSA_KEY_2048.private_key(backend) with pytest.raises(ValueError): - key.dump( + key.as_bytes( serialization.Encoding.DER, serialization.Format.PKCS8, serialization.NoEncryption() diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index a0df2f26..17a2a414 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -1764,10 +1764,10 @@ class TestRSAPEMWriter(object): ] ) ) - def test_dump_encrypted_pem(self, backend, fmt, password): + def test_as_bytes_encrypted_pem(self, backend, fmt, password): key = RSA_KEY_2048.private_key(backend) _skip_if_no_serialization(key, backend) - serialized = key.dump( + serialized = key.as_bytes( serialization.Encoding.PEM, fmt, serialization.BestAvailableEncryption(password) @@ -1783,10 +1783,10 @@ class TestRSAPEMWriter(object): "fmt", (serialization.Format.TraditionalOpenSSL, serialization.Format.PKCS8), ) - def test_dump_unencrypted_pem(self, backend, fmt): + def test_as_bytes_unencrypted_pem(self, backend, fmt): key = RSA_KEY_2048.private_key(backend) _skip_if_no_serialization(key, backend) - serialized = key.dump( + serialized = key.as_bytes( serialization.Encoding.PEM, fmt, serialization.NoEncryption() @@ -1798,41 +1798,41 @@ class TestRSAPEMWriter(object): priv_num = key.private_numbers() assert loaded_priv_num == priv_num - def test_dump_invalid_encoding(self, backend): + def test_as_bytes_invalid_encoding(self, backend): key = RSA_KEY_2048.private_key(backend) _skip_if_no_serialization(key, backend) with pytest.raises(TypeError): - key.dump( + key.as_bytes( "notencoding", serialization.Format.PKCS8, serialization.NoEncryption() ) - def test_dump_invalid_format(self, backend): + def test_as_bytes_invalid_format(self, backend): key = RSA_KEY_2048.private_key(backend) _skip_if_no_serialization(key, backend) with pytest.raises(TypeError): - key.dump( + key.as_bytes( serialization.Encoding.PEM, "invalidformat", serialization.NoEncryption() ) - def test_dump_invalid_encryption_algorithm(self, backend): + def test_as_bytes_invalid_encryption_algorithm(self, backend): key = RSA_KEY_2048.private_key(backend) _skip_if_no_serialization(key, backend) with pytest.raises(TypeError): - key.dump( + key.as_bytes( serialization.Encoding.PEM, serialization.Format.TraditionalOpenSSL, "notanencalg" ) - def test_dump_unsupported_encryption_type(self, backend): + def test_as_bytes_unsupported_encryption_type(self, backend): key = RSA_KEY_2048.private_key(backend) _skip_if_no_serialization(key, backend) with pytest.raises(ValueError): - key.dump( + key.as_bytes( serialization.Encoding.PEM, serialization.Format.TraditionalOpenSSL, DummyKeyEncryption() |