LDAPv3-0.1.2.0: Lightweight Directory Access Protocol (LDAP) version 3
Copyright© Herbert Valerio Riedel 2020
LicenseGPL-2.0-or-later
Safe HaskellTrustworthy
LanguageHaskell2010

LDAPv3.ASN1String

Description

ASN.1 String Types

This modules features types and associated functions for encodingdecoding common ASN.1 string types from their ASN.1 BER representation according to their standard universal/ ASN.1 tag number.

Since: 0.1.1

Synopsis

Documentation

class ASN1String a where Source #

Typeclass abstracting over common ASN.1 string operations

Since: 0.1.1

Methods

asn1string'decode :: ByteString -> Maybe a Source #

Decode ASN.1 string type from its ASN.1 BER encoding

default asn1string'decode :: ASN1 a => ByteString -> Maybe a Source #

asn1string'encode :: a -> ByteString Source #

Encode ASN.1 string type to its ASN.1 BER encoding

default asn1string'encode :: ASN1 a => a -> ByteString Source #

asn1string'supportsCodePoint :: Proxy a -> Char -> Bool Source #

Predicate for determining whether given code-point is allowed by the respective ASN.1 string type

asn1string'toCodePoints :: a -> [Char] Source #

Convert ASN.1 string type to list of code-points

asn1string'fromCodePoints :: [Char] -> Maybe a Source #

Construct ASN.1 string type from list of code-points

This returns Nothing if a code-point cannot be expressed in the respective ASN.1 string type.

Instances

Instances details
ASN1String UniversalString Source # 
Instance details

Defined in LDAPv3.ASN1String

ASN1String BMPString Source # 
Instance details

Defined in LDAPv3.ASN1String

ASN1String IA5String Source # 
Instance details

Defined in LDAPv3.ASN1String

ASN1String VisibleString Source # 
Instance details

Defined in LDAPv3.ASN1String

ASN1String NumericString Source # 
Instance details

Defined in LDAPv3.ASN1String

ASN1String PrintableString Source # 
Instance details

Defined in LDAPv3.ASN1String

ASN1String UTF8String Source # 
Instance details

Defined in LDAPv3.ASN1String

Convenience Sum-type

asn1StringChoice'encode :: ASN1StringChoice -> ByteString Source #

Encode ASN.1 string choice to its ASN.1 BER encoding

Since: 0.1.1

asn1StringChoice'decode :: ByteString -> Maybe ASN1StringChoice Source #

Decode ASN.1 string choice from its ASN.1 BER encoding

Since: 0.1.1

UTF8String

newtype UTF8String Source #

ASN.1 UTF8String

UTF8String ::= [UNIVERSAL 12] IMPLICIT OCTET STRING

Since: 0.1.1

Constructors

UTF8String 

Fields

UniversalString

data UniversalString Source #

ASN.1 UniversalString

UniversalString ::= [UNIVERSAL 28] IMPLICIT OCTET STRING

NB: The surrogate-pair range U+D800 through U+DFFF is tolerated and thus becomes the responsibility of code converting to and from UniversalString

Since: 0.1.1

Instances

Instances details
Eq UniversalString Source # 
Instance details

Defined in LDAPv3.ASN1String

Ord UniversalString Source # 
Instance details

Defined in LDAPv3.ASN1String

Show UniversalString Source # 
Instance details

Defined in LDAPv3.ASN1String

Binary UniversalString Source #

Encodes as ASN.1 BER

Instance details

Defined in LDAPv3.ASN1String

ASN1String UniversalString Source # 
Instance details

Defined in LDAPv3.ASN1String

BMPString

data BMPString Source #

ASN.1 BMPString

BMPString ::= [UNIVERSAL 30] IMPLICIT OCTET STRING

NB: The surrogate-pair range U+D800 through U+DFFF is tolerated and thus the responsibility of code converting to and from BMPString

Since: 0.1.1

IA5String

data IA5String Source #

ASN.1 IA5String

IA5String ::= [UNIVERSAL 22] IMPLICIT OCTET STRING

Since: 0.1.1

VisibleString

data VisibleString Source #

ASN.1 VisibleString

VisibleString ::= [UNIVERSAL 26] IMPLICIT OCTET STRING

Since: 0.1.1

PrintableString

data PrintableString Source #

ASN.1 PrintableString

PrintableString ::= [UNIVERSAL 19] IMPLICIT OCTET STRING

Since: 0.1.1

Instances

Instances details
Eq PrintableString Source # 
Instance details

Defined in LDAPv3.ASN1String

Ord PrintableString Source # 
Instance details

Defined in LDAPv3.ASN1String

Show PrintableString Source # 
Instance details

Defined in LDAPv3.ASN1String

Binary PrintableString Source #

Encodes as ASN.1 BER

Instance details

Defined in LDAPv3.ASN1String

ASN1String PrintableString Source # 
Instance details

Defined in LDAPv3.ASN1String

NumericString

data NumericString Source #

ASN.1 NumericString

NumericString ::= [UNIVERSAL 18] IMPLICIT OCTET STRING

Since: 0.1.1