Class ASN1CharStrConvMap
java.lang.Object
org.mozilla.jss.netscape.security.util.ASN1CharStrConvMap
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a tag-charset entry in the map.getDecoder
(byte tag) Get a decoder for the given DER tag.static ASN1CharStrConvMap
Get the global ASN1CharStrConvMap.getEncoder
(byte tag) Get an encoder for the specified DER tag.getTags()
Get an iterator of all tags in the map.static void
setDefault
(ASN1CharStrConvMap newDefault) Set the global default ASN1CharStrConvMap.
-
Field Details
-
charsets
-
defaultMap
-
-
Constructor Details
-
ASN1CharStrConvMap
public ASN1CharStrConvMap()Constructs a ASN1CharStrConvMap.
-
-
Method Details
-
getEncoder
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
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
Add a tag-charset entry in the map.- Parameters:
tag
- A DER tag of a ASN.1 character string type, ex. DerValue.tag_IA5Stringcharset
- A charset for the tag.
-
getTags
Get an iterator of all tags in the map.- Returns:
- An Iterator of DER tags in the map as Bytes.
-
getDefault
Get the global ASN1CharStrConvMap.- Returns:
- The global default ASN1CharStrConvMap.
-
setDefault
Set the global default ASN1CharStrConvMap.- Parameters:
newDefault
- The new default ASN1CharStrConvMap.
-