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
Modifier and TypeMethodDescriptiongetAsString
(DerValue avaValue) Converts a DER encoded value to a string, not encoded in any form.getValue
(byte[] berStream) Converts a BER encoded value to a DER encoded attribute value.Converts a string to a DER encoded attribute value.Converts a string to a DER encoded attribute value.
-
Method Details
-
getValue
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:
IOException
- if an error occurs during the conversion.
-
getValue
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:
IOException
- if an error occurs during the conversion.
-
getValue
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:
IOException
-
getAsString
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:
IOException
- if an error occurs during the conversion.
-