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, 4 insertions, 1 deletions
diff --git a/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs b/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
index 8853be3..99d4d54 100644
--- a/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
+++ b/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
@@ -4,7 +4,7 @@
4-- (See the LICENSE file). 4-- (See the LICENSE file).
5 5
6module Codec.Encryption.OpenPGP.ASCIIArmor.Encode ( 6module Codec.Encryption.OpenPGP.ASCIIArmor.Encode (
7 armor 7 encode
8) where 8) where
9 9
10import Codec.Encryption.OpenPGP.ASCIIArmor.Types 10import Codec.Encryption.OpenPGP.ASCIIArmor.Types
@@ -17,6 +17,9 @@ import Data.Serialize (put)
17import Data.Serialize.Put (runPut, putWord32be) 17import Data.Serialize.Put (runPut, putWord32be)
18import Data.String (IsString, fromString) 18import Data.String (IsString, fromString)
19 19
20encode :: (Integral a, Show a) => [Armor a] -> ByteString
21encode = B.concat . map armor
22
20armor :: (Integral a, Show a) => Armor a -> ByteString 23armor :: (Integral a, Show a) => Armor a -> ByteString
21armor (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 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
22 25