summaryrefslogtreecommitdiff
path: root/Data
diff options
context:
space:
mode:
authorStephen Paul Weber <singpolyma@singpolyma.net>2012-04-27 15:01:47 -0500
committerStephen Paul Weber <singpolyma@singpolyma.net>2012-04-27 15:01:47 -0500
commitbb537f6275d9c83ed11ab477eefdb33ccb38428f (patch)
treeeae6168c91510cbda9ec281f64631d8299b579df /Data
parentcb2a5013f8c831591841404cb4a7c8201c522ad2 (diff)
RevocablePacket
Diffstat (limited to 'Data')
-rw-r--r--Data/OpenPGP.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs
index 68c3d51..b9a4836 100644
--- a/Data/OpenPGP.hs
+++ b/Data/OpenPGP.hs
@@ -659,6 +659,7 @@ data SignatureSubpacket =
659 ExportableCertificationPacket Bool | 659 ExportableCertificationPacket Bool |
660 TrustSignaturePacket {depth::Word8, trust::Word8} | 660 TrustSignaturePacket {depth::Word8, trust::Word8} |
661 RegularExpressionPacket String | 661 RegularExpressionPacket String |
662 RevocablePacket Bool |
662 IssuerPacket String | 663 IssuerPacket String |
663 UnsupportedSignatureSubpacket Word8 B.ByteString 664 UnsupportedSignatureSubpacket Word8 B.ByteString
664 deriving (Show, Read, Eq) 665 deriving (Show, Read, Eq)
@@ -702,6 +703,8 @@ put_signature_subpacket (TrustSignaturePacket depth trust) =
702 (B.concat [encode depth, encode trust], 5) 703 (B.concat [encode depth, encode trust], 5)
703put_signature_subpacket (RegularExpressionPacket regex) = 704put_signature_subpacket (RegularExpressionPacket regex) =
704 (B.concat [B.fromString regex, B.singleton 0], 6) 705 (B.concat [B.fromString regex, B.singleton 0], 6)
706put_signature_subpacket (RevocablePacket exportable) =
707 (encode $ enum_to_word8 exportable, 7)
705put_signature_subpacket (IssuerPacket keyid) = 708put_signature_subpacket (IssuerPacket keyid) =
706 (encode (fst $ head $ readHex keyid :: Word64), 16) 709 (encode (fst $ head $ readHex keyid :: Word64), 16)
707put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = 710put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) =
@@ -720,6 +723,9 @@ parse_signature_subpacket 5 = liftM2 TrustSignaturePacket get get
720-- TrustSignaturePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.14 723-- TrustSignaturePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.14
721parse_signature_subpacket 6 = fmap 724parse_signature_subpacket 6 = fmap
722 (RegularExpressionPacket . B.toString . B.init) getRemainingByteString 725 (RegularExpressionPacket . B.toString . B.init) getRemainingByteString
726-- RevocablePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.12
727parse_signature_subpacket 7 =
728 fmap (RevocablePacket . enum_from_word8) get
723-- IssuerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.5 729-- IssuerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.5
724parse_signature_subpacket 16 = do 730parse_signature_subpacket 16 = do
725 keyid <- get :: Get Word64 731 keyid <- get :: Get Word64