diff options
Diffstat (limited to 'Codec/Encryption/OpenPGP')
-rw-r--r-- | Codec/Encryption/OpenPGP/ASCIIArmor.hs | 4 | ||||
-rw-r--r-- | Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Codec/Encryption/OpenPGP/ASCIIArmor.hs b/Codec/Encryption/OpenPGP/ASCIIArmor.hs index 075a481..26d58dd 100644 --- a/Codec/Encryption/OpenPGP/ASCIIArmor.hs +++ b/Codec/Encryption/OpenPGP/ASCIIArmor.hs | |||
@@ -4,10 +4,10 @@ | |||
4 | -- (See the LICENSE file). | 4 | -- (See the LICENSE file). |
5 | 5 | ||
6 | module Codec.Encryption.OpenPGP.ASCIIArmor ( | 6 | module Codec.Encryption.OpenPGP.ASCIIArmor ( |
7 | armor | 7 | encode |
8 | , decode | 8 | , decode |
9 | , parseArmor | 9 | , parseArmor |
10 | ) where | 10 | ) where |
11 | 11 | ||
12 | import Codec.Encryption.OpenPGP.ASCIIArmor.Encode (armor) | 12 | import Codec.Encryption.OpenPGP.ASCIIArmor.Encode (encode) |
13 | import Codec.Encryption.OpenPGP.ASCIIArmor.Decode (decode, parseArmor) | 13 | import Codec.Encryption.OpenPGP.ASCIIArmor.Decode (decode, parseArmor) |
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 | ||
6 | module Codec.Encryption.OpenPGP.ASCIIArmor.Encode ( | 6 | module Codec.Encryption.OpenPGP.ASCIIArmor.Encode ( |
7 | armor | 7 | encode |
8 | ) where | 8 | ) where |
9 | 9 | ||
10 | import Codec.Encryption.OpenPGP.ASCIIArmor.Types | 10 | import Codec.Encryption.OpenPGP.ASCIIArmor.Types |
@@ -17,6 +17,9 @@ import Data.Serialize (put) | |||
17 | import Data.Serialize.Put (runPut, putWord32be) | 17 | import Data.Serialize.Put (runPut, putWord32be) |
18 | import Data.String (IsString, fromString) | 18 | import Data.String (IsString, fromString) |
19 | 19 | ||
20 | encode :: (Integral a, Show a) => [Armor a] -> ByteString | ||
21 | encode = B.concat . map armor | ||
22 | |||
20 | armor :: (Integral a, Show a) => Armor a -> ByteString | 23 | armor :: (Integral a, Show a) => Armor a -> ByteString |
21 | 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 | 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 |
22 | 25 | ||