C# Class Novell.Directory.Ldap.LdapDN

A utility class to facilitate composition and deomposition of distinguished names DNs. Specifies methods for manipulating a distinguished name DN and a relative distinguished name RDN.
显示文件 Open project: EventStore/csharp-ldap Class Usage Examples

Public Methods

Method Description
escapeRDN ( System rdn ) : System.String

Returns the RDN after escaping the characters requiring escaping. For example, for the rdn "cn=Acme, Inc", the escapeRDN method returns "cn=Acme\, Inc". escapeRDN escapes the AttributeValue by inserting '\' before the following chars: * ',' '+' '"' '\' 'LESSTHAN' 'GREATERTHAN' ';' '#' if it comes at the beginning of the string, and ' ' (space) if it comes at the beginning or the end of a string. Note that single-valued attributes can be used because of ambiguity. See RFC 2253

explodeDN ( System dn, bool noTypes ) : System.String[]

Returns the individual components of a distinguished name (DN).

explodeRDN ( System rdn, bool noTypes ) : System.String[]

Returns the individual components of a relative distinguished name (RDN), normalized.

isValid ( System dn ) : bool

Returns true if the string conforms to distinguished name syntax.

normalize ( System dn ) : System.String

Returns the DN normalized by removal of non-significant space characters as per RFC 2253, section4.

unescapeRDN ( System rdn ) : System.String

Returns the RDN after unescaping the characters requiring escaping. For example, for the rdn "cn=Acme\, Inc", the unescapeRDN method returns "cn=Acme, Inc". unescapeRDN unescapes the AttributeValue by removing the '\' when the next character fits the following: ',' '+' '"' '\' 'LESSTHAN' 'GREATERTHAN' ';' '#' if it comes at the beginning of the Attribute Name (without the '\'). ' ' (space) if it comes at the beginning or the end of the Attribute Name

Private Methods

Method Description
equals ( System dn1, System dn2 ) : bool

Method Details

escapeRDN() public static method

Returns the RDN after escaping the characters requiring escaping. For example, for the rdn "cn=Acme, Inc", the escapeRDN method returns "cn=Acme\, Inc". escapeRDN escapes the AttributeValue by inserting '\' before the following chars: * ',' '+' '"' '\' 'LESSTHAN' 'GREATERTHAN' ';' '#' if it comes at the beginning of the string, and ' ' (space) if it comes at the beginning or the end of a string. Note that single-valued attributes can be used because of ambiguity. See RFC 2253
public static escapeRDN ( System rdn ) : System.String
rdn System The RDN to escape. /// ///
return System.String

explodeDN() public static method

Returns the individual components of a distinguished name (DN).
public static explodeDN ( System dn, bool noTypes ) : System.String[]
dn System The distinguished name, for example, "cn=Babs /// Jensen,ou=Accounting,o=Acme,c=US" /// ///
noTypes bool If true, returns only the values of the /// components and not the names. For example, "Babs /// Jensen", "Accounting", "Acme", "US" instead of /// "cn=Babs Jensen", "ou=Accounting", "o=Acme", and /// "c=US". /// ///
return System.String[]

explodeRDN() public static method

Returns the individual components of a relative distinguished name (RDN), normalized.
public static explodeRDN ( System rdn, bool noTypes ) : System.String[]
rdn System The relative distinguished name, or in other words, /// the left-most component of a distinguished name. /// ///
noTypes bool If true, returns only the values of the /// components, and not the names of the component, for /// example "Babs Jensen" instead of "cn=Babs Jensen". /// ///
return System.String[]

isValid() public static method

Returns true if the string conforms to distinguished name syntax.
public static isValid ( System dn ) : bool
dn System String to evaluate fo distinguished name syntax. ///
return bool

normalize() public static method

Returns the DN normalized by removal of non-significant space characters as per RFC 2253, section4.
public static normalize ( System dn ) : System.String
dn System
return System.String

unescapeRDN() public static method

Returns the RDN after unescaping the characters requiring escaping. For example, for the rdn "cn=Acme\, Inc", the unescapeRDN method returns "cn=Acme, Inc". unescapeRDN unescapes the AttributeValue by removing the '\' when the next character fits the following: ',' '+' '"' '\' 'LESSTHAN' 'GREATERTHAN' ';' '#' if it comes at the beginning of the Attribute Name (without the '\'). ' ' (space) if it comes at the beginning or the end of the Attribute Name
public static unescapeRDN ( System rdn ) : System.String
rdn System The RDN to unescape. /// ///
return System.String