x509 1.4.13 → 1.5.0
raw patch · 7 files changed
+31/−18 lines, 7 filesdep +hourglassdep ~asn1-encodingdep ~asn1-parsedep ~asn1-types
Dependencies added: hourglass
Dependency ranges changed: asn1-encoding, asn1-parse, asn1-types
Files
- Data/X509/CRL.hs +4/−5
- Data/X509/Cert.hs +3/−4
- Data/X509/DistinguishedName.hs +0/−1
- Data/X509/Ext.hs +1/−1
- Data/X509/Internal.hs +16/−0
- Data/X509/PublicKey.hs +2/−2
- x509.cabal +5/−5
Data/X509/CRL.hs view
@@ -17,9 +17,8 @@ ) where import Control.Applicative-import Control.Monad.Error -import Data.Time.Clock (UTCTime)+import Data.Hourglass (DateTime) import Data.ASN1.Types import Data.X509.DistinguishedName@@ -32,8 +31,8 @@ { crlVersion :: Integer , crlSignatureAlg :: SignatureALG , crlIssuer :: DistinguishedName- , crlThisUpdate :: UTCTime- , crlNextUpdate :: Maybe UTCTime+ , crlThisUpdate :: DateTime+ , crlNextUpdate :: Maybe DateTime , crlRevokedCertificates :: [RevokedCertificate] , crlExtensions :: Extensions } deriving (Show,Eq)@@ -41,7 +40,7 @@ -- | Describe a revoked certificate identifiable by serial number. data RevokedCertificate = RevokedCertificate { revokedSerialNumber :: Integer- , revokedDate :: UTCTime+ , revokedDate :: DateTime , revokedExtensions :: Extensions } deriving (Show,Eq)
Data/X509/Cert.hs view
@@ -12,9 +12,8 @@ module Data.X509.Cert (Certificate(..)) where import Data.ASN1.Types-import Data.Time.Clock (UTCTime)+import Data.Hourglass (DateTime) import Control.Applicative ((<$>), (<*>))-import Control.Monad.Error import Data.X509.Internal import Data.X509.PublicKey import Data.X509.AlgorithmIdentifier@@ -42,7 +41,7 @@ , certSerial :: Integer -- ^ Serial number , certSignatureAlg :: SignatureALG -- ^ Signature algorithm , certIssuerDN :: DistinguishedName -- ^ Issuer DN- , certValidity :: (UTCTime, UTCTime) -- ^ Validity period+ , certValidity :: (DateTime, DateTime) -- ^ Validity period , certSubjectDN :: DistinguishedName -- ^ Subject DN , certPubKey :: PubKey -- ^ Public key , certExtensions :: Extensions -- ^ Extensions@@ -65,7 +64,7 @@ IntVal v -> return v _ -> throwError ("missing serial" ++ show n) -parseCertHeaderValidity :: ParseASN1 (UTCTime, UTCTime)+parseCertHeaderValidity :: ParseASN1 (DateTime, DateTime) parseCertHeaderValidity = getNextContainer Sequence >>= toTimeBound where toTimeBound [ ASN1Time _ t1 _, ASN1Time _ t2 _ ] = return (t1,t2) toTimeBound _ = throwError "bad validity format"
Data/X509/DistinguishedName.hs view
@@ -19,7 +19,6 @@ import Data.Monoid import Data.ASN1.Types import Data.X509.Internal-import Control.Monad.Error -- | A list of OID and strings. newtype DistinguishedName = DistinguishedName { getDistinguishedElements :: [(OID, ASN1CharacterString)] }
Data/X509/Ext.hs view
@@ -39,8 +39,8 @@ import Data.List (find) import Data.X509.ExtensionRaw import Data.X509.DistinguishedName+import Data.X509.Internal import Control.Applicative-import Control.Monad.Error -- | key usage flag that is found in the key usage extension field. data ExtKeyUsageFlag =
Data/X509/Internal.hs view
@@ -5,14 +5,30 @@ -- Stability : experimental -- Portability : unknown --+{-# LANGUAGE CPP #-} module Data.X509.Internal ( module Data.ASN1.Parse , asn1Container , OID+ -- * error handling+ , ErrT+ , runErrT+ , throwError ) where import Data.ASN1.Types import Data.ASN1.Parse++#if MIN_VERSION_mtl(2,2,1)+import Control.Monad.Except+runErrT :: ExceptT e m a -> m (Either e a)+runErrT = runExceptT+type ErrT = ExceptT+#else+import Control.Monad.Error+runErrT = runErrorT+type ErrT = ErrorT+#endif -- | create a container around the stream of ASN1 asn1Container :: ASN1ConstructionType -> [ASN1] -> [ASN1]
Data/X509/PublicKey.hs view
@@ -80,8 +80,8 @@ Right (r, xsinner) -> Right (r, xsinner ++ xs2) toPubKeyRSA = either Left (\(rsaKey, r) -> Right (PubKeyRSA rsaKey, r)) - removeNull (Null:xs) = xs- removeNull l = l+ removeNull (Null:r) = r+ removeNull l = l fromASN1 l = Left ("fromASN1: X509.PubKey: unknown format:" ++ show l) toASN1 a = \xs -> encodePK a ++ xs
x509.cabal view
@@ -1,5 +1,5 @@ Name: x509-Version: 1.4.13+Version: 1.5.0 Description: X509 reader and writer License: BSD3 License-file: LICENSE@@ -21,11 +21,11 @@ , directory , filepath , process- , time+ , hourglass , pem >= 0.1 && < 0.3- , asn1-types >= 0.2.3 && < 0.3- , asn1-encoding >= 0.8 && < 0.9- , asn1-parse >= 0.8 && < 0.9+ , asn1-types >= 0.3.0 && < 0.4+ , asn1-encoding >= 0.9 && < 0.10+ , asn1-parse >= 0.9 && < 0.10 , crypto-pubkey-types >= 0.4.2.1 && < 0.5 , cryptohash >= 0.9 && < 0.12 Exposed-modules: Data.X509