From 552b8abc732b5a8b3684fc6869e4af08399a15bb Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 30 Sep 2007 22:54:27 +0000 Subject: getExtension() svn path=/pow/POW-0.7/lib/pkix.py; revision=1058 --- pow/POW-0.7/lib/pkix.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'pow/POW-0.7/lib/pkix.py') 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('''
@@ -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('''
@@ -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): -- cgit v1.2.3