Character String Types

The Java 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 Java 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 value;

Each of the specific ASN.1 character string types except UniversalString has an associated Java class that is derived from the Asn1CharString base class. The general form of the Java 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 Java class is derived from Asn1Type and it contains the following public member that holds the character string contents:

   public int value[];

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

ASN.1 Production

   <name> ::= <CharStrType>

XSD Types

<xsd:string> and all related types including date/time types and duration.

Generated Java class

   public class <name> extends Asn1<CharStrType> {
      public <name> () {
         super();
      }
      public <name> (String value_) {
         super (value_);
      }
   }