- data SignatureALG
- data PubKeyALG
- = PubKeyALG_RSA
- | PubKeyALG_DSA
- | PubKeyALG_ECDSA
- | PubKeyALG_DH
- | PubKeyALG_Unknown OID
- data PubKey
- data ASN1StringType
- type ASN1String = (ASN1StringType, String)
- data Certificate = Certificate {
- certVersion :: Int
- certSerial :: Integer
- certSignatureAlg :: SignatureALG
- certIssuerDN :: [(OID, ASN1String)]
- certSubjectDN :: [(OID, ASN1String)]
- certValidity :: (Time, Time)
- certPubKey :: PubKey
- certExtensions :: Maybe CertificateExts
- data CertificateExts = CertificateExts {
- certExtKeyUsage :: Maybe (Bool, [CertKeyUsage])
- certExtBasicConstraints :: Maybe (Bool, Bool)
- certExtSubjectKeyIdentifier :: Maybe (Bool, [Word8])
- certExtPolicies :: Maybe Bool
- certExtOthers :: [(OID, Bool, [ASN1])]
- oidCommonName :: OID
- oidCountry :: OID
- oidOrganization :: OID
- oidOrganizationUnit :: OID
- oidSig :: OID -> SignatureALG
- sigOID :: SignatureALG -> OID
- parseCertificate :: ParseASN1 Certificate
- encodeCertificateHeader :: Certificate -> [ASN1]
Data Structure
data SignatureALG Source
PubKeyRSA (Int, Integer, Integer) | RSA format with (len modulus, modulus, e) |
PubKeyDSA (Integer, Integer, Integer, Integer) | DSA format with (pub, p, q, g) |
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 |
type ASN1String = (ASN1StringType, String)Source
data Certificate Source
Certificate | |
|
data CertificateExts Source
CertificateExts | |
|
oidCommonName :: OIDSource
oidCountry :: OIDSource
oidOrganization :: OIDSource
oidOrganizationUnit :: OIDSource
oidSig :: OID -> SignatureALGSource
sigOID :: SignatureALG -> OIDSource
certificate to/from asn1
parseCertificate :: ParseASN1 CertificateSource
parse header structure of a x509 certificate. the structure the following: Version Serial Number Algorithm ID Issuer Validity Not Before Not After Subject Subject Public Key Info Public Key Algorithm Subject Public Key Issuer Unique Identifier (Optional) (>= 2) Subject Unique Identifier (Optional) (>= 2) Extensions (Optional) (>= v3)