All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class netscape.security.util.ASN1CharStrConvMap

netscape.security.util.ASN1CharStrConvMap

public class ASN1CharStrConvMap
Maps a ASN.1 character string type to a CharToByte and ByteToChar converter. 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.


Constructor Index

 o ASN1CharStrConvMap()
Constructs a ASN1CharStrConvMap.

Method Index

 o addEntry(byte, Class, Class)
Add a tag-CharToByteConverter-ByteToCharConverter entry in the map.
 o getBCC(byte)
Get a Byte to Character converter for the given DER tag.
 o getCBC(byte)
Get a Character to Byte converter for the specified DER tag.
 o getDefault()
Get the global ASN1CharStrConvMap.
 o getTags()
Get and enumeration of all tags in the map.
 o setDefault(ASN1CharStrConvMap)
Set the global default ASN1CharStrConvMap.

Constructors

 o ASN1CharStrConvMap
 public ASN1CharStrConvMap()
Constructs a ASN1CharStrConvMap.

Methods

 o getCBC
 public CharToByteConverter getCBC(byte tag) throws IllegalAccessException, InstantiationException
Get a Character to Byte converter for the specified DER tag.

Parameters:
tag - A DER tag of a ASN.1 character string type, for example DerValue.tag_PrintableString.
Returns:
A CharToByteConverter for the DER tag.
Throws: InstantiationException
if error occurs when instantiating the CharToByteConverter.
Throws: IllegalAccessException
if error occurs when loading the CharToByteConverter class.
 o getBCC
 public ByteToCharConverter getBCC(byte tag) throws IllegalAccessException, InstantiationException
Get a Byte to Character converter for the given DER tag.

Parameters:
tag - A DER tag of a ASN.1 character string type, for example DerValue.tag_PrintableString.
Returns:
A ByteToCharConverter for the DER tag.
Throws: InstantiationException
if error occurs when instantiationg the ByteToCharConverter.
Throws: IllegalAccessException
if error occurs when loading the ByteToCharConverter class.
 o addEntry
 public void addEntry(byte tag,
                      Class cbc,
                      Class bcc)
Add a tag-CharToByteConverter-ByteToCharConverter entry in the map.

Parameters:
tag - A DER tag of a ASN.1 character string type, ex. DerValue.tag_IA5String
cbc - A CharToByteConverter for the tag.
bcc - A ByteToCharConverter for the tag.
 o getTags
 public Enumeration getTags()
Get and enumeration of all tags in the map.

Returns:
An Enumeration of DER tags in the map as Bytes.
 o getDefault
 public static ASN1CharStrConvMap getDefault()
Get the global ASN1CharStrConvMap.

Returns:
The global default ASN1CharStrConvMap.
 o setDefault
 public static void setDefault(ASN1CharStrConvMap newDefault)
Set the global default ASN1CharStrConvMap.

Parameters:
newDefault - The new default ASN1CharStrConvMap.

All Packages  Class Hierarchy  This Package  Previous  Next  Index