diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-11 22:51:27 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-11 23:02:01 -0400 |
commit | 61ff35662049f02da8d2c0f54ef6e84f97c14b1a (patch) | |
tree | 9ed62e6417eb49cec6c9230047a4c3f8ee0e0599 /tests | |
parent | e40a03f61e907d0de5fb07624cb6306323de543d (diff) | |
download | cryptography-61ff35662049f02da8d2c0f54ef6e84f97c14b1a.tar.gz cryptography-61ff35662049f02da8d2c0f54ef6e84f97c14b1a.tar.bz2 cryptography-61ff35662049f02da8d2c0f54ef6e84f97c14b1a.zip |
Add AuthorityKeyIdentifier.from_issuer_subject_key_identifier
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_x509_ext.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index d85b4bbc..28ddab87 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -2634,6 +2634,28 @@ class TestAuthorityKeyIdentifierExtension(object): ) assert ext.value == aki + def test_from_issuer_subject_key_identifier(self, backend): + issuer_cert = _load_cert( + os.path.join("x509", "rapidssl_sha256_ca_g3.pem"), + x509.load_pem_x509_certificate, + backend + ) + cert = _load_cert( + os.path.join("x509", "cryptography.io.pem"), + x509.load_pem_x509_certificate, + backend + ) + ext = cert.extensions.get_extension_for_oid( + ExtensionOID.AUTHORITY_KEY_IDENTIFIER + ) + ski = issuer_cert.extensions.get_extension_for_class( + x509.SubjectKeyIdentifier + ) + aki = x509.AuthorityKeyIdentifier.from_issuer_subject_key_identifier( + ski + ) + assert ext.value == aki + class TestNameConstraints(object): def test_ipaddress_wrong_type(self): |