summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Paul Weber <singpolyma@singpolyma.net>2012-04-27 17:37:26 -0500
committerStephen Paul Weber <singpolyma@singpolyma.net>2012-04-27 17:37:26 -0500
commit996a38e28204b33429f5064386bfd54709d06d6e (patch)
tree46fadc8860ed07d7f1f0ee1c0a63cfe45ff272f9
parent1b13c5f127b31c1b52bc8fb87415f62c2e769346 (diff)
PrimaryUserIDPacket
-rw-r--r--Data/OpenPGP.hs6
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)
786put_signature_subpacket (PreferredKeyServerPacket uri) = 787put_signature_subpacket (PreferredKeyServerPacket uri) =
787 (B.fromString uri, 24) 788 (B.fromString uri, 24)
789put_signature_subpacket (PrimaryUserIDPacket isprimary) =
790 (encode $ enum_to_word8 isprimary, 25)
788put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = 791put_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
863parse_signature_subpacket 24 = 866parse_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
869parse_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
866parse_signature_subpacket tag = 872parse_signature_subpacket tag =
867 fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString 873 fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString