HsOpenSSL-0.3: (Part of) OpenSSL binding for HaskellContentsIndex
OpenSSL.PEM
Contents
Password supply
Private key
Public key
X.509 certificate
PKCS#10 certificate request
Certificate Revocation List
PKCS#7 structure
Description
An interface to PEM routines.
Synopsis
type PemPasswordCallback = Int -> PemPasswordRWState -> IO String
data PemPasswordRWState
= PwRead
| PwWrite
data PemPasswordSupply
= PwNone
| PwStr String
| PwCallback PemPasswordCallback
| PwTTY
writePKCS8PrivateKey :: PKey -> Maybe (Cipher, PemPasswordSupply) -> IO String
readPrivateKey :: String -> PemPasswordSupply -> IO PKey
writePublicKey :: PKey -> IO String
readPublicKey :: String -> IO PKey
writeX509 :: X509 -> IO String
readX509 :: String -> IO X509
data PemX509ReqFormat
= ReqNewFormat
| ReqOldFormat
writeX509Req :: X509Req -> PemX509ReqFormat -> IO String
readX509Req :: String -> IO X509Req
writeCRL :: CRL -> IO String
readCRL :: String -> IO CRL
writePkcs7 :: Pkcs7 -> IO String
readPkcs7 :: String -> IO Pkcs7
Password supply
type PemPasswordCallback
 = Intmaximum length of the password to be accepted
-> PemPasswordRWStatecontext
-> IO Stringthe result password
PemPasswordCallback represents a callback function to supply a password.
data PemPasswordRWState
PemPasswordRWState represents a context of PemPasswordCallback.
Constructors
PwReadThe callback was called to get a password to read something encrypted.
PwWriteThe callback was called to get a password to encrypt something.
data PemPasswordSupply

PemPasswordSupply represents a way to supply password.

FIXME: using PwTTY causes an error but I don't know why: "error:0906406D:PEM routines:DEF_CALLBACK:problems getting password"

Constructors
PwNoneno password
PwStr Stringpassword in a static string
PwCallback PemPasswordCallbackget a password by a callback
PwTTYread a password from TTY
Private key
writePKCS8PrivateKey
:: PKeyprivate key to write
-> Maybe (Cipher, PemPasswordSupply)Either (symmetric cipher algorithm, password supply) or Nothing. If Nothing is given the private key is not encrypted.
-> IO Stringthe result PEM string
writePKCS8PrivateKey writes a private key to PEM string in PKCS#8 format.
readPrivateKey :: String -> PemPasswordSupply -> IO PKey
readPrivateKey pem supply reads a private key in PEM string.
Public key
writePublicKey :: PKey -> IO String
writePublicKey pubkey writes a public to PEM string.
readPublicKey :: String -> IO PKey
readPublicKey pem reads a public key in PEM string.
X.509 certificate
writeX509 :: X509 -> IO String
writeX509 cert writes an X.509 certificate to PEM string.
readX509 :: String -> IO X509
readX509 pem reads an X.509 certificate in PEM string.
PKCS#10 certificate request
data PemX509ReqFormat
PemX509ReqFormat represents format of PKCS#10 certificate request.
Constructors
ReqNewFormatThe new format, whose header is "NEW CERTIFICATE REQUEST".
ReqOldFormatThe old format, whose header is "CERTIFICATE REQUEST".
writeX509Req
:: X509Reqrequest
-> PemX509ReqFormatformat
-> IO Stringthe result PEM string
writeX509Req writes a PKCS#10 certificate request to PEM string.
readX509Req :: String -> IO X509Req
readX509Req reads a PKCS#10 certificate request in PEM string.
Certificate Revocation List
writeCRL :: CRL -> IO String
writeCRL crl writes a Certificate Revocation List to PEM string.
readCRL :: String -> IO CRL
readCRL pem reads a Certificate Revocation List in PEM string.
PKCS#7 structure
writePkcs7 :: Pkcs7 -> IO String
writePkcs7 p7 writes a PKCS#7 structure to PEM string.
readPkcs7 :: String -> IO Pkcs7
readPkcs7 pem reads a PKCS#7 structure in PEM string.
Produced by Haddock version 0.8