Portability | unknown |
---|---|
Stability | experimental |
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Read/Write X509 certificate
- data X509 = X509 Certificate (Maybe ByteString) (Maybe ByteString) SignatureALG [Word8]
- 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])]
- getSigningData :: X509 -> ByteString
- decodeCertificate :: ByteString -> Either String X509
- encodeCertificate :: X509 -> ByteString
Data Structure
Data Structure (reexported from X509Cert)
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 | |
|
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