Skip to content

Commit

Permalink
implemented TrustPacket
Browse files Browse the repository at this point in the history
  • Loading branch information
alios committed Jun 29, 2012
1 parent 8af7590 commit a18c579
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Data/OpenPGP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ data Packet =
timestamp::Word32,
content::B.ByteString
} |
TrustPacket B.ByteString |
UserIDPacket String |
ModificationDetectionCodePacket B.ByteString |
UnsupportedPacket Word8 B.ByteString
Expand Down Expand Up @@ -410,6 +411,7 @@ put_packet (LiteralDataPacket { format = format, filename = filename,
where
filename_l = (fromIntegral $ B.length lz_filename) :: Word8
lz_filename = B.fromString filename
put_packet (TrustPacket bytes) = (bytes, 12)
put_packet (UserIDPacket txt) = (B.fromString txt, 13)
put_packet (ModificationDetectionCodePacket bstr) = (bstr, 19)
put_packet (UnsupportedPacket tag bytes) = (bytes, fromIntegral tag)
Expand Down Expand Up @@ -559,6 +561,8 @@ parse_packet 11 = do
timestamp = timestamp,
content = content
}
-- TrustPacket, http://tools.ietf.org/html/rfc4880#section-5.10
parse_packet 12 = fmap TrustPacket getRemainingByteString
-- UserIDPacket, http://tools.ietf.org/html/rfc4880#section-5.11
parse_packet 13 =
fmap (UserIDPacket . B.toString) getRemainingByteString
Expand Down

0 comments on commit a18c579

Please sign in to comment.