Modifications to the PGP signature packet format are marked by
trailing asterisks.
Signature packet
------------------
Offset Length Meaning
0 1 CTB for secret-key-encrypted (signed) packet
1 2 16-bit (or maybe 8-bit) length of packet
3 1 Version byte, may affect rest of fields that follow.
=3 for PGP versions >= 2.6
4 1 Length of following material that is implicitly included
in MD calculation (=5).
5 1 Signature classification field (see below).
=00 - Signature of a message or document, binary image.
=01 - Signature of a message or document, canonical text.
Implicitly append this to message for MD calculation.
6 4 32-bit timestamp of when signature was made.
Implicitly append this to message for MD calculation.
10 8 64-bit Key ID
18 1 Algorithm byte for public key scheme (RSA=0x01).
--Algorithm byte affects field definitions that follow.
19 1 Algorithm byte for message digest
=0x01 - MD5 message digest
=0x02 - SHA1 message digest ************
20 2 First 2 bytes of the Message Digest inside the
RSA-encrypted integer, to help us figure out if we
used the right RSA key to check the signature.
22 ? RSA-encrypted integer, encrypted message digest
(MPI with bitcount prefix).
Message digest "packet"
------------------------
The Message digest has no CTB packet framing. It is stored
packetless and naked, with padding (by 0xFF bytes), encrypted
inside the MPI in the signature packet and has one of the
following formats (corresponding to the MD algorithm byte
in the signature packet):
MSB . . . LSB