def __init__(self, stack=None, _pyfree=0, _pyfree_x509_crl=0): if stack is not None: self.stack = stack self._pyfree = _pyfree self.pystack = [] # This must be kept in sync with self.stack num = m2.sk_x509_crl_num(self.stack) for i in range(num): self.pystack.append(CRL(m2.sk_x509_crl_value(self.stack, i), _pyfree=_pyfree_x509_crl)) else: self.stack = m2.sk_x509_crl_new_null() self._pyfree = 1 self.pystack = [] # This must be kept in sync with self.stack
def __len__(self): assert m2.sk_x509_crl_num(self.stack) == len(self.pystack) return len(self.pystack)