def METHOD_NAME(self, file, compress=None, origin=None, canonicalize=False):
    self.algorithm.to_wire(file, compress, origin)
    file.write(
        struct.pack("!IIHH", self.inception, self.expiration, self.mode, self.error)
    )
    file.write(struct.pack("!H", len(self.key)))
    file.write(self.key)
    file.write(struct.pack("!H", len(self.other)))
    if len(self.other) > 0:
        file.write(self.other)