crypton-asn1-encoding
Copyright(c) 2010-2013 Vincent Hanquez <vincent@snarc.org>
LicenseBSD-style
Stabilityexperimental
Portabilityunknown
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.ASN1.BinaryEncoding.Raw

Description

Raw encoding of binary format (BERDERCER)

Synopsis

Types

data ASN1Header Source #

ASN.1 Header with the class, tag, constructed flag and length.

Instances

Instances details
Eq ASN1Header Source # 
Instance details

Defined in Data.ASN1.Types.Lowlevel

Show ASN1Header Source # 
Instance details

Defined in Data.ASN1.Types.Lowlevel

type ASN1Tag = Int Source #

ASN.1 Tag.

data ASN1Length Source #

ASN.1 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.

Instances

Instances details
Eq ASN1Length Source # 
Instance details

Defined in Data.ASN1.Types.Lowlevel

Show ASN1Length Source # 
Instance details

Defined in Data.ASN1.Types.Lowlevel

data ASN1Event Source #

Represent one event from an ASN.1 data stream.

Constructors

Header ASN1Header

ASN.1 Header.

Primitive !ByteString

Primitive

ConstructionBegin

Constructed value start.

ConstructionEnd

Constructed value end.

Instances

Instances details
Eq ASN1Event Source # 
Instance details

Defined in Data.ASN1.Types.Lowlevel

Show ASN1Event Source # 
Instance details

Defined in Data.ASN1.Types.Lowlevel

Parser

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

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

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

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

Writer

toLazyByteString :: [ASN1Event] -> ByteString Source #

Transform a list of ASN.1 events into a lazy bytestring.

toByteString :: [ASN1Event] -> ByteString Source #

Transform a list of ASN.1 events into a strict bytestring.