PEM format writer/reader in haskell