Module Distinguished_name.Encoded_string

ASN.1 string contents and encoding.

type encoding = [
  1. | `UTF8
  2. | `Printable
  3. | `IA5
  4. | `Universal
  5. | `Teletex
  6. | `BMP
]

The polymorphic variant of different string tags.

type directory_encoding = [
  1. | `UTF8
  2. | `Printable
  3. | `Universal
  4. | `Teletex
  5. | `BMP
]

The polymorphic variant of directory string tags.

type +'encoding t

The type of string values with their encoding.

val of_string : encoding:([< encoding ] as 'encoding) -> string -> 'encoding t

of_string ~encoding s associates s with its encoding. s contains the string contents in that encoding, without an ASN.1 tag or length. The contents are not validated, transcoded or normalized.

val to_string : 'encoding t -> string

to_string t is the content of t in its declared encoding, not necessarily UTF-8. No transcoding is performed: a BMPString containing "A" is returned as "\x00A".

val encoding : 'encoding t -> 'encoding

encoding t is the encoding of t.