summaryrefslogtreecommitdiff
path: root/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs')
-rw-r--r--Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs b/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
index 00d9dd3..06d7f1a 100644
--- a/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
+++ b/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
@@ -10,6 +10,7 @@ module Codec.Encryption.OpenPGP.ASCIIArmor.Encode (
10import Codec.Encryption.OpenPGP.ASCIIArmor.Types 10import Codec.Encryption.OpenPGP.ASCIIArmor.Types
11import Data.ByteString (ByteString) 11import Data.ByteString (ByteString)
12import qualified Data.ByteString as B 12import qualified Data.ByteString as B
13import qualified Data.ByteString.Lazy as BL
13import qualified Data.ByteString.Char8 as BC8 14import qualified Data.ByteString.Char8 as BC8
14import qualified Data.ByteString.Base64 as Base64 15import qualified Data.ByteString.Base64 as Base64
15import Data.Digest.CRC24 (crc24) 16import Data.Digest.CRC24 (crc24)
@@ -21,8 +22,8 @@ encode :: [Armor] -> ByteString
21encode = B.concat . map armor 22encode = B.concat . map armor
22 23
23armor :: Armor -> ByteString 24armor :: Armor -> ByteString
24armor (Armor atype ahs bs) = beginLine atype `B.append` armorHeaders ahs `B.append` blankLine `B.append` armorData bs `B.append` armorChecksum bs `B.append` endLine atype 25armor (Armor atype ahs bs) = beginLine atype `B.append` armorHeaders ahs `B.append` blankLine `B.append` armorData (B.concat . BL.toChunks $ bs) `B.append` armorChecksum (B.concat . BL.toChunks $ bs) `B.append` endLine atype
25armor (ClearSigned chs ctxt csig) = BC8.pack "-----BEGIN PGP SIGNED MESSAGE-----\n" `B.append` armorHeaders chs `B.append` blankLine `B.append` dashEscape ctxt `B.append` armor csig 26armor (ClearSigned chs ctxt csig) = BC8.pack "-----BEGIN PGP SIGNED MESSAGE-----\n" `B.append` armorHeaders chs `B.append` blankLine `B.append` dashEscape (B.concat . BL.toChunks $ ctxt) `B.append` armor csig
26 27
27blankLine :: ByteString 28blankLine :: ByteString
28blankLine = BC8.singleton '\n' 29blankLine = BC8.singleton '\n'