import struct from collections import namedtuple from .flags import SignatureSerializationFlag class Signature(namedtuple("Signature", "flags signature certificate_id")): def deserialize(cls, payload): flag = struct.unpack("