aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-12-26 16:47:20 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2015-12-26 16:47:20 -0500
commit15bd026fde49861dbbd241c4e1d3bc1ab65e00fd (patch)
treebbcae80f3609f29ca90bda78a7144c2c0ac43135 /src
parent6cbdb348230d802b100981fbef0793cf65306797 (diff)
parent8adb59643b7c1219cd286c53243a401b1da0f285 (diff)
downloadcryptography-15bd026fde49861dbbd241c4e1d3bc1ab65e00fd.tar.gz
cryptography-15bd026fde49861dbbd241c4e1d3bc1ab65e00fd.tar.bz2
cryptography-15bd026fde49861dbbd241c4e1d3bc1ab65e00fd.zip
Merge pull request #2585 from reaperhulk/san-iterable
support indexing on GeneralNames and SubjectAlternativeName
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/x509/extensions.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py
index 4681629c..10b8da41 100644
--- a/src/cryptography/x509/extensions.py
+++ b/src/cryptography/x509/extensions.py
@@ -897,6 +897,9 @@ class GeneralNames(object):
def __ne__(self, other):
return not self == other
+ def __getitem__(self, idx):
+ return self._general_names[idx]
+
@utils.register_interface(ExtensionType)
class SubjectAlternativeName(object):
@@ -923,6 +926,9 @@ class SubjectAlternativeName(object):
return self._general_names == other._general_names
+ def __getitem__(self, idx):
+ return self._general_names[idx]
+
def __ne__(self, other):
return not self == other