summaryrefslogtreecommitdiff
path: root/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
diff options
context:
space:
mode:
authorClint Adams <clint@softwarefreedom.org>2012-04-04 10:59:00 -0400
committerClint Adams <clint@softwarefreedom.org>2012-04-04 10:59:00 -0400
commitf907d986330ac5f88f9e921bdd6c0572d4691003 (patch)
treef9b261cd77f03157f2a15bb8f2b1ac3abd15a2cb /Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
parente4a8fe59707fc33ef26e1ca1dec4299a0d7ba6bf (diff)
Add newtype wrapper for lists for the purpose of avoiding the cereal instance.
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 d08c3c1..c9c9641 100644
--- a/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
+++ b/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
@@ -7,13 +7,14 @@ module Codec.Encryption.OpenPGP.ASCIIArmor.Encode (
7 armor 7 armor
8) where 8) where
9 9
10import Codec.Encryption.OpenPGP.Serialize (putPackets) 10import Codec.Encryption.OpenPGP.Serialize ()
11import Codec.Encryption.OpenPGP.Types 11import Codec.Encryption.OpenPGP.Types
12import Data.ByteString (ByteString) 12import Data.ByteString (ByteString)
13import qualified Data.ByteString as B 13import qualified Data.ByteString as B
14import qualified Data.ByteString.Char8 as BC8 14import qualified Data.ByteString.Char8 as BC8
15import qualified Data.ByteString.Base64 as Base64 15import qualified Data.ByteString.Base64 as Base64
16import Data.Digest.CRC24 (crc24) 16import Data.Digest.CRC24 (crc24)
17import Data.Serialize (put)
17import Data.Serialize.Put (runPut, putWord32be) 18import Data.Serialize.Put (runPut, putWord32be)
18import Data.String (IsString, fromString) 19import Data.String (IsString, fromString)
19 20
@@ -44,7 +45,7 @@ armorHeaders ahs = BC8.unlines . map armorHeader $ ahs
44 armorHeader (k, v) = k `B.append` BC8.pack ": " `B.append` v 45 armorHeader (k, v) = k `B.append` BC8.pack ": " `B.append` v
45 46
46opgpStream :: [Packet] -> ByteString 47opgpStream :: [Packet] -> ByteString
47opgpStream = runPut . putPackets 48opgpStream = runPut . put . Block
48 49
49armorData :: ByteString -> ByteString 50armorData :: ByteString -> ByteString
50armorData = BC8.unlines . wrap76 . Base64.encode 51armorData = BC8.unlines . wrap76 . Base64.encode