-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | ASN1 data reader/writer in RAW/BER/DER/CER forms -- -- ASN1 data readerwriter in raw form with supports for high level -- forms of ASN1 (BERCER/DER) @package asn1-data @version 0.2 -- | A module containing raw ASN1 serialization/derialization tools module Data.ASN1.Raw data GetErr a runGetErr :: GetErr a -> ByteString -> Either ASN1Err a runGetErrInGet :: GetErr a -> Get (Either ASN1Err a) data ASN1Err ASN1LengthDecodingLongContainsZero :: ASN1Err ASN1PolicyFailed :: String -> String -> ASN1Err ASN1NotImplemented :: String -> ASN1Err ASN1Multiple :: [ASN1Err] -> ASN1Err ASN1Misc :: String -> ASN1Err type CheckFn = (TagClass, Bool, TagNumber) -> ValLength -> Maybe ASN1Err data TagClass Universal :: TagClass Application :: TagClass Context :: TagClass Private :: TagClass type TagNumber = Int data ValLength -- | Short form with only one byte. length has to be < 127. LenShort :: Int -> ValLength -- | Long form of N bytes LenLong :: Int -> Int -> ValLength -- | Length is indefinite expect an EOC in the stream to finish the type LenIndefinite :: ValLength data ValStruct -- | Primitive of a strict value Primitive :: ByteString -> ValStruct -- | Constructed of a list of values Constructed :: [Value] -> ValStruct data Value Value :: TagClass -> TagNumber -> ValStruct -> Value -- | getValueCheck decode an ASN1 value and check the values received -- through the check fn getValueCheck :: CheckFn -> GetErr Value getValue :: GetErr Value putValuePolicy :: (Value -> Int -> ValLength) -> Value -> Put -- | putValue encode an ASN1 value using the shortest definite length putValue :: Value -> Put instance Monad GetErr instance MonadError ASN1Err GetErr instance Show ASN1Err instance Eq ASN1Err instance Show Value instance Eq Value instance Show ValStruct instance Eq ValStruct instance Show ValLength instance Eq ValLength instance Show TagClass instance Eq TagClass instance Functor GetErr instance Error ASN1Err -- | A module containing ASN1 BER specification serialization/derialization -- tools module Data.ASN1.BER data TagClass Universal :: TagClass Application :: TagClass Context :: TagClass Private :: TagClass data ASN1 EOC :: ASN1 Boolean :: Bool -> ASN1 IntVal :: Integer -> ASN1 BitString :: Int -> ByteString -> ASN1 OctetString :: ByteString -> ASN1 Null :: ASN1 OID :: [Integer] -> ASN1 Real :: Double -> ASN1 Enumerated :: ASN1 UTF8String :: ByteString -> ASN1 Sequence :: [ASN1] -> ASN1 Set :: [ASN1] -> ASN1 NumericString :: ByteString -> ASN1 PrintableString :: ByteString -> ASN1 T61String :: ByteString -> ASN1 VideoTexString :: ByteString -> ASN1 IA5String :: ByteString -> ASN1 UTCTime :: (Int, Int, Int, Int, Int, Int, Bool) -> ASN1 GeneralizedTime :: (Int, Int, Int, Int, Int, Int, Bool) -> ASN1 GraphicString :: ByteString -> ASN1 VisibleString :: ByteString -> ASN1 GeneralString :: ByteString -> ASN1 UniversalString :: ByteString -> ASN1 CharacterString :: ByteString -> ASN1 BMPString :: ByteString -> ASN1 Other :: TagClass -> TagNumber -> (Either ByteString [ASN1]) -> ASN1 ofRaw :: Value -> Either ASN1Err ASN1 toRaw :: ASN1 -> Value decodeASN1Get :: Get (Either ASN1Err ASN1) decodeASN1 :: ByteString -> Either ASN1Err ASN1 encodeASN1Put :: ASN1 -> Put encodeASN1 :: ASN1 -> ByteString -- | A module containing ASN1 CER specification serialization/derialization -- tools module Data.ASN1.CER data TagClass Universal :: TagClass Application :: TagClass Context :: TagClass Private :: TagClass data ASN1 EOC :: ASN1 Boolean :: Bool -> ASN1 IntVal :: Integer -> ASN1 BitString :: Int -> ByteString -> ASN1 OctetString :: ByteString -> ASN1 Null :: ASN1 OID :: [Integer] -> ASN1 Real :: Double -> ASN1 Enumerated :: ASN1 UTF8String :: ByteString -> ASN1 Sequence :: [ASN1] -> ASN1 Set :: [ASN1] -> ASN1 NumericString :: ByteString -> ASN1 PrintableString :: ByteString -> ASN1 T61String :: ByteString -> ASN1 VideoTexString :: ByteString -> ASN1 IA5String :: ByteString -> ASN1 UTCTime :: (Int, Int, Int, Int, Int, Int, Bool) -> ASN1 GeneralizedTime :: (Int, Int, Int, Int, Int, Int, Bool) -> ASN1 GraphicString :: ByteString -> ASN1 VisibleString :: ByteString -> ASN1 GeneralString :: ByteString -> ASN1 UniversalString :: ByteString -> ASN1 CharacterString :: ByteString -> ASN1 BMPString :: ByteString -> ASN1 Other :: TagClass -> TagNumber -> (Either ByteString [ASN1]) -> ASN1 decodeASN1Get :: Get (Either ASN1Err ASN1) decodeASN1 :: ByteString -> Either ASN1Err ASN1 encodeASN1Put :: ASN1 -> Put encodeASN1 :: ASN1 -> ByteString -- | A module containing ASN1 DER specification serialization/derialization -- tools module Data.ASN1.DER data TagClass Universal :: TagClass Application :: TagClass Context :: TagClass Private :: TagClass data ASN1 EOC :: ASN1 Boolean :: Bool -> ASN1 IntVal :: Integer -> ASN1 BitString :: Int -> ByteString -> ASN1 OctetString :: ByteString -> ASN1 Null :: ASN1 OID :: [Integer] -> ASN1 Real :: Double -> ASN1 Enumerated :: ASN1 UTF8String :: ByteString -> ASN1 Sequence :: [ASN1] -> ASN1 Set :: [ASN1] -> ASN1 NumericString :: ByteString -> ASN1 PrintableString :: ByteString -> ASN1 T61String :: ByteString -> ASN1 VideoTexString :: ByteString -> ASN1 IA5String :: ByteString -> ASN1 UTCTime :: (Int, Int, Int, Int, Int, Int, Bool) -> ASN1 GeneralizedTime :: (Int, Int, Int, Int, Int, Int, Bool) -> ASN1 GraphicString :: ByteString -> ASN1 VisibleString :: ByteString -> ASN1 GeneralString :: ByteString -> ASN1 UniversalString :: ByteString -> ASN1 CharacterString :: ByteString -> ASN1 BMPString :: ByteString -> ASN1 Other :: TagClass -> TagNumber -> (Either ByteString [ASN1]) -> ASN1 decodeASN1Get :: Get (Either ASN1Err ASN1) decodeASN1 :: ByteString -> Either ASN1Err ASN1 encodeASN1Put :: ASN1 -> Put encodeASN1 :: ASN1 -> ByteString