Пример #1
0
    def toProtocolTreeNode(self):
        node = super(EncryptedMessageProtocolEntity, self).toProtocolTreeNode()
        participantsNode = ProtocolTreeNode("participants")
        for enc in self.encEntities:
            encNode = enc.toProtocolTreeNode()
            if encNode.tag == "to":
                participantsNode.addChild(encNode)
            else:
                node.addChild(encNode)

        if len(participantsNode.getAllChildren()):
            node.addChild(participantsNode)

        return node
Пример #2
0
    def toProtocolTreeNode(self):
        node = super(EncryptedMessageProtocolEntity, self).toProtocolTreeNode()
        participantsNode = ProtocolTreeNode("participants")
        for enc in self.encEntities:
            encNode = enc.toProtocolTreeNode()
            if encNode.tag == "to":
                participantsNode.addChild(encNode)
            else:
                node.addChild(encNode)

        if len(participantsNode.getAllChildren()):
            node.addChild(participantsNode)

        return node