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

Data.ASN1.Prim

Description

Tools to read ASN1 primitive (e.g. boolean, int)

Synopsis

ASN.1 high-level algebraic types

data ASN1 #

Constructors

Boolean Bool 
IntVal Integer 
BitString BitArray 
OctetString ByteString 
Null 
OID OID 
Real Double 
Enumerated Integer 
ASN1String ASN1CharacterString 
ASN1Time ASN1TimeType DateTime (Maybe TimezoneOffset) 
Other ASN1Class ASN1Tag ByteString 
Start ASN1ConstructionType 
End ASN1ConstructionType 

Instances

Instances details
Show ASN1 # 
Instance details

Defined in Data.ASN1.Types

Methods

showsPrec :: Int -> ASN1 -> ShowS

show :: ASN1 -> String

showList :: [ASN1] -> ShowS

Eq ASN1 # 
Instance details

Defined in Data.ASN1.Types

Methods

(==) :: ASN1 -> ASN1 -> Bool

(/=) :: ASN1 -> ASN1 -> Bool

data ASN1ConstructionType #

Instances

Instances details
Show ASN1ConstructionType # 
Instance details

Defined in Data.ASN1.Types

Methods

showsPrec :: Int -> ASN1ConstructionType -> ShowS

show :: ASN1ConstructionType -> String

showList :: [ASN1ConstructionType] -> ShowS

Eq ASN1ConstructionType # 
Instance details

Defined in Data.ASN1.Types

decodePrimitive :: ASN1Header -> ByteString -> ASN1Ret Source #

encodeList :: [ASN1] -> (Int, [ASN1Event]) Source #

Marshall an ASN.1 value from a val struct or a strict bytestring

getBoolean :: Bool -> ByteString -> Either ASN1Error ASN1 Source #

getInteger :: ByteString -> Either ASN1Error ASN1 Source #

Parse a value bytestring and get the integer out of the two complement encoded bytes.

getDouble :: ByteString -> Either ASN1Error ASN1 Source #

getBitString :: ByteString -> Either ASN1Error ASN1 Source #

getOctetString :: ByteString -> Either ASN1Error ASN1 Source #

getNull :: ByteString -> Either ASN1Error ASN1 Source #

getOID :: ByteString -> Either ASN1Error ASN1 Source #

Return an OID.

getTime :: ASN1TimeType -> ByteString -> Either ASN1Error ASN1 Source #

Marshall an ASN.1 value to a strict bytestring

putTime :: ASN1TimeType -> DateTime -> Maybe TimezoneOffset -> ByteString Source #

putInteger :: Integer -> ByteString Source #

putDouble :: Double -> ByteString Source #

putBitString :: BitArray -> ByteString Source #

putString :: ByteString -> ByteString Source #

putOID :: [Integer] -> ByteString Source #