Data.PEM

pem-0.2.4: Privacy Enhanced Mail (PEM) format reader and writer.

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell98

Data.PEM

Description

Read and write PEM files

Synopsis

- data PEM = PEM {
  - pemName :: String
  - pemHeader :: [(String, ByteString)]
  - pemContent :: ByteString
  }
- pemWriteLBS :: PEM -> ByteString
- pemWriteBS :: PEM -> ByteString
- pemParseBS :: ByteString -> Either String [PEM]
- pemParseLBS :: ByteString -> Either String [PEM]

# Documentation

data PEM #

Represent one PEM section

for now headers are not serialized at all. this is just available here as a placeholder for a later implementation.

Constructors

PEM |
Fields pemName :: String the name of the section, found after the dash BEGIN tag. pemHeader :: [(String, ByteString)] optionals key value pair header pemContent :: ByteString binary content of the section

#### Instances

Instances details

NormalForm PEM # |
Instance details Defined in Data.PEM.Types Methods toNormalForm :: PEM -> () #
Show PEM # |
Instance details Defined in Data.PEM.Types Methods showsPrec :: Int -> PEM -> ShowS # show :: PEM -> String # showList :: [PEM] -> ShowS #
Eq PEM # |
Instance details Defined in Data.PEM.Types Methods (==) :: PEM -> PEM -> Bool # (/=) :: PEM -> PEM -> Bool #

pemWriteLBS :: PEM -> ByteString #

convert a PEM structure to a lazy bytestring

pemWriteBS :: PEM -> ByteString #

convert a PEM structure to a bytestring

pemParseBS :: ByteString -> Either String [PEM] #

parse a PEM content using a strict bytestring

pemParseLBS :: ByteString -> Either String [PEM] #

parse a PEM content using a dynamic bytestring