-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Certificates and Key Reader/Writer -- -- Certificates and Key reader/writer -- -- At the moment only X509 certificate and unencrypted private key are -- supported, but will include PGP certificate and pkcs8 private keys @package certificate @version 0.4.0 -- | Read/Write Private Key module Data.Certificate.Key data PrivateKey PrivateKey :: Int -> Int -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> PrivateKey privKey_version :: PrivateKey -> Int privKey_lenmodulus :: PrivateKey -> Int privKey_modulus :: PrivateKey -> Integer privKey_public_exponant :: PrivateKey -> Integer privKey_private_exponant :: PrivateKey -> Integer privKey_p1 :: PrivateKey -> Integer privKey_p2 :: PrivateKey -> Integer privKey_exp1 :: PrivateKey -> Integer privKey_exp2 :: PrivateKey -> Integer privKey_coef :: PrivateKey -> Integer decodePrivateKey :: ByteString -> Either String PrivateKey encodePrivateKey :: PrivateKey -> ByteString -- | Read PEM files module Data.Certificate.PEM parsePEMCert :: ByteString -> Maybe ByteString parsePEMCertReq :: ByteString -> Maybe ByteString parsePEMKey :: ByteString -> Maybe ByteString parsePEMKeyRSA :: ByteString -> Maybe ByteString parsePEMKeyDSA :: ByteString -> Maybe ByteString parsePEMs :: ByteString -> [PEM] -- | Read/Write X509 certificate module Data.Certificate.X509 data SignatureALG SignatureALG_md5WithRSAEncryption :: SignatureALG SignatureALG_md2WithRSAEncryption :: SignatureALG SignatureALG_sha1WithRSAEncryption :: SignatureALG SignatureALG_dsaWithSHA1 :: SignatureALG SignatureALG_ecdsaWithSHA384 :: SignatureALG SignatureALG_Unknown :: OID -> SignatureALG data PubKeyALG PubKeyALG_RSA :: PubKeyALG PubKeyALG_DSA :: PubKeyALG PubKeyALG_ECDSA :: PubKeyALG PubKeyALG_Unknown :: OID -> PubKeyALG data PubKeyDesc -- | RSA format with (len modulus, modulus, e) PubKeyRSA :: (Int, Integer, Integer) -> PubKeyDesc -- | DSA format with (pub, p, q, g) PubKeyDSA :: (Integer, Integer, Integer, Integer) -> PubKeyDesc -- | ECDSA format not done yet FIXME PubKeyECDSA :: ASN1 -> PubKeyDesc -- | unrecognized format PubKeyUnknown :: [Word8] -> PubKeyDesc data PubKey PubKey :: PubKeyALG -> PubKeyDesc -> PubKey data Certificate Certificate :: Int -> Integer -> SignatureALG -> [(OID, ASN1String)] -> [(OID, ASN1String)] -> (Time, Time) -> PubKey -> Maybe CertificateExts -> Maybe (SignatureALG, [Word8]) -> [ASN1] -> Certificate -- | Certificate Version certVersion :: Certificate -> Int -- | Certificate Serial number certSerial :: Certificate -> Integer -- | Certificate Signature algorithm certSignatureAlg :: Certificate -> SignatureALG -- | Certificate Issuer DN certIssuerDN :: Certificate -> [(OID, ASN1String)] -- | Certificate Subject DN certSubjectDN :: Certificate -> [(OID, ASN1String)] -- | Certificate Validity period certValidity :: Certificate -> (Time, Time) -- | Certificate Public key certPubKey :: Certificate -> PubKey -- | Certificate Extensions certExtensions :: Certificate -> Maybe CertificateExts -- | Certificate Signature Algorithm and Signature certSignature :: Certificate -> Maybe (SignatureALG, [Word8]) -- | any others fields not parsed certOthers :: Certificate -> [ASN1] data ASN1StringType UTF8 :: ASN1StringType Printable :: ASN1StringType Univ :: ASN1StringType BMP :: ASN1StringType IA5 :: ASN1StringType type ASN1String = (ASN1StringType, Text) oidCommonName :: OID oidCountry :: OID oidOrganization :: OID oidOrganizationUnit :: OID -- | decode a X509 certificate from a bytestring decodeCertificate :: ByteString -> Either String Certificate -- | encode a X509 certificate to a bytestring encodeCertificate :: Certificate -> ByteString instance Monad ParseCert instance MonadError String ParseCert instance Show Certificate instance Eq Certificate instance Show ASN1StringType instance Eq ASN1StringType instance Show CertificateExts instance Eq CertificateExts instance Show CertKeyUsage instance Eq CertKeyUsage instance Show PubKey instance Eq PubKey instance Show PubKeyDesc instance Eq PubKeyDesc instance Show PubKeyALG instance Eq PubKeyALG instance Show SignatureALG instance Eq SignatureALG