certificate-1.1.1: Certificates and Key Reader/Writer

Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellSafe-Infered

Data.Certificate.X509

Contents

Description

Read/Write X509 certificate

Synopsis

Data Structure

data X509 Source

Constructors

X509 

Fields

x509Cert :: Certificate

the certificate part of a X509 structure

x509CachedSigningData :: Maybe ByteString

a cache of the raw representation of the x509 part for signing since encoding+decoding might not result in the same data being signed.

x509CachedData :: Maybe ByteString

a cache of the raw representation of the whole x509.

x509SignatureALG :: SignatureALG

the signature algorithm used.

x509Signature :: [Word8]

the signature.

Instances

Data Structure (reexported from X509Cert)

data PubKey Source

Constructors

PubKeyRSA PublicKey

RSA public key

PubKeyDSA PublicKey

DSA public key

PubKeyDH (Integer, Integer, Integer, Maybe Integer, ([Word8], Integer))

DH format with (p,g,q,j,(seed,pgenCounter))

PubKeyECDSA [ASN1]

ECDSA format not done yet FIXME

PubKeyUnknown OID [Word8]

unrecognized format

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 [ExtensionRaw]

Certificate Extensions

helper for signing/veryfing certificate

getSigningData :: X509 -> ByteStringSource

get signing data related to a X509 message, - which is either the cached data or the encoded certificate

serialization from ASN1 bytestring

decodeCertificate :: ByteString -> Either String X509Source

decode an X509 from a bytestring - the structure is the following: - Certificate - Certificate Signature Algorithm - Certificate Signature

encodeCertificate :: X509 -> ByteStringSource

encode a X509 certificate to a bytestring