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.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs b/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
index 99d4d54..28bb3e6 100644
--- a/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
+++ b/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
@@ -17,22 +17,22 @@ 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 20encode :: [Armor] -> ByteString
21encode = B.concat . map armor 21encode = B.concat . map armor
22 22
23armor :: (Integral a, Show a) => Armor a -> ByteString 23armor :: 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 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
25 25
26blankLine :: ByteString 26blankLine :: ByteString
27blankLine = BC8.singleton '\n' 27blankLine = BC8.singleton '\n'
28 28
29beginLine :: (Integral a, Show a) => ArmorType a -> ByteString 29beginLine :: ArmorType -> ByteString
30beginLine atype = BC8.pack "-----BEGIN PGP " `B.append` aType atype `B.append` BC8.pack "-----\n" 30beginLine atype = BC8.pack "-----BEGIN PGP " `B.append` aType atype `B.append` BC8.pack "-----\n"
31 31
32endLine :: (Integral a, Show a) => ArmorType a -> ByteString 32endLine :: ArmorType -> ByteString
33endLine atype = BC8.pack "-----END PGP " `B.append` aType atype `B.append` BC8.pack "-----\n" 33endLine atype = BC8.pack "-----END PGP " `B.append` aType atype `B.append` BC8.pack "-----\n"
34 34
35aType :: (Integral a, Show a) => ArmorType a -> ByteString 35aType :: ArmorType -> ByteString
36aType (ArmorMessage) = BC8.pack "MESSAGE" 36aType (ArmorMessage) = BC8.pack "MESSAGE"
37aType (ArmorPublicKeyBlock) = BC8.pack "PUBLIC KEY BLOCK" 37aType (ArmorPublicKeyBlock) = BC8.pack "PUBLIC KEY BLOCK"
38aType (ArmorPrivateKeyBlock) = BC8.pack "PRIVATE KEY BLOCK" 38aType (ArmorPrivateKeyBlock) = BC8.pack "PRIVATE KEY BLOCK"