def is_good_mid_cert(self, b64cert): import base64 cert = base64.b64decode(b64cert) if cert == None: raise Exception, 'Invalid certificate' cd = bdocpython.CertificateData() cd.decode(cert) for pol in bdocpython.list_policies(cert): if self.have_oid(pol): return False, 'Reject: policy %s' % pol return True, None
def is_good_mid_cert(self, b64cert): import base64 cert = base64.b64decode(b64cert) if cert == None: raise Exception, 'Invalid certificate' if self.__midca == None: return False, 'Reject: access not configured' cd = bdocpython.CertificateData() cd.decode(cert) if not (cd.issuer_name == self.__midca.subject_name): return False, 'Reject: issuer' for pol in bdocpython.list_policies(cert): if self.have_oid(pol): return False, 'Reject: policy %s' % pol return True, None