asn1-data-0.2.2: ASN1 data reader and writer in RAW, BER, DER and CER formsContentsIndex
Data.ASN1.Raw
Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Contents
get structure
ASN1 definitions
get value from a Get structure
put value in a Put structure
Description
A module containing raw ASN1 serialization/derialization tools
Synopsis
data GetErr a
runGetErr :: GetErr a -> ByteString -> Either ASN1Err a
runGetErrInGet :: GetErr a -> Get (Either ASN1Err a)
data ASN1Err
= ASN1LengthDecodingLongContainsZero
| ASN1PolicyFailed String String
| ASN1NotImplemented String
| ASN1Multiple [ASN1Err]
| ASN1Misc String
type CheckFn = (TagClass, Bool, TagNumber) -> ValLength -> Maybe ASN1Err
data TagClass
= Universal
| Application
| Context
| Private
type TagNumber = Int
data ValLength
= LenShort Int
| LenLong Int Int
| LenIndefinite
data ValStruct
= Primitive ByteString
| Constructed [Value]
data Value = Value TagClass TagNumber ValStruct
getValueCheck :: CheckFn -> GetErr Value
getValue :: GetErr Value
putValuePolicy :: (Value -> Int -> ValLength) -> Value -> Put
putValue :: Value -> Put
Documentation
data GetErr a
show/hide Instances
get structure
runGetErr :: GetErr a -> ByteString -> Either ASN1Err a
runGetErrInGet :: GetErr a -> Get (Either ASN1Err a)
ASN1 definitions
data ASN1Err
Constructors
ASN1LengthDecodingLongContainsZero
ASN1PolicyFailed String String
ASN1NotImplemented String
ASN1Multiple [ASN1Err]
ASN1Misc String
show/hide Instances
type CheckFn = (TagClass, Bool, TagNumber) -> ValLength -> Maybe ASN1Err
data TagClass
Constructors
Universal
Application
Context
Private
show/hide Instances
type TagNumber = Int
data ValLength
Constructors
LenShort IntShort form with only one byte. length has to be < 127.
LenLong Int IntLong form of N bytes
LenIndefiniteLength is indefinite expect an EOC in the stream to finish the type
show/hide Instances
data ValStruct
Constructors
Primitive ByteStringPrimitive of a strict value
Constructed [Value]Constructed of a list of values
show/hide Instances
data Value
Constructors
Value TagClass TagNumber ValStruct
show/hide Instances
get value from a Get structure
getValueCheck :: CheckFn -> GetErr Value
getValueCheck decode an ASN1 value and check the values received through the check fn
getValue :: GetErr Value
put value in a Put structure
putValuePolicy :: (Value -> Int -> ValLength) -> Value -> Put
putValue :: Value -> Put
putValue encode an ASN1 value using the shortest definite length
Produced by Haddock version 2.7.2