diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-05-25 17:27:50 +0100 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-05-27 21:50:30 +0100 |
commit | aac0b51f7c93fdca930a1684263673e7b6a0e669 (patch) | |
tree | 711b38bfa53edb6d940d1951d094dd7cdc32c463 | |
parent | 4356149cf3d2e4702b2d2e49b6983f40f98fd5f2 (diff) | |
download | cryptography-aac0b51f7c93fdca930a1684263673e7b6a0e669.tar.gz cryptography-aac0b51f7c93fdca930a1684263673e7b6a0e669.tar.bz2 cryptography-aac0b51f7c93fdca930a1684263673e7b6a0e669.zip |
Test PKCS#8 DSA key loads OK
-rw-r--r-- | tests/hazmat/primitives/test_serialization.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py index 9e735ec3..36dbfcd8 100644 --- a/tests/hazmat/primitives/test_serialization.py +++ b/tests/hazmat/primitives/test_serialization.py @@ -458,3 +458,21 @@ class TestPKCS8Serialisation(object): "bdb55af2f062cc4a3b077434e6fffad5faa29a2b5dba2bed3e4621e478c0" "97ccfe7f", 16 ) + + @pytest.mark.parametrize( + ("key_file", "password"), + [ + ("unenc-dsa-pkcs8.pem", None), + ] + ) + def test_load_pem_dsa_private_key(self, key_file, password, backend): + key = load_vectors_from_file( + os.path.join( + "asymmetric", "PKCS8", key_file), + lambda pemfile: load_pem_traditional_openssl_private_key( + pemfile.read().encode(), password, backend + ) + ) + + assert key + assert isinstance(key, dsa.DSAPrivateKey) |