certificate-1.3.9: Certificates and Key Reader/Writer

Portability | unknown
Stability | experimental
Maintainer | Vincent Hanquez <vincent@snarc.org>
Safe Haskell | None

Data.Certificate.X509.Ext

Contents

- Common extension usually found in x509v3
- Accessor turning extension into a specific one

Description

extension processing module.

Synopsis

- type ExtensionRaw = (OID, Bool, [ASN1])
- class Extension a where
  - extOID :: a -> OID
  - extEncode :: a -> [ASN1]
  - extDecode :: [ASN1] -> Either String a
- data ExtBasicConstraints = ExtBasicConstraints Bool (Maybe Integer)
- data ExtKeyUsage = ExtKeyUsage [ExtKeyUsageFlag]
- data ExtKeyUsageFlag
  - = KeyUsage_digitalSignature
  - | KeyUsage_nonRepudiation
  - | KeyUsage_keyEncipherment
  - | KeyUsage_dataEncipherment
  - | KeyUsage_keyAgreement
  - | KeyUsage_keyCertSign
  - | KeyUsage_cRLSign
  - | KeyUsage_encipherOnly
  - | KeyUsage_decipherOnly
- data ExtSubjectKeyId = ExtSubjectKeyId ByteString
- data ExtSubjectAltName = ExtSubjectAltName [String]
- data ExtAuthorityKeyId = ExtAuthorityKeyId ByteString
- extensionGet :: Extension a => [ExtensionRaw] -> Maybe a

# Documentation

type ExtensionRaw = (OID, Bool, [ASN1])Source

class Extension a where Source

Methods

extOID :: a -> OID Source

extEncode :: a -> [ASN1]Source

extDecode :: [ASN1] -> Either String aSource

Instances

Extension ExtAuthorityKeyId |
Extension ExtSubjectAltName |
Extension ExtSubjectKeyId |
Extension ExtKeyUsage |
Extension ExtBasicConstraints |

# Common extension usually found in x509v3

data ExtBasicConstraints Source

Constructors

ExtBasicConstraints Bool (Maybe Integer) |

Instances

Eq ExtBasicConstraints |
Show ExtBasicConstraints |
Extension ExtBasicConstraints |

data ExtKeyUsage Source

Constructors

ExtKeyUsage [ExtKeyUsageFlag] |

Instances

Eq ExtKeyUsage |
Show ExtKeyUsage |
Extension ExtKeyUsage |

data ExtKeyUsageFlag Source

key usage flag that is found in the key usage extension field.

Constructors

KeyUsage_digitalSignature |
KeyUsage_nonRepudiation |
KeyUsage_keyEncipherment |
KeyUsage_dataEncipherment |
KeyUsage_keyAgreement |
KeyUsage_keyCertSign |
KeyUsage_cRLSign |
KeyUsage_encipherOnly |
KeyUsage_decipherOnly |

Instances

Enum ExtKeyUsageFlag |
Eq ExtKeyUsageFlag |
Ord ExtKeyUsageFlag |
Show ExtKeyUsageFlag |

data ExtSubjectKeyId Source

Constructors

ExtSubjectKeyId ByteString |

Instances

Eq ExtSubjectKeyId |
Show ExtSubjectKeyId |
Extension ExtSubjectKeyId |

data ExtSubjectAltName Source

Constructors

ExtSubjectAltName [String] |

Instances

Eq ExtSubjectAltName |
Show ExtSubjectAltName |
Extension ExtSubjectAltName |

data ExtAuthorityKeyId Source

Constructors

ExtAuthorityKeyId ByteString |

Instances

Eq ExtAuthorityKeyId |
Show ExtAuthorityKeyId |
Extension ExtAuthorityKeyId |

# Accessor turning extension into a specific one

extensionGet :: Extension a => [ExtensionRaw] -> Maybe aSource