certificate-0.4.0: Certificates and Key Reader/Writer

Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>

Data.Certificate.X509

Contents

Description

Read/Write X509 certificate

Synopsis

Data Structure

data PubKeyDesc Source

Constructors

PubKeyRSA (Int, Integer, Integer)

RSA format with (len modulus, modulus, e)

PubKeyDSA (Integer, Integer, Integer, Integer)

DSA format with (pub, p, q, g)

PubKeyECDSA ASN1

ECDSA format not done yet FIXME

PubKeyUnknown [Word8]

unrecognized format

data PubKey Source

Instances

data Certificate Source

Constructors

Certificate 

Fields

certVersion :: Int

Certificate Version

certSerial :: Integer

Certificate Serial number

certSignatureAlg :: SignatureALG

Certificate Signature algorithm

certIssuerDN :: [(OID, ASN1String)]

Certificate Issuer DN

certSubjectDN :: [(OID, ASN1String)]

Certificate Subject DN

certValidity :: (Time, Time)

Certificate Validity period

certPubKey :: PubKey

Certificate Public key

certExtensions :: Maybe CertificateExts

Certificate Extensions

certSignature :: Maybe (SignatureALG, [Word8])

Certificate Signature Algorithm and Signature

certOthers :: [ASN1]

any others fields not parsed

some common OIDs found in certificate Distinguish Names

serialization from ASN1 bytestring

decodeCertificate :: ByteString -> Either String CertificateSource

decode a X509 certificate from a bytestring

encodeCertificate :: Certificate -> ByteStringSource

encode a X509 certificate to a bytestring