Class IA5StringConverter

java.lang.Object
org.mozilla.jss.netscape.security.x509.IA5StringConverter
All Implemented Interfaces:
AVAValueConverter

public class IA5StringConverter extends Object implements AVAValueConverter
A AVAValueConverter that converts a IA5String attribute to a DerValue and vice versa. An example an attribute that is a IA5String string is "E".
See Also:
  • Constructor Details

    • IA5StringConverter

      public IA5StringConverter()
  • Method Details

    • getValue

      public DerValue getValue(String valueString) throws IOException
      Description copied from interface: AVAValueConverter
      Converts a string to a DER encoded attribute value.
      Specified by:
      getValue in interface AVAValueConverter
      Parameters:
      valueString - An AVA value string not encoded in any form.
      Returns:
      A DerValue object.
      Throws:
      IOException - if an error occurs during the conversion.
    • getValue

      public DerValue getValue(String valueString, byte[] tags) throws IOException
      Description copied from interface: AVAValueConverter
      Converts a string to a DER encoded attribute value. Specify the order of DER tags to use if more than one encoding is possible. Currently Directory Strings can have different order for backwards compatibility. By 2003 all should be UTF8String.
      Specified by:
      getValue in interface AVAValueConverter
      Parameters:
      valueString - An AVA value string not encoded in any form.
      Returns:
      A DerValue object.
      Throws:
      IOException - if an error occurs during the conversion.
    • getValue

      public DerValue getValue(byte[] berStream) throws IOException
      Description copied from interface: AVAValueConverter
      Converts a BER encoded value to a DER encoded attribute value.
      Specified by:
      getValue in interface AVAValueConverter
      Parameters:
      berStream - A byte array of the BER encoded AVA value.
      Returns:
      A DerValue object.
      Throws:
      IOException
    • getAsString

      public String getAsString(DerValue avaValue) throws IOException
      Description copied from interface: AVAValueConverter
      Converts a DER encoded value to a string, not encoded in any form.
      Specified by:
      getAsString in interface AVAValueConverter
      Parameters:
      avaValue - A DerValue object.
      Returns:
      A string for the value or null if it can't be converted.
      Throws:
      IOException - if an error occurs during the conversion.