Data.ASN1.Types

asn1-types-0.3.2: 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
- data ASN1CharacterString = ASN1CharacterString {
  - characterEncoding :: ASN1StringEncoding
  - getCharacterStringRawData :: ByteString
  }
- asn1CharacterString :: ASN1StringEncoding -> String -> ASN1CharacterString
- asn1CharacterToString :: ASN1CharacterString -> Maybe String
- module Data.ASN1.OID

# Documentation

data ASN1 #

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

Eq ASN1 # |
Methods (==) :: ASN1 -> ASN1 -> Bool # (/=) :: ASN1 -> ASN1 -> Bool #
Show ASN1 # |
Methods showsPrec :: Int -> ASN1 -> ShowS # show :: ASN1 -> String # showList :: [ASN1] -> ShowS #

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

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

data ASN1Class #

Element class

Constructors

Universal |
Application |
Context |
Private |

Instances

Enum ASN1Class # |
Methods succ :: ASN1Class -> ASN1Class # pred :: ASN1Class -> ASN1Class # toEnum :: Int -> ASN1Class # fromEnum :: ASN1Class -> Int # enumFrom :: ASN1Class -> [ASN1Class] # enumFromThen :: ASN1Class -> ASN1Class -> [ASN1Class] # enumFromTo :: ASN1Class -> ASN1Class -> [ASN1Class] # enumFromThenTo :: ASN1Class -> ASN1Class -> ASN1Class -> [ASN1Class] #
Eq ASN1Class # |
Methods (==) :: ASN1Class -> ASN1Class -> Bool # (/=) :: ASN1Class -> ASN1Class -> Bool #
Ord ASN1Class # |
Methods compare :: ASN1Class -> ASN1Class -> Ordering # (<) :: ASN1Class -> ASN1Class -> Bool # (<=) :: ASN1Class -> ASN1Class -> Bool # (>) :: ASN1Class -> ASN1Class -> Bool # (>=) :: ASN1Class -> ASN1Class -> Bool # max :: ASN1Class -> ASN1Class -> ASN1Class # min :: ASN1Class -> ASN1Class -> ASN1Class #
Show ASN1Class # |
Methods showsPrec :: Int -> ASN1Class -> ShowS # show :: ASN1Class -> String # showList :: [ASN1Class] -> ShowS #

type ASN1Tag = Int #

ASN1 Tag

data ASN1ConstructionType #

Define the type of container

Constructors

Sequence |
Set |
Container ASN1Class ASN1Tag |

Instances

Eq ASN1ConstructionType # |
Methods (==) :: ASN1ConstructionType -> ASN1ConstructionType -> Bool # (/=) :: ASN1ConstructionType -> ASN1ConstructionType -> Bool #
Show ASN1ConstructionType # |
Methods showsPrec :: Int -> ASN1ConstructionType -> ShowS # show :: ASN1ConstructionType -> String # showList :: [ASN1ConstructionType] -> ShowS #

data ASN1StringEncoding #

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

Eq ASN1StringEncoding # |
Methods (==) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool # (/=) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool #
Ord ASN1StringEncoding # |
Methods compare :: ASN1StringEncoding -> ASN1StringEncoding -> Ordering # (<) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool # (<=) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool # (>) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool # (>=) :: ASN1StringEncoding -> ASN1StringEncoding -> Bool # max :: ASN1StringEncoding -> ASN1StringEncoding -> ASN1StringEncoding # min :: ASN1StringEncoding -> ASN1StringEncoding -> ASN1StringEncoding #
Show ASN1StringEncoding # |
Methods showsPrec :: Int -> ASN1StringEncoding -> ShowS # show :: ASN1StringEncoding -> String # showList :: [ASN1StringEncoding] -> ShowS #

data ASN1TimeType #

Different ASN1 time representation

Constructors

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

Instances

Eq ASN1TimeType # |
Methods (==) :: ASN1TimeType -> ASN1TimeType -> Bool # (/=) :: ASN1TimeType -> ASN1TimeType -> Bool #
Ord ASN1TimeType # |
Methods compare :: ASN1TimeType -> ASN1TimeType -> Ordering # (<) :: ASN1TimeType -> ASN1TimeType -> Bool # (<=) :: ASN1TimeType -> ASN1TimeType -> Bool # (>) :: ASN1TimeType -> ASN1TimeType -> Bool # (>=) :: ASN1TimeType -> ASN1TimeType -> Bool # max :: ASN1TimeType -> ASN1TimeType -> ASN1TimeType # min :: ASN1TimeType -> ASN1TimeType -> ASN1TimeType #
Show ASN1TimeType # |
Methods showsPrec :: Int -> ASN1TimeType -> ShowS # show :: ASN1TimeType -> String # showList :: [ASN1TimeType] -> ShowS #

class ASN1Object a where #

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

Minimal complete definition

toASN1, fromASN1

Methods

toASN1 :: a -> ASN1S #

transform an object into a chunk of ASN1 stream.

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

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

data ASN1CharacterString #

ASN1 Character String with encoding

Constructors

ASN1CharacterString |
Fields characterEncoding :: ASN1StringEncoding getCharacterStringRawData :: ByteString

Instances

Eq ASN1CharacterString # |
Methods (==) :: ASN1CharacterString -> ASN1CharacterString -> Bool # (/=) :: ASN1CharacterString -> ASN1CharacterString -> Bool #
Ord ASN1CharacterString # |
Methods compare :: ASN1CharacterString -> ASN1CharacterString -> Ordering # (<) :: ASN1CharacterString -> ASN1CharacterString -> Bool # (<=) :: ASN1CharacterString -> ASN1CharacterString -> Bool # (>) :: ASN1CharacterString -> ASN1CharacterString -> Bool # (>=) :: ASN1CharacterString -> ASN1CharacterString -> Bool # max :: ASN1CharacterString -> ASN1CharacterString -> ASN1CharacterString # min :: ASN1CharacterString -> ASN1CharacterString -> ASN1CharacterString #
Show ASN1CharacterString # |
Methods showsPrec :: Int -> ASN1CharacterString -> ShowS # show :: ASN1CharacterString -> String # showList :: [ASN1CharacterString] -> ShowS #
IsString ASN1CharacterString # |
Methods fromString :: String -> ASN1CharacterString #

asn1CharacterString :: ASN1StringEncoding -> String -> ASN1CharacterString #

encode a string into a character string

asn1CharacterToString :: ASN1CharacterString -> Maybe String #

try to decode an `ASN1CharacterString` to a String

module Data.ASN1.OID