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

Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellSafe-Infered

Data.ASN1.Raw

Contents

Description

A module containing raw ASN1 serialization/derialization tools

Synopsis

ASN1 definitions

data ASN1Length Source

Constructors

LenShort Int

Short form with only one byte. length has to be < 127.

LenLong Int Int

Long form of N bytes

LenIndefinite

Length is indefinite expect an EOC in the stream to finish the type

Enumerator events

data ASN1Event Source

Constructors

Header ASN1Header

ASN1 Header

Primitive !ByteString

Primitive

ConstructionBegin

Constructed value start

ConstructionEnd

Constructed value end

iterateFile :: FilePath -> Iteratee ASN1Event IO a -> IO (Either SomeException a)Source

iterate over a file using a file enumerator.

iterateByteString :: Monad m => ByteString -> Iteratee ASN1Event m a -> m (Either SomeException a)Source

iterate over a lazy bytestring using a list enumerator over the bytestring chunks.

enumReadBytes :: Monad m => Enumeratee ByteString ASN1Event m aSource

enumReadBytes parse bytestring and generate asn1event.

enumWriteBytes :: Monad m => Enumeratee ASN1Event ByteString m aSource

write Bytes of events enumeratee

serialize asn1 headers

putHeader :: ASN1Header -> ByteStringSource

putIdentifier encode an ASN1 Identifier into a marshalled value