(self, certlist)
return res
Construct the chain of certificates leading from 'self' to the
        self signed root using the certificates in 'certlist'. If the
        list does not provide all the required certs to go to the root
        the function returns a incomplete chain starting with the
        certificate. This fact can be tested by tchecking if the last
        certificate of the returned chain is self signed (if c is the
        result, c[-1].isSelfSigned())
Construct the chain of certificates leading from 'self' to the
        self signed root using the certificates in 'certlist'. If the
        list does not provide all the required certs to go to the root
        the function returns a incomplete chain starting with the
        certificate. This fact can be tested by tchecking if the last
        certificate of the returned chain is self signed (if c is the
        result, c[-1].isSelfSigned())
Construct the chain of certificates leading from self to the self signed root using the certificates in certlist . If the list does not provide all the required certs to go to the root the function returns a incomplete chain starting with the certificate . This fact can be tested by tchecking if the last certificate of the returned chain is self signed ( if c is the result c [ - 1 ] . isSelfSigned () )
def chain(self, certlist):
        """
        Construct the chain of certificates leading from 'self' to the
        self signed root using the certificates in 'certlist'. If the
        list does not provide all the required certs to go to the root
        the function returns a incomplete chain starting with the
        certificate. This fact can be tested by tchecking if the last
        certificate of the returned chain is self signed (if c is the
        result, c[-1].isSelfSigned())
        """
        d = {}
        for c in certlist:
            # XXX we should check if we have duplicate
            d[c.subject] = c
        res = [self]
        cur = self
        while not cur.isSelfSigned():
            if d.has_key(cur.issuer):
                possible_issuer = d[cur.issuer]
                if cur.isIssuerCert(possible_issuer):
                    res.append(possible_issuer)
                    cur = possible_issuer
                else:
                    break
        return res
def chain ( self , certlist ) : d = { } for c in certlist : # XXX we should check if we have duplicate d [ c . subject ] = c res = [ self ] cur = self while not cur . isSelfSigned ( ) : if d . has_key ( cur . issuer ) : possible_issuer = d [ cur . issuer ] if cur . isIssuerCert ( possible_issuer ) : res . append ( possible_issuer ) cur = possible_issuer else : break return res