diff options
Diffstat (limited to 'PEM.hs')
-rw-r--r-- | PEM.hs | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,7 +1,6 @@ | |||
1 | {-# LANGUAGE OverloadedStrings #-} | 1 | {-# LANGUAGE OverloadedStrings #-} |
2 | module PEM where | 2 | module PEM where |
3 | 3 | ||
4 | import Data.Maybe | ||
5 | import Data.Monoid | 4 | import Data.Monoid |
6 | import qualified Data.ByteString.Lazy as LW | 5 | import qualified Data.ByteString.Lazy as LW |
7 | import qualified Data.ByteString.Lazy.Char8 as L | 6 | import qualified Data.ByteString.Lazy.Char8 as L |
@@ -30,5 +29,5 @@ pemParser mtyp = ScanningParser (maybe fndany fndtyp mtyp) pbdy | |||
30 | (ys,rs) = span (/="-----END " <> typ <> "-----") xs | 29 | (ys,rs) = span (/="-----END " <> typ <> "-----") xs |
31 | mblob = PEMBlob typ <$> LW.pack <$> Base64.decode (L.unpack dta) | 30 | mblob = PEMBlob typ <$> LW.pack <$> Base64.decode (L.unpack dta) |
32 | dta = case ys of | 31 | dta = case ys of |
33 | _:dta_lines -> L.concat dta_lines | 32 | [] -> "" |
34 | [] -> "" | 33 | dta_lines -> L.concat dta_lines |