diff options
author | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-04-27 17:37:26 -0500 |
---|---|---|
committer | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-04-27 17:37:26 -0500 |
commit | 996a38e28204b33429f5064386bfd54709d06d6e (patch) | |
tree | 46fadc8860ed07d7f1f0ee1c0a63cfe45ff272f9 /Data | |
parent | 1b13c5f127b31c1b52bc8fb87415f62c2e769346 (diff) |
PrimaryUserIDPacket
Diffstat (limited to 'Data')
-rw-r--r-- | Data/OpenPGP.hs | 6 |
1 files changed, 6 insertions, 0 deletions
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 = | |||
709 | PreferredCompressionAlgorithmsPacket [CompressionAlgorithm] | | 709 | PreferredCompressionAlgorithmsPacket [CompressionAlgorithm] | |
710 | KeyServerPreferencesPacket {keyserver_no_modify::Bool} | | 710 | KeyServerPreferencesPacket {keyserver_no_modify::Bool} | |
711 | PreferredKeyServerPacket String | | 711 | PreferredKeyServerPacket String | |
712 | PrimaryUserIDPacket Bool | | ||
712 | UnsupportedSignatureSubpacket Word8 B.ByteString | 713 | UnsupportedSignatureSubpacket Word8 B.ByteString |
713 | deriving (Show, Read, Eq) | 714 | deriving (Show, Read, Eq) |
714 | 715 | ||
@@ -785,6 +786,8 @@ put_signature_subpacket (KeyServerPreferencesPacket no_modify) = | |||
785 | (B.singleton (if no_modify then 0x80 else 0x0), 23) | 786 | (B.singleton (if no_modify then 0x80 else 0x0), 23) |
786 | put_signature_subpacket (PreferredKeyServerPacket uri) = | 787 | put_signature_subpacket (PreferredKeyServerPacket uri) = |
787 | (B.fromString uri, 24) | 788 | (B.fromString uri, 24) |
789 | put_signature_subpacket (PrimaryUserIDPacket isprimary) = | ||
790 | (encode $ enum_to_word8 isprimary, 25) | ||
788 | put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = | 791 | put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = |
789 | (bytes, tag) | 792 | (bytes, tag) |
790 | 793 | ||
@@ -862,6 +865,9 @@ parse_signature_subpacket 23 = do | |||
862 | -- PreferredKeyServerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.18 | 865 | -- PreferredKeyServerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.18 |
863 | parse_signature_subpacket 24 = | 866 | parse_signature_subpacket 24 = |
864 | fmap (PreferredKeyServerPacket . B.toString) getRemainingByteString | 867 | fmap (PreferredKeyServerPacket . B.toString) getRemainingByteString |
868 | -- PrimaryUserIDPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.19 | ||
869 | parse_signature_subpacket 25 = | ||
870 | fmap (PrimaryUserIDPacket . enum_from_word8) get | ||
865 | -- Represent unsupported packets as their tag and literal bytes | 871 | -- Represent unsupported packets as their tag and literal bytes |
866 | parse_signature_subpacket tag = | 872 | parse_signature_subpacket tag = |
867 | fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString | 873 | fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString |