HsOpenSSL is an (incomplete) OpenSSL binding for Haskell. It can
generate RSA and DSA keys, read and write PEM files, generate
message digests, sign and verify messages, encrypt and decrypt
messages. But since OpenSSL is a very large library, it is uneasy
to cover every parts of it.

Documentation

Computation of withOpenSSL action initializes the OpenSSL
library and computes action. Every applications that use
HsOpenSSL must wrap any operations related to OpenSSL with
withOpenSSL, or they might crash.

module Main where
import OpenSSL
main :: IO ()
main = withOpenSSL $
do ...