certificate-0.3: 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)

PubKeyUnknown [Word8]

unrecognized format

data PubKey Source

Constructors

PubKey SignatureALG PubKeyDesc 

Instances

data CertificateDN Source

Constructors

CertificateDN 

Fields

cdnCommonName :: Maybe String

Certificate DN Common Name

cdnCountry :: Maybe String

Certificate DN Country of Issuance

cdnOrganization :: Maybe String

Certificate DN Organization

cdnOrganizationUnit :: Maybe String

Certificate DN Organization Unit

cdnOthers :: [(OID, String)]

Certificate DN Other Attributes

data Certificate Source

Constructors

Certificate 

Fields

certVersion :: Int

Certificate Version

certSerial :: Integer

Certificate Serial number

certSignatureAlg :: SignatureALG

Certificate Signature algorithm

certIssuerDN :: CertificateDN

Certificate Issuer DN

certSubjectDN :: CertificateDN

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

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