From 996a38e28204b33429f5064386bfd54709d06d6e Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Fri, 27 Apr 2012 17:37:26 -0500 Subject: PrimaryUserIDPacket --- Data/OpenPGP.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Data') diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 39dd053..16f7d81 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs @@ -709,6 +709,7 @@ data SignatureSubpacket = PreferredCompressionAlgorithmsPacket [CompressionAlgorithm] | KeyServerPreferencesPacket {keyserver_no_modify::Bool} | PreferredKeyServerPacket String | + PrimaryUserIDPacket Bool | UnsupportedSignatureSubpacket Word8 B.ByteString deriving (Show, Read, Eq) @@ -785,6 +786,8 @@ put_signature_subpacket (KeyServerPreferencesPacket no_modify) = (B.singleton (if no_modify then 0x80 else 0x0), 23) put_signature_subpacket (PreferredKeyServerPacket uri) = (B.fromString uri, 24) +put_signature_subpacket (PrimaryUserIDPacket isprimary) = + (encode $ enum_to_word8 isprimary, 25) put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = (bytes, tag) @@ -862,6 +865,9 @@ parse_signature_subpacket 23 = do -- PreferredKeyServerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.18 parse_signature_subpacket 24 = fmap (PreferredKeyServerPacket . B.toString) getRemainingByteString +-- PrimaryUserIDPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.19 +parse_signature_subpacket 25 = + fmap (PrimaryUserIDPacket . enum_from_word8) get -- Represent unsupported packets as their tag and literal bytes parse_signature_subpacket tag = fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString -- cgit v1.2.3