public final class LdapEncoder extends Object
Modifier and Type | Method and Description |
---|---|
static String |
filterEncode(String value)
Escape a value for use in a filter.
|
static String |
nameDecode(String value)
Decodes a value.
|
static String |
nameEncode(String value)
LDAP Encodes a value for use with a DN.
|
static byte[] |
parseBase64Binary(String val)
Converts the Base64 encoded string argument into an array of bytes.
|
static String |
printBase64Binary(byte[] val)
Converts an array of bytes into a Base64 encoded string according to the rules for converting LDAP Attributes in RFC2849.
|
protected static String |
toTwoCharHex(char c) |
protected static String toTwoCharHex(char c)
public static String filterEncode(String value)
value
- the value to escape.public static String nameEncode(String value)
value
- the value to escape.public static String nameDecode(String value) throws BadLdapGrammarException
value
- Trimmed value, so no leading an trailing blanks, except an
escaped space last.BadLdapGrammarException
public static String printBase64Binary(byte[] val)
val
- IllegalArgumentException
- if val is null.public static byte[] parseBase64Binary(String val)
val
- IllegalArgumentException
- if val is null or does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary.