asn1-encoding-0.9.6: ASN1 data reader and writer in RAW, BER and DER forms
License BSD-style
Maintainer Vincent Hanquez <vincent@snarc.org>
Stability experimental
Portability unknown
Safe Haskell None
Language Haskell2010

Data.ASN1.BinaryEncoding.Raw

Description

Raw encoding of binary format (BER DER CER)

Synopsis

types

data ASN1Length Source #

ASN1 Length with all different formats

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

parser

parseLBS :: ByteString -> Either ASN1Error [ ASN1Event ] Source #

Parse one lazy bytestring and returns on success all ASN1 events associated.

parseBS :: ByteString -> Either ASN1Error [ ASN1Event ] Source #

Parse one strict bytestring and returns on success all ASN1 events associated.

writer

toLazyByteString :: [ ASN1Event ] -> ByteString Source #

transform a list of ASN1 Events into a lazy bytestring

toByteString :: [ ASN1Event ] -> ByteString Source #

transform a list of ASN1 Events into a strict bytestring