Class ASN1CharStrConvMap

java.lang.Object
org.mozilla.jss.netscape.security.util.ASN1CharStrConvMap

public class ASN1CharStrConvMap extends Object
Maps a ASN.1 character string type to a charset encoder and decoder. The converter is used to convert a DerValue of a ASN.1 character string type from bytes to unicode characters and vice versa.

A global default ASN1CharStrConvMap is created when the class is initialized. The global default map is extensible.

  • Field Details

  • Constructor Details

    • ASN1CharStrConvMap

      public ASN1CharStrConvMap()
      Constructs a ASN1CharStrConvMap.
  • Method Details

    • getEncoder

      public CharsetEncoder getEncoder(byte tag)
      Get an encoder for the specified DER tag.
      Parameters:
      tag - A DER tag of a ASN.1 character string type, for example DerValue.tag_PrintableString.
      Returns:
      An encoder for the DER tag.
    • getDecoder

      public CharsetDecoder getDecoder(byte tag)
      Get a decoder for the given DER tag.
      Parameters:
      tag - A DER tag of a ASN.1 character string type, for example DerValue.tag_PrintableString.
      Returns:
      A decoder for the DER tag.
    • addEntry

      public void addEntry(byte tag, Charset charset)
      Add a tag-charset entry in the map.
      Parameters:
      tag - A DER tag of a ASN.1 character string type, ex. DerValue.tag_IA5String
      charset - A charset for the tag.
    • getTags

      public Iterator<Byte> getTags()
      Get an iterator of all tags in the map.
      Returns:
      An Iterator of DER tags in the map as Bytes.
    • getDefault

      public static ASN1CharStrConvMap getDefault()
      Get the global ASN1CharStrConvMap.
      Returns:
      The global default ASN1CharStrConvMap.
    • setDefault

      public static void setDefault(ASN1CharStrConvMap newDefault)
      Set the global default ASN1CharStrConvMap.
      Parameters:
      newDefault - The new default ASN1CharStrConvMap.