summaryrefslogtreecommitdiff
path: root/Data
diff options
context:
space:
mode:
authorStephen Paul Weber <singpolyma@singpolyma.net>2012-04-27 14:42:24 -0500
committerStephen Paul Weber <singpolyma@singpolyma.net>2012-04-27 14:42:24 -0500
commitbca49f3b15fcb8d52fe9d67cd96d702fe06741b5 (patch)
treec216ccbc0855808bf3f80674a67cc395b04de942 /Data
parent1a1258ace5b9ae959972c18184566bb689bd8575 (diff)
TrustSignaturePacket
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 63d4dc1..1fc3192 100644
--- a/Data/OpenPGP.hs
+++ b/Data/OpenPGP.hs
@@ -658,6 +658,7 @@ data SignatureSubpacket =
658 SignatureExpirationTimePacket Word32 | -- seconds after CreationTime 658 SignatureExpirationTimePacket Word32 | -- seconds after CreationTime
659 ExportableCertificationPacket Bool | 659 ExportableCertificationPacket Bool |
660 TrustSignaturePacket {depth::Word8, trust::Word8} | 660 TrustSignaturePacket {depth::Word8, trust::Word8} |
661 RegularExpressionPacket String |
661 IssuerPacket String | 662 IssuerPacket String |
662 UnsupportedSignatureSubpacket Word8 B.ByteString 663 UnsupportedSignatureSubpacket Word8 B.ByteString
663 deriving (Show, Read, Eq) 664 deriving (Show, Read, Eq)
@@ -699,6 +700,8 @@ put_signature_subpacket (ExportableCertificationPacket exportable) =
699 (encode $ enum_to_word8 exportable, 4) 700 (encode $ enum_to_word8 exportable, 4)
700put_signature_subpacket (TrustSignaturePacket depth trust) = 701put_signature_subpacket (TrustSignaturePacket depth trust) =
701 (B.concat [encode depth, encode trust], 5) 702 (B.concat [encode depth, encode trust], 5)
703put_signature_subpacket (RegularExpressionPacket regex) =
704 (B.concat [B.fromString regex, B.singleton 0], 6)
702put_signature_subpacket (IssuerPacket keyid) = 705put_signature_subpacket (IssuerPacket keyid) =
703 (encode (fst $ head $ readHex keyid :: Word64), 16) 706 (encode (fst $ head $ readHex keyid :: Word64), 16)
704put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = 707put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) =
@@ -715,6 +718,9 @@ parse_signature_subpacket 4 =
715-- TrustSignaturePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.13 718-- TrustSignaturePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.13
716parse_signature_subpacket 5 = 719parse_signature_subpacket 5 =
717 liftM2 TrustSignaturePacket get get 720 liftM2 TrustSignaturePacket get get
721-- TrustSignaturePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.14
722parse_signature_subpacket 6 = fmap
723 (RegularExpressionPacket . B.toString . B.init) getRemainingByteString
718-- IssuerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.5 724-- IssuerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.5
719parse_signature_subpacket 16 = do 725parse_signature_subpacket 16 = do
720 keyid <- get :: Get Word64 726 keyid <- get :: Get Word64