Ejemplo n.º 1
0
def make_document(data):
    """
    Make OpenPGP document containing one-pass signature packet,
    literal packet and binary signature packet

    See details in RFC4880
    """
    g = GPG(gnupghome=settings.GNUPG_HOME)
    header = "%s%s" % (chr(144), chr(13)) #0x90 0x0D
    signature_packet = extract_signature_packet(extract_signature(data))
    body = strip_signature(data).rstrip()
    literal_packet = g.store(body).data
    one_pass_signature_packet = make_one_pass_signature_packet(signature_packet)
    return "%s%s%s%s" % (
        header,
        one_pass_signature_packet,
        literal_packet,
        signature_packet
    )
Ejemplo n.º 2
0
 def get_body(self):
     body = strip_signature(self.data[1])
     return body[0:len(body) - 1]