aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpow/POW-0.7/lib/pkix.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pow/POW-0.7/lib/pkix.py b/pow/POW-0.7/lib/pkix.py
index 744c4ccf..60306147 100755
--- a/pow/POW-0.7/lib/pkix.py
+++ b/pow/POW-0.7/lib/pkix.py
@@ -765,6 +765,12 @@ class Certificate(Sequence):
def getExtensions(self):
return self.tbs.extensions.get()
+ def getExtension(self, oid):
+ for x in self.getExtensions():
+ if x[0] == oid:
+ return x
+ return None
+
_addFragment('''
<method>
<header>
@@ -1091,6 +1097,12 @@ class CertificateList(Sequence):
def getExtensions(self):
return self.tbs.crlExtensions.get()
+ def getExtension(self, oid):
+ for x in self.getExtensions():
+ if x[0] == oid:
+ return x
+ return None
+
_addFragment('''
<method>
<header>
@@ -1233,6 +1245,12 @@ class CertificationRequest(Sequence):
raise DerError, "failed to understand X.501 Attribute encoding, sorry: %s" % self.get()
return self.certificationRequestInfo.attributes.val.choices["set"][0].get()
+ def getExtension(self, oid):
+ for x in self.getExtensions():
+ if x[0] == oid:
+ return x
+ return None
+
#---------- PKCS10 ----------#
#---------- GeneralNames object support ----------#
class OtherName(Sequence):