License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
Raw encoding of binary format (BER DER CER)
Synopsis
- data ASN1Header = ASN1Header ! ASN1Class ! ASN1Tag ! Bool ! ASN1Length
-
data
ASN1Class
- = Universal
- | Application
- | Context
- | Private
- type ASN1Tag = Int
- data ASN1Length
- data ASN1Event
- parseLBS :: ByteString -> Either ASN1Error [ ASN1Event ]
- parseBS :: ByteString -> Either ASN1Error [ ASN1Event ]
- toLazyByteString :: [ ASN1Event ] -> ByteString
- toByteString :: [ ASN1Event ] -> ByteString
types
data ASN1Header Source #
ASN1 Header with the class, tag, constructed flag and length.
ASN1Header ! ASN1Class ! ASN1Tag ! Bool ! ASN1Length |
Instances
Eq ASN1Header | |
Defined in Data.ASN1.Types.Lowlevel (==) :: ASN1Header -> ASN1Header -> Bool Source # (/=) :: ASN1Header -> ASN1Header -> Bool Source # |
|
Show ASN1Header | |
Defined in Data.ASN1.Types.Lowlevel |
Element class
Instances
Enum ASN1Class | |
Defined in Data.ASN1.Types.Lowlevel succ :: ASN1Class -> ASN1Class Source # pred :: ASN1Class -> ASN1Class Source # toEnum :: Int -> ASN1Class Source # fromEnum :: ASN1Class -> Int Source # enumFrom :: ASN1Class -> [ ASN1Class ] Source # enumFromThen :: ASN1Class -> ASN1Class -> [ ASN1Class ] Source # enumFromTo :: ASN1Class -> ASN1Class -> [ ASN1Class ] Source # enumFromThenTo :: ASN1Class -> ASN1Class -> ASN1Class -> [ ASN1Class ] Source # |
|
Eq ASN1Class | |
Ord ASN1Class | |
Defined in Data.ASN1.Types.Lowlevel |
|
Show ASN1Class | |
data ASN1Length Source #
ASN1 Length with all different formats
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
Eq ASN1Length | |
Defined in Data.ASN1.Types.Lowlevel (==) :: ASN1Length -> ASN1Length -> Bool Source # (/=) :: ASN1Length -> ASN1Length -> Bool Source # |
|
Show ASN1Length | |
Defined in Data.ASN1.Types.Lowlevel |
represent one event from an asn1 data stream
Header ASN1Header |
ASN1 Header |
Primitive ! ByteString |
Primitive |
ConstructionBegin |
Constructed value start |
ConstructionEnd |
Constructed value end |
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