asn1-parse-0.8.0: Simple monadic parser for ASN1 stream types.

Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellNone

Data.ASN1.Parse

Description

 

Synopsis

Documentation

runParseASN1State :: ParseASN1 a -> [ASN1] -> Either String (a, [ASN1])Source

run the parse monad over a stream and returns the result and the remaining ASN1 Stream.

runParseASN1 :: ParseASN1 a -> [ASN1] -> Either String aSource

run the parse monad over a stream and returns the result.

onNextContainer :: ASN1ConstructionType -> ParseASN1 a -> ParseASN1 aSource

run a function of the next elements of a container of specified type

onNextContainerMaybe :: ASN1ConstructionType -> ParseASN1 a -> ParseASN1 (Maybe a)Source

just like onNextContainer, except it doens't throw an error if the container doesn't exists.

getNextContainer :: ASN1ConstructionType -> ParseASN1 [ASN1]Source

get next container of specified type and return all its elements

getNextContainerMaybe :: ASN1ConstructionType -> ParseASN1 (Maybe [ASN1])Source

just like getNextContainer, except it doesn't throw an error if the container doesn't exists.

getNext :: ParseASN1 ASN1Source

get next element from the stream

getNextMaybe :: (ASN1 -> Maybe a) -> ParseASN1 (Maybe a)Source

get next element from the stream maybe

hasNext :: ParseASN1 BoolSource

returns if there's more elements in the stream.

getObject :: ASN1Object a => ParseASN1 aSource

get next object

getMany :: ParseASN1 a -> ParseASN1 [a]Source

get many elements until there's nothing left