asn1-types-0.3.4: ASN.1 types

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell98

Data.ASN1.Types

Description

Synopsis

- data ASN1
  - = 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
- type ASN1S = [ASN1] -> [ASN1]
- data ASN1Class
  - = Universal
  - | Application
  - | Context
  - | Private
- type ASN1Tag = Int
- data ASN1ConstructionType
  - = Sequence
  - | Set
  - | Container ASN1Class ASN1Tag
- data ASN1StringEncoding
  - = IA5
  - | UTF8
  - | General
  - | Graphic
  - | Numeric
  - | Printable
  - | VideoTex
  - | Visible
  - | T61
  - | UTF32
  - | Character
  - | BMP
- data ASN1TimeType
  - = TimeUTC
  - | TimeGeneralized
- class ASN1Object a where
  - toASN1 :: a -> ASN1S
  - fromASN1 :: [ASN1] -> Either String (a, [ASN1])
- data ASN1CharacterString = ASN1CharacterString {
  - characterEncoding :: ASN1StringEncoding
  - getCharacterStringRawData :: ByteString
  }
- asn1CharacterString :: ASN1StringEncoding -> String -> ASN1CharacterString
- asn1CharacterToString :: ASN1CharacterString -> Maybe String
- module Data.ASN1.OID

# Documentation

data ASN1 Source #

Define high level ASN1 object.

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 Source # |
Instance details Defined in Data.ASN1.Types Methods showsPrec :: Int -> ASN1 -> ShowS Source # show :: ASN1 -> String Source # showList :: [ASN1] -> ShowS Source #
Eq ASN1 Source # |
Instance details Defined in Data.ASN1.Types Methods (==) :: ASN1 -> ASN1 -> Bool Source # (/=) :: ASN1 -> ASN1 -> Bool Source #

type ASN1S = [ASN1] -> [ASN1] Source #

represent a chunk of ASN1 Stream. this is equivalent to ShowS but for an ASN1 Stream.

data ASN1Class Source #

Element class

Constructors

Universal |
Application |
Context |
Private |

#### Instances

Instances details

Enum ASN1Class Source # |

Instance details

Defined in Data.ASN1.Types.Lowlevel

Methods

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 #

Show ASN1Class Source # |
Instance details Defined in Data.ASN1.Types.Lowlevel Methods showsPrec :: Int -> ASN1Class -> ShowS Source # show :: ASN1Class -> String Source # showList :: [ASN1Class] -> ShowS Source #
Eq ASN1Class Source # |
Instance details Defined in Data.ASN1.Types.Lowlevel Methods (==) :: ASN1Class -> ASN1Class -> Bool Source # (/=) :: ASN1Class -> ASN1Class -> Bool Source #
Ord ASN1Class Source # |

Instance details

Defined in Data.ASN1.Types.Lowlevel

Methods

compare :: ASN1Class -> ASN1Class -> Ordering Source #

(<) :: ASN1Class -> ASN1Class -> Bool Source #

(<=) :: ASN1Class -> ASN1Class -> Bool Source #

(>) :: ASN1Class -> ASN1Class -> Bool Source #

(>=) :: ASN1Class -> ASN1Class -> Bool Source #

max :: ASN1Class -> ASN1Class -> ASN1Class Source #

min :: ASN1Class -> ASN1Class -> ASN1Class Source #

type ASN1Tag = Int Source #

ASN1 Tag

data ASN1ConstructionType Source #

Define the type of container

Constructors

Sequence |
Set |
Container ASN1Class ASN1Tag |

#### Instances

Instances details

Show ASN1ConstructionType Source # |
Instance details Defined in Data.ASN1.Types Methods showsPrec :: Int -> ASN1ConstructionType -> ShowS Source # show :: ASN1ConstructionType -> String Source # showList :: [ASN1ConstructionType] -> ShowS Source #
Eq ASN1ConstructionType Source # |
Instance details Defined in Data.ASN1.Types Methods (==) :: ASN1ConstructionType -> ASN1ConstructionType -> Bool Source # (/=) :: ASN1ConstructionType -> ASN1ConstructionType -> Bool Source #

data ASN1StringEncoding Source #

Define all possible ASN1 String encoding.

Constructors

IA5 | 128 characters equivalent to the ASCII alphabet
UTF8 | UTF8
General | all registered graphic and character sets (see ISO 2375) plus SPACE and DELETE.
Graphic | all registered G sets and SPACE
Numeric | encoding containing numeric [0-9] and space
Printable | printable [a-z] [A-Z] [()+,-.?:/=] and space.
VideoTex | CCITT's T.100 and T.101 character sets
Visible | International ASCII printing character sets
T61 | teletext
UTF32 | UTF32
Character | Character
BMP | UCS2

