Ejemplo n.º 1
0
    def Serialize(self):
        """
        Create a string from packet object using ``lib.misc.ObjectToString``.

        This is useful when need to save the packet on disk.
        """
        src = misc.ObjectToString(self)
        # lg.out(10, 'signed.Serialize %d bytes, type is %s' % (len(src), str(type(src))))
        return src
Ejemplo n.º 2
0
 def Serialize(self):
     """
     Create a string that stores all data fields of that ``encrypted.Block``
     object.
     """
     decrypt_key = getattr(self, 'DecryptKey')
     delattr(self, 'DecryptKey')
     e = misc.ObjectToString(self)
     setattr(self, 'DecryptKey', decrypt_key)
     return e
Ejemplo n.º 3
0
    def Serialize(self):
        """
        Create a string from packet object using ``lib.misc.ObjectToString``.

        This is useful when need to save the packet on disk.
        """
        if hasattr(self, 'Packets'):
            currentPackets = getattr(self, 'Packets')
            delattr(self, 'Packets')
        else:
            currentPackets = []
        src = misc.ObjectToString(self)
        setattr(self, 'Packets', currentPackets)
        # lg.out(10, 'signed.Serialize %d bytes, type is %s' % (len(src), str(type(src))))
        return src
Ejemplo n.º 4
0
 def serialize(self):
     return misc.ObjectToString(self)