Certificate and Key Reader/Writer in haskell