Interface AVAValueConverter

  • All Known Implementing Classes:
    DirStrConverter, GenericValueConverter, IA5StringConverter, PrintableConverter

    public interface AVAValueConverter
    Interface for classes that convert a attribute value string to a DER encoded ASN.1 value and vice versa. The converters are associated with attribute types, such as directory string, ia5string, etc.

    For example, to convert a string, such as an organization name for the "O" attribute to a DerValue, the "O" attribute is mapped to the DirStrConverter which is used to convert the organization name to a DER encoded Directory String which is a DerValue of a ASN.1 PrintableString, T.61String or UniversalString for the organization name.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getAsString​(DerValue avaValue)
      Converts a DER encoded value to a string, not encoded in any form.
      DerValue getValue​(byte[] berStream)
      Converts a BER encoded value to a DER encoded attribute value.
      DerValue getValue​(java.lang.String valueString)
      Converts a string to a DER encoded attribute value.
      DerValue getValue​(java.lang.String valueString, byte[] tags)
      Converts a string to a DER encoded attribute value.
    • Method Detail

      • getValue

        DerValue getValue​(java.lang.String valueString)
                   throws java.io.IOException
        Converts a string to a DER encoded attribute value.
        Parameters:
        valueString - An AVA value string not encoded in any form.
        Returns:
        A DerValue object.
        Throws:
        java.io.IOException - if an error occurs during the conversion.
      • getValue

        DerValue getValue​(java.lang.String valueString,
                          byte[] tags)
                   throws java.io.IOException
        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.
        Parameters:
        valueString - An AVA value string not encoded in any form.
        Returns:
        A DerValue object.
        Throws:
        java.io.IOException - if an error occurs during the conversion.
      • getValue

        DerValue getValue​(byte[] berStream)
                   throws java.io.IOException
        Converts a BER encoded value to a DER encoded attribute value.
        Parameters:
        berStream - A byte array of the BER encoded AVA value.
        Returns:
        A DerValue object.
        Throws:
        java.io.IOException
      • getAsString

        java.lang.String getAsString​(DerValue avaValue)
                              throws java.io.IOException
        Converts a DER encoded value to a string, not encoded in any form.
        Parameters:
        avaValue - A DerValue object.
        Returns:
        A string for the value or null if it can't be converted.
        Throws:
        java.io.IOException - if an error occurs during the conversion.