aboutsummaryrefslogtreecommitdiff
path: root/pow/POW-0.7/lib/pkix.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2007-09-30 22:54:27 +0000
committerRob Austein <sra@hactrn.net>2007-09-30 22:54:27 +0000
commit552b8abc732b5a8b3684fc6869e4af08399a15bb (patch)
tree0ecef75fb08f9614767944a6387ed0e2ec6d60b2 /pow/POW-0.7/lib/pkix.py
parentc346f75f611b37503eaf3422a8f783ebb465ad2e (diff)
getExtension()
svn path=/pow/POW-0.7/lib/pkix.py; revision=1058
Diffstat (limited to 'pow/POW-0.7/lib/pkix.py')
-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):