asn1-data-0.7.1: ASN1 data reader and writer in RAW, BER and DER forms

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

Data.ASN1.Parse

Description

 

Synopsis

Documentation

data ParseASN1 a

Parse ASN1 Monad

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

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

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

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

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

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

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

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

getNextContainer :: ASN1ConstructionType -> ParseASN1 [ASN1]

get next container of specified type and return all its elements

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

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

getNext :: ParseASN1 ASN1

get next element from the stream

hasNext :: ParseASN1 Bool

returns if there's more elements in the stream.