LdapName
implements compound names for LDAP v3 as specified by RFC 2253.
RFC 2253 has a few ambiguities and outright inconsistencies. These are resolved as follows:
- RFC 2253 leaves the term "whitespace" undefined. The definition of "optional-space" given in RFC 1779 is used in its place: either a space character or a carriage return ("\r").
- Whitespace is allowed on either side of ',', ';', '=', and '+'. Such whitespace is accepted but not generated by this code, and is ignored when comparing names.
- AttributeValue strings containing '=' or non-leading '#' characters (unescaped) are accepted.
String names passed to LdapName
or returned by it use the full 16-bit Unicode character set. They may also contain characters encoded into UTF-8 with each octet represented by a three-character substring such as "\\B4". They may not, however, contain characters encoded into UTF-8 with each octet represented by a single character in the string: the meaning would be ambiguous.
LdapName
will properly parse all valid names, but does not attempt to detect all possible violations when parsing invalid names. It's "generous".
When names are tested for equality, attribute types and binary values are case-insensitive, and string values are by default case-insensitive. String values with different but equivalent usage of quoting, escaping, or UTF8-hex-encoding are considered equal. The order of components in multi-valued RDNs (such as "ou=Sales+cn=Bob") is not significant.
@author Scott Seligman