Merge remote-tracking branch 'upstream/master' into iss2255
Class Extensions was moved while I was adding function. Fixed now.
Conflicts:
src/cryptography/x509/base.py
diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py
index 92a3735..74e271e 100644
--- a/src/cryptography/x509/extensions.py
+++ b/src/cryptography/x509/extensions.py
@@ -80,6 +80,13 @@
raise ExtensionNotFound("No {0} extension was found".format(oid), oid)
+ def get_extension_for_class(self, extclass):
+ for ext in self:
+ if type(ext.value) == extclass:
+ return ext
+
+ raise ExtensionNotFound("No {0} extension was found".format(extclass), extclass)
+
def __iter__(self):
return iter(self._extensions)