#### Instances

Instances details

Show ASN1StringEncoding Source # |
Instance details Defined in Data.ASN1.Types.String Methods showsPrec :: Int -> ASN1StringEncoding -> ShowS Source # show :: ASN1StringEncoding -> String Source # showList :: [ASN1StringEncoding] -> ShowS Source #
Eq ASN1StringEncoding Source # |
Instance details Defined in Data.ASN1.Types.String Methods (==) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool Source # (/=) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool Source #
Ord ASN1StringEncoding Source # |

Instance details

Defined in Data.ASN1.Types.String

Methods

compare :: ASN1StringEncoding -> ASN1StringEncoding -> Ordering Source #

(<) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool Source #

(<=) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool Source #

(>) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool Source #

(>=) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool Source #

max :: ASN1StringEncoding -> ASN1StringEncoding -> ASN1StringEncoding Source #

min :: ASN1StringEncoding -> ASN1StringEncoding -> ASN1StringEncoding Source #

data ASN1TimeType Source #

Different ASN1 time representation

Constructors

TimeUTC | ASN1 UTCTime Type: limited between 1950-2050
TimeGeneralized | ASN1 GeneralizedTime Type

#### Instances

Instances details

Show ASN1TimeType Source # |
Instance details Defined in Data.ASN1.Types Methods showsPrec :: Int -> ASN1TimeType -> ShowS Source # show :: ASN1TimeType -> String Source # showList :: [ASN1TimeType] -> ShowS Source #
Eq ASN1TimeType Source # |
Instance details Defined in Data.ASN1.Types Methods (==) :: ASN1TimeType -> ASN1TimeType -> Bool Source # (/=) :: ASN1TimeType -> ASN1TimeType -> Bool Source #
Ord ASN1TimeType Source # |

Instance details

Defined in Data.ASN1.Types

Methods

compare :: ASN1TimeType -> ASN1TimeType -> Ordering Source #

(<) :: ASN1TimeType -> ASN1TimeType -> Bool Source #

(<=) :: ASN1TimeType -> ASN1TimeType -> Bool Source #

(>) :: ASN1TimeType -> ASN1TimeType -> Bool Source #

(>=) :: ASN1TimeType -> ASN1TimeType -> Bool Source #

max :: ASN1TimeType -> ASN1TimeType -> ASN1TimeType Source #

min :: ASN1TimeType -> ASN1TimeType -> ASN1TimeType Source #

class ASN1Object a where Source #

Define an object that can be converted to and from ASN.1

Methods

toASN1 :: a -> ASN1S Source #

transform an object into a chunk of ASN1 stream.

fromASN1 :: [ASN1] -> Either String (a, [ASN1]) Source #

returns either an object along the remaining ASN1 stream, or an error.

data ASN1CharacterString Source #

ASN1 Character String with encoding

Constructors

ASN1CharacterString |

Fields

- characterEncoding :: ASN1StringEncoding
- getCharacterStringRawData :: ByteString

#### Instances

Instances details

IsString ASN1CharacterString Source # |
Instance details Defined in Data.ASN1.Types.String Methods fromString :: String -> ASN1CharacterString Source #
Show ASN1CharacterString Source # |
Instance details Defined in Data.ASN1.Types.String Methods showsPrec :: Int -> ASN1CharacterString -> ShowS Source # show :: ASN1CharacterString -> String Source # showList :: [ASN1CharacterString] -> ShowS Source #
Eq ASN1CharacterString Source # |
Instance details Defined in Data.ASN1.Types.String Methods (==) :: ASN1CharacterString -> ASN1CharacterString -> Bool Source # (/=) :: ASN1CharacterString -> ASN1CharacterString -> Bool Source #
Ord ASN1CharacterString Source # |

Instance details

Defined in Data.ASN1.Types.String

Methods

compare :: ASN1CharacterString -> ASN1CharacterString -> Ordering Source #

(<) :: ASN1CharacterString -> ASN1CharacterString -> Bool Source #

(<=) :: ASN1CharacterString -> ASN1CharacterString -> Bool Source #

(>) :: ASN1CharacterString -> ASN1CharacterString -> Bool Source #

(>=) :: ASN1CharacterString -> ASN1CharacterString -> Bool Source #

max :: ASN1CharacterString -> ASN1CharacterString -> ASN1CharacterString Source #

min :: ASN1CharacterString -> ASN1CharacterString -> ASN1CharacterString Source #

asn1CharacterString :: ASN1StringEncoding -> String -> ASN1CharacterString Source #

encode a string into a character string

asn1CharacterToString :: ASN1CharacterString -> Maybe String Source #

try to decode an `ASN1CharacterString` to a String

module Data.ASN1.OID