Exemplo n.º 1
0
    def __init__(self, msg_dict):
        # , contact_jid, key, iv, payload, dev_id, my_dev_id):
        Node.__init__(self, 'encrypted', attrs={'xmlns': NS_OMEMO})
        header = Node('header', attrs={'sid': msg_dict['sid']})
        for rid, key in msg_dict['keys'].items():
            header.addChild('key', attrs={'rid': rid}).addData(b64encode(key))

        header.addChild('iv').addData(b64encode(msg_dict['iv']))
        self.addChild(node=header)
        self.addChild('payload').addData(b64encode(msg_dict['payload']))
Exemplo n.º 2
0
    def __init__(self, msg_dict):
        # , contact_jid, key, iv, payload, dev_id, my_dev_id):
        Node.__init__(self, 'encrypted', attrs={'xmlns': NS_OMEMO})
        header = Node('header', attrs={'sid': msg_dict['sid']})
        for rid, key in msg_dict['keys'].items():
            header.addChild('key', attrs={'rid': rid}).addData(b64encode(key))

        header.addChild('iv').addData(b64encode(msg_dict['iv']))
        self.addChild(node=header)
        self.addChild('payload').addData(b64encode(msg_dict['payload']))
Exemplo n.º 3
0
 def __init__(self, data):
     assert isinstance(data, Node)
     Node.__init__(self, tag='pubsub', attrs={'xmlns': NS_PUBSUB})
     self.addChild(node=data)
Exemplo n.º 4
0
 def __init__(self, node_str, data):
     assert node_str is not None and isinstance(data, Node)
     Node.__init__(self, tag='publish', attrs={'node': node_str})
     self.addChild('item').addChild(node=data)
Exemplo n.º 5
0
 def __init__(self, data):
     assert data is Node
     Node.__init__(self, tag='pubsub', attrs={'xmlns': NS_PUBSUB})
     self.addChild(node=data)
Exemplo n.º 6
0
 def __init__(self, node_str, data):
     assert node_str is not None and data is Node
     Node.__init__(self, tag='publish', attrs={'node': node_str})
     self.addChild('item').addChild(node=data)
Exemplo n.º 7
0
 def __init__(self, data):
     assert isinstance(data, Node)
     Node.__init__(self, tag='pubsub', attrs={'xmlns': NS_PUBSUB})
     self.addChild(node=data)
Exemplo n.º 8
0
 def __init__(self, data):
     assert data is Node
     Node.__init__(self, tag='pubsub', attrs={'xmlns': NS_PUBSUB})
     self.addChild(node=data)