1-- |
2-- Module      : Data.X509.Internal
3-- License     : BSD-style
4-- Maintainer  : Vincent Hanquez <vincent@snarc.org>
5-- Stability   : experimental
6-- Portability : unknown
7--
8{-# LANGUAGE CPP #-}
9module Data.X509.Internal
10    ( module Data.ASN1.Parse
11    , asn1Container
12    , OID
13    -- * error handling
14    , ErrT
15    , runErrT
16    ) where
17
18import Data.ASN1.Types
19import Data.ASN1.Parse
20
21#if MIN_VERSION_mtl(2,2,1)
22import Control.Monad.Except
23runErrT :: ExceptT e m a -> m (Either e a)
24runErrT = runExceptT
25type ErrT = ExceptT
26#else
27import Control.Monad.Error
28runErrT :: ErrorT e m a -> m (Either e a)
29runErrT = runErrorT
30type ErrT = ErrorT
31#endif
32
33-- | create a container around the stream of ASN1
34asn1Container :: ASN1ConstructionType -> [ASN1] -> [ASN1]
35asn1Container ty l = [Start ty] ++ l ++ [End ty]
36