crypton-asn1-types-0.3.6: ASN.1 types
Copyright(c) 2010-2013 Vincent Hanquez <vincent@snarc.org>
LicenseBSD-style
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell98

Data.ASN1.Stream

Contents

Description

 
Synopsis

Documentation

type ASN1Repr = (ASN1, [ASN1Event]) Source #

Type synonym representing pairs of a ASN.1 value and a list of ASN.1 events.

This association is sometimes needed in order to know the exact byte sequence leading to an ASN.1 value. For example, in the case of a cryptographic signature.

Utilities

getConstructedEnd Source #

Arguments

:: Int

The number of additional Start values encountered, 0 initially.

-> [ASN1] 
-> ([ASN1], [ASN1]) 

For the given list of ASN.1 values, assumed to follow a Start value:

If the list is empty, return a pair of empty lists.

Otherwise, return a list of values up to (but excluding) the corresponding End value (if any), and a list of the remaining ASN.1 values.

getConstructedEndRepr :: [ASN1Repr] -> ([ASN1Repr], [ASN1Repr]) Source #

For the given list of ASN1Repr pairs:

If the list is empty, return a pair of empty lists.

If the first item represents a Start value, return a list of pairs up to the corresponding End value (if any) (including the Start and any End) and a list of the remaining ASN1Repr pairs.

Otherwise, return a list of that first item and a list of the remaining pairs.