diff options
Diffstat (limited to 'Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs')
-rw-r--r-- | Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs | 5 |
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 ( | |||
10 | import Codec.Encryption.OpenPGP.ASCIIArmor.Types | 10 | import Codec.Encryption.OpenPGP.ASCIIArmor.Types |
11 | import Data.ByteString (ByteString) | 11 | import Data.ByteString (ByteString) |
12 | import qualified Data.ByteString as B | 12 | import qualified Data.ByteString as B |
13 | import qualified Data.ByteString.Lazy as BL | ||
13 | import qualified Data.ByteString.Char8 as BC8 | 14 | import qualified Data.ByteString.Char8 as BC8 |
14 | import qualified Data.ByteString.Base64 as Base64 | 15 | import qualified Data.ByteString.Base64 as Base64 |
15 | import Data.Digest.CRC24 (crc24) | 16 | import Data.Digest.CRC24 (crc24) |
@@ -21,8 +22,8 @@ encode :: [Armor] -> ByteString | |||
21 | encode = B.concat . map armor | 22 | encode = B.concat . map armor |
22 | 23 | ||
23 | armor :: Armor -> ByteString | 24 | armor :: Armor -> ByteString |
24 | armor (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 | 25 | armor (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 |
25 | armor (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 | 26 | armor (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 | ||
27 | blankLine :: ByteString | 28 | blankLine :: ByteString |
28 | blankLine = BC8.singleton '\n' | 29 | blankLine = BC8.singleton '\n' |