aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-03-12 09:41:47 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2016-03-12 09:41:47 -0500
commit2d0deb14fe2502fcab6cb9ec56f444ad7cd6dd4a (patch)
treeff568231e454cd9fff9b9cbc4da35f06cb03e448 /tests
parentab5de1a6b65c040dc61f02ef6e097105b2404cee (diff)
parent2d8e574e9dd1510783f12b7632b05622a16e82ef (diff)
downloadcryptography-2d0deb14fe2502fcab6cb9ec56f444ad7cd6dd4a.tar.gz
cryptography-2d0deb14fe2502fcab6cb9ec56f444ad7cd6dd4a.tar.bz2
cryptography-2d0deb14fe2502fcab6cb9ec56f444ad7cd6dd4a.zip
Merge pull request #2813 from reaperhulk/fix-2758
Add AuthorityKeyIdentifier.from_issuer_subject_key_identifier
Diffstat (limited to 'tests')
-rw-r--r--tests/test_x509_ext.py22
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):