Data.ASN1.Encoding

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.Encoding

Contents

- generic class for decoding and encoding stream
- strict bytestring version

Description

Synopsis

- class ASN1Decoding a where
  - decodeASN1 :: a -> ByteString -> Either ASN1Error [ASN1]
- class ASN1DecodingRepr a where
  - decodeASN1Repr :: a -> ByteString -> Either ASN1Error [ASN1Repr]
- class ASN1Encoding a where
  - encodeASN1 :: a -> [ASN1] -> ByteString
- decodeASN1' :: ASN1Decoding a => a -> ByteString -> Either ASN1Error [ASN1]
- decodeASN1Repr' :: ASN1DecodingRepr a => a -> ByteString -> Either ASN1Error [ASN1Repr]
- encodeASN1' :: ASN1Encoding a => a -> [ASN1] -> ByteString

# generic class for decoding and encoding stream

class ASN1Decoding a where #

Describe an ASN1 decoding, that transform a bytestream into an asn1stream

Methods

decodeASN1 :: a -> ByteString -> Either ASN1Error [ASN1] #

decode a lazy bytestring into an ASN1 stream

#### Instances

Instances details

ASN1Decoding BER # |
Instance details Defined in Data.ASN1.BinaryEncoding Methods decodeASN1 :: BER -> ByteString -> Either ASN1Error [ASN1] #
ASN1Decoding DER # |
Instance details Defined in Data.ASN1.BinaryEncoding Methods decodeASN1 :: DER -> ByteString -> Either ASN1Error [ASN1] #

class ASN1DecodingRepr a where #

transition class.

Methods

decodeASN1Repr :: a -> ByteString -> Either ASN1Error [ASN1Repr] #

decode a lazy bytestring into an ASN1 stream

#### Instances

Instances details

ASN1DecodingRepr BER # |
Instance details Defined in Data.ASN1.BinaryEncoding Methods decodeASN1Repr :: BER -> ByteString -> Either ASN1Error [ASN1Repr] #
ASN1DecodingRepr DER # |
Instance details Defined in Data.ASN1.BinaryEncoding Methods decodeASN1Repr :: DER -> ByteString -> Either ASN1Error [ASN1Repr] #

class ASN1Encoding a where #

Describe an ASN1 encoding, that transform an asn1stream into a bytestream

Methods

encodeASN1 :: a -> [ASN1] -> ByteString #

encode a stream into a lazy bytestring

#### Instances

Instances details

ASN1Encoding DER # |
Instance details Defined in Data.ASN1.BinaryEncoding Methods encodeASN1 :: DER -> [ASN1] -> ByteString #

# strict bytestring version

decodeASN1' :: ASN1Decoding a => a -> ByteString -> Either ASN1Error [ASN1] #

decode a strict bytestring into an ASN1 stream

decodeASN1Repr' :: ASN1DecodingRepr a => a -> ByteString -> Either ASN1Error [ASN1Repr] #

decode a strict bytestring into an ASN1Repr stream

encodeASN1' :: ASN1Encoding a => a -> [ASN1] -> ByteString #

encode a stream into a strict bytestring