| Portability | unknown |
|---|---|
| Stability | experimental |
| Maintainer | Vincent Hanquez <vincent@snarc.org> |
Data.Certificate.X509
Contents
Description
Read/Write X509 certificate
- data SignatureALG
- data PubKeyALG
- = PubKeyALG_RSA
- | PubKeyALG_DSA
- | PubKeyALG_ECDSA
- | PubKeyALG_Unknown OID
- data PubKeyDesc
- data PubKey = PubKey PubKeyALG PubKeyDesc
- data Certificate = Certificate {
- certVersion :: Int
- certSerial :: Integer
- certSignatureAlg :: SignatureALG
- certIssuerDN :: [(OID, ASN1String)]
- certSubjectDN :: [(OID, ASN1String)]
- certValidity :: (Time, Time)
- certPubKey :: PubKey
- certExtensions :: Maybe CertificateExts
- certSignature :: Maybe (SignatureALG, [Word8])
- certOthers :: [ASN1]
- data ASN1StringType
- type ASN1String = (ASN1StringType, Text)
- oidCommonName :: OID
- oidCountry :: OID
- oidOrganization :: OID
- oidOrganizationUnit :: OID
- decodeCertificate :: ByteString -> Either String Certificate
- encodeCertificate :: Certificate -> ByteString
Data Structure
data SignatureALG Source
Constructors
| SignatureALG_md5WithRSAEncryption | |
| SignatureALG_md2WithRSAEncryption | |
| SignatureALG_sha1WithRSAEncryption | |
| SignatureALG_dsaWithSHA1 | |
| SignatureALG_ecdsaWithSHA384 | |
| SignatureALG_Unknown OID |
Instances
Constructors
| PubKeyALG_RSA | |
| PubKeyALG_DSA | |
| PubKeyALG_ECDSA | |
| PubKeyALG_Unknown OID |
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 |
Instances
data Certificate Source
Constructors
| Certificate | |
Fields
| |
Instances
data ASN1StringType Source
Instances
type ASN1String = (ASN1StringType, Text)Source
some common OIDs found in certificate Distinguish Names
oidCommonName :: OIDSource
oidCountry :: OIDSource
oidOrganization :: OIDSource
oidOrganizationUnit :: OIDSource
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