|
Instead of the Put instance emitting the actual packet header, it emits
the start of the trailer data (which is the same bytes as the packet
header).
SignaturePacket is opaque and there is a smart constructor,
signaturePacket, that takes all the data *except* the trailer and
auto-generates the trailer, making sure the trailer is always valid, so
that the above becomes possible.
WARNING: SignaturePacket is not *fully* opaque. You *may* still update
fields directly using record syntax (on an already constructed packet).
This may be useful, but if any of the values that make up the trailer
are changed this will MAKE THE PACKET INVALID. This trade-off is deemed
acceptable for now, but may change in the future. Any fields that do not
affect the trailer (unhashed subpackets, etc) may be safely updated in
this way. Other fields MUST be updated by constructing a new
SignaturePacket with the smart constructor.
This usage is exemplefied by Data.OpenPGP.Crypto
The major upside of this is that it is now possible to re-emit
unmodified (or even modified, if only fields not in the trailer are
modified) SignaturePackets without invalidating the signature.
Closes #11
|