diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-08-08 17:53:25 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-08-08 17:53:25 -0400 |
commit | c5f59dae64bc0218da50696fad2bfd75471d6e09 (patch) | |
tree | d36710212582288d887fcc86f9750e8027e75459 /tests/test_x509_ext.py | |
parent | 8b4b4166d3214509d6776b040c2409369bfd3363 (diff) | |
parent | cc671824ad133df93bbf903ef2d363b54b5835a9 (diff) | |
download | cryptography-c5f59dae64bc0218da50696fad2bfd75471d6e09.tar.gz cryptography-c5f59dae64bc0218da50696fad2bfd75471d6e09.tar.bz2 cryptography-c5f59dae64bc0218da50696fad2bfd75471d6e09.zip |
Merge pull request #2210 from reaperhulk/aki-classmethod
AuthorityKeyIdentifier classmethod
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r-- | tests/test_x509_ext.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index 73cdfc5f..40231b93 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -2112,6 +2112,25 @@ class TestAuthorityKeyIdentifierExtension(object): ] assert ext.value.authority_cert_serial_number == 3 + def test_from_certificate(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( + x509.OID_AUTHORITY_KEY_IDENTIFIER + ) + aki = x509.AuthorityKeyIdentifier.from_issuer_public_key( + issuer_cert.public_key() + ) + assert ext.value == aki + class TestNameConstraints(object): def test_ipaddress_wrong_type(self): |