Character String Types

The C# version of the compiler contains support for the various ASN.1 character string types including the BMP, Universal and UTF-8 string types. All character strings in C# are based on 16-bit Unicode characters except for UniversalString which is based on a 32-bit character set.

All character string types are derived from the Asn1CharString base class (except the UniversalString). This class contains the following public member variable that holds the character string contents:

   public string mValue;

Each of the specific ASN.1 character string types except UniversalString has an associated C# class that is derived from the Asn1CharString base class. The general form of the C# class name for each of the ASN.1 string types is Asn1 followed by the ASN.1 string type name. For example, IA5String is represented by the Asn1IA5String class, NumericString by the Asn1NumericString, etc.

The UniversalString associated C# class is derived from Asn1Type and it contains the following public member that holds the character string contents:

   public int mValue[];

The following shows the basic mapping from ASN.1 type to C# class definition:

ASN.1 Production:
<name> ::= <CharStrType>
XSD Types: <xsd:string> and all related types including date/time types and duration.
Generated C# class:
   public class <name> : Asn1<CharStrType> {
   public <name> () :
      base() {
   }
   public <name> (string value_) :
   base (value_) {
   }
}