aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509_ext.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-12-27 17:27:40 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-12-27 17:27:40 -0600
commitad4b3593b14024619e1c3df70eeffc38adaf9c3a (patch)
tree3b3e3bcc2474b9919968f9474c916a3fb974a344 /tests/test_x509_ext.py
parent58fb25797de0ec8866836f2a075063feeb689289 (diff)
downloadcryptography-ad4b3593b14024619e1c3df70eeffc38adaf9c3a.tar.gz
cryptography-ad4b3593b14024619e1c3df70eeffc38adaf9c3a.tar.bz2
cryptography-ad4b3593b14024619e1c3df70eeffc38adaf9c3a.zip
support indexing in AIA
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r--tests/test_x509_ext.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index cfca5794..92e6e1a2 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -2210,6 +2210,32 @@ class TestAuthorityInformationAccess(object):
assert aia != aia2
assert aia != object()
+ def test_indexing(self):
+ aia = x509.AuthorityInformationAccess([
+ x509.AccessDescription(
+ AuthorityInformationAccessOID.OCSP,
+ x509.UniformResourceIdentifier(u"http://ocsp.domain.com")
+ ),
+ x509.AccessDescription(
+ AuthorityInformationAccessOID.CA_ISSUERS,
+ x509.UniformResourceIdentifier(u"http://domain.com/ca.crt")
+ ),
+ x509.AccessDescription(
+ AuthorityInformationAccessOID.OCSP,
+ x509.UniformResourceIdentifier(u"http://ocsp2.domain.com")
+ ),
+ x509.AccessDescription(
+ AuthorityInformationAccessOID.OCSP,
+ x509.UniformResourceIdentifier(u"http://ocsp3.domain.com")
+ ),
+ x509.AccessDescription(
+ AuthorityInformationAccessOID.OCSP,
+ x509.UniformResourceIdentifier(u"http://ocsp4.domain.com")
+ ),
+ ])
+ assert aia[-1] == aia[4]
+ assert aia[2:6:2] == [aia[2], aia[4]]
+
@pytest.mark.requires_backend_interface(interface=RSABackend)
@pytest.mark.requires_backend_interface(interface=X509Backend)