aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_rsa.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-02-23 22:03:09 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-02-25 07:50:25 -0600
commit8aad028501ef434071d3969bce41c4e6375b4c61 (patch)
treea06d8e93e8ff50d2e419f6524a8495a644e5f4a6 /tests/hazmat/primitives/test_rsa.py
parent4d236049529bc1ab1b301756a6c9be7a30ce8f8a (diff)
downloadcryptography-8aad028501ef434071d3969bce41c4e6375b4c61.tar.gz
cryptography-8aad028501ef434071d3969bce41c4e6375b4c61.tar.bz2
cryptography-8aad028501ef434071d3969bce41c4e6375b4c61.zip
rename dump to as_bytes
Diffstat (limited to 'tests/hazmat/primitives/test_rsa.py')
-rw-r--r--tests/hazmat/primitives/test_rsa.py24
1 files changed, 12 insertions, 12 deletions
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()