certificate-1.3.9: Certificates and Key Reader/Writer

Safe Haskell | None

Data.Certificate.X509.Cert

Contents

- Data Structure
- Parse and encode a single distinguished name
- extensions

Synopsis

- data SignatureALG
  - = SignatureALG HashALG PubKeyALG
  - | SignatureALG_Unknown OID
- data HashALG
  - = HashMD2
  - | HashMD5
  - | HashSHA1
  - | HashSHA224
  - | HashSHA256
  - | HashSHA384
  - | HashSHA512
- data PubKeyALG
  - = PubKeyALG_RSA
  - | PubKeyALG_DSA
  - | PubKeyALG_ECDSA
  - | PubKeyALG_DH
  - | PubKeyALG_Unknown OID
- data PubKey
  - = PubKeyRSA PublicKey
  - | PubKeyDSA PublicKey
  - | PubKeyDH (Integer, Integer, Integer, Maybe Integer, ([Word8], Integer))
  - | PubKeyECDSA ECDSA_Hash ByteString
  - | PubKeyUnknown OID [Word8]
- data ECDSA_Hash = ECDSA_Hash_SHA384
- data ASN1StringType
  - = UTF8
  - | Printable
  - | Univ
  - | BMP
  - | IA5
  - | T61
- type ASN1String = (ASN1StringType, String)
- data Certificate = Certificate {
  - certVersion :: Int
  - certSerial :: Integer
  - certSignatureAlg :: SignatureALG
  - certIssuerDN :: DistinguishedName
  - certSubjectDN :: DistinguishedName
  - certValidity :: (Time, Time)
  - certPubKey :: PubKey
  - certExtensions :: Maybe [ExtensionRaw]
  }
- newtype DistinguishedName = DistinguishedName {
  - getDistinguishedElements :: [(OID, ASN1String)]
  }
- type OID = [Integer]
- oidCommonName :: OID
- oidCountry :: OID
- oidOrganization :: OID
- oidOrganizationUnit :: OID
- oidSig :: OID -> SignatureALG
- sigOID :: SignatureALG -> OID
- parseDN :: ParseASN1 DistinguishedName
- encodeDNinner :: (ASN1String -> ASN1String) -> DistinguishedName -> [ASN1]
- encodeDN :: DistinguishedName -> [ASN1]
- module Data.Certificate.X509.Ext

# Data Structure

data SignatureALG Source

Constructors

SignatureALG HashALG PubKeyALG |
SignatureALG_Unknown OID |

Instances

Eq SignatureALG |
Show SignatureALG |

data HashALG Source

Constructors

HashMD2 |
HashMD5 |
HashSHA1 |
HashSHA224 |
HashSHA256 |
HashSHA384 |
HashSHA512 |

Instances

Eq HashALG |
Show HashALG |

data PubKeyALG Source

Constructors

PubKeyALG_RSA |
PubKeyALG_DSA |
PubKeyALG_ECDSA |
PubKeyALG_DH |
PubKeyALG_Unknown OID |

Instances

Eq PubKeyALG |
Show PubKeyALG |

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 ECDSA_Hash ByteString | ECDSA format not done yet FIXME
PubKeyUnknown OID [Word8] | unrecognized format

Instances

Eq PubKey |
Show PubKey |

data ECDSA_Hash Source

Constructors

ECDSA_Hash_SHA384 |

Instances

Eq ECDSA_Hash |
Show ECDSA_Hash |

data ASN1StringType Source

Constructors

UTF8 |
Printable |
Univ |
BMP |
IA5 |
T61 |

Instances

Enum ASN1StringType |
Eq ASN1StringType |
Ord ASN1StringType |
Show ASN1StringType |

type ASN1String = (ASN1StringType, String)Source

data Certificate Source

Constructors

Certificate |

Fields

certVersion :: Int

  Certificate Version

certSerial :: Integer

  Certificate Serial number

certSignatureAlg :: SignatureALG

  Certificate Signature algorithm

certIssuerDN :: DistinguishedName

  Certificate Issuer DN

certSubjectDN :: DistinguishedName

  Certificate Subject DN

certValidity :: (Time, Time)

  Certificate Validity period

certPubKey :: PubKey

  Certificate Public key

certExtensions :: Maybe [ExtensionRaw]

  Certificate Extensions

Instances

Eq Certificate |
Show Certificate |
ASN1Object Certificate |

newtype DistinguishedName Source

Constructors

DistinguishedName |

Fields

getDistinguishedElements :: [(OID, ASN1String)]

Instances

Eq DistinguishedName |
Ord DistinguishedName |
Show DistinguishedName |
Monoid DistinguishedName |

type OID = [Integer]Source

oidCommonName :: OID Source

oidCountry :: OID Source

oidOrganization :: OID Source

oidOrganizationUnit :: OID Source

oidSig :: OID -> SignatureALG Source

sigOID :: SignatureALG -> OID Source

# Parse and encode a single distinguished name

parseDN :: ParseASN1 DistinguishedName Source

encodeDNinner :: (ASN1String -> ASN1String) -> DistinguishedName -> [ASN1]Source

encodeDN :: DistinguishedName -> [ASN1]Source

# extensions

module Data.Certificate.X509.Ext