Get a tree-like object of the certificate list
(self)
| 1598 | |
| 1599 | @property |
| 1600 | def tree(self): |
| 1601 | """ |
| 1602 | Get a tree-like object of the certificate list |
| 1603 | """ |
| 1604 | # We store the tree object as a dictionary that contains children. |
| 1605 | tree = [(x, []) for x in self.rootCAs] |
| 1606 | |
| 1607 | # We'll empty this list eventually |
| 1608 | certList = list(self) |
| 1609 | |
| 1610 | # We make a list of certificates we have to search children for, and iterate |
| 1611 | # through it until it's empty. |
| 1612 | todo = list(tree) |
| 1613 | |
| 1614 | # Iterate |
| 1615 | while todo: |
| 1616 | cert, children = todo.pop() |
| 1617 | for c in certList: |
| 1618 | # Check if this certificate matches the one we're looking at |
| 1619 | if c.isIssuer(cert) and c != cert: |
| 1620 | item = (c, []) |
| 1621 | children.append(item) |
| 1622 | certList.remove(c) |
| 1623 | todo.append(item) |
| 1624 | |
| 1625 | return tree |
| 1626 | |
| 1627 | def getchain(self, cert): |
| 1628 | """ |