DN

The DN class contains methods to manipulate distinguished names (DNs).

Inheritance: The DN class implements the IComparable<DN> interface.

Namespace: Softerra.Adaxes.Ldap

Constructors

  • Constructor

  • Description

  • DN()

  • Constructs a new instance of the DN class.

  • DN(string)

  • Constructs a new instance of the DN class based on the specified string representation of the distinguished name.

  • DN(DN)

  • Constructs a new instance of the DN class by copying the DN from another instance of the DN class.

Methods

  • Method

  • Description

  • Explode(bool)

  • Returns an array of the individual relative distinguished names (RDNs) that the DN consists of.

  • Explode(string, bool)

  • Returns an array of the individual relative distinguished names (RDNs) that a given DN consists of.

  • Normalize()

  • Normalizes a given DN by removing non-significant space characters as per RFC 2253, Section4.

  • Concat(string, string[])

  • Concatenates an attribute type and one or more attribute values into a distinguished name string.

  • Concat(string[], string[])

  • Concatenates one or more attribute types and one or more attribute values into a distinguished name string.

  • IsValid()

  • Checks whether the specified string conforms to the distinguished name syntax.

  • AreEqual()

  • Checks whether the two strings correspond to the same DN using case-ignore matching.

  • IsDescendantOf()

  • Checks whether the directory object represented by the DN is a descendant of the specified DN of a directory object.

  • AddLeaf(Rdn)

  • Adds the specified RDN to the beginning of this DN.

  • AddLeaf(DN)

  • Adds the specified DN to the beginning of this DN.

  • AddLeaf(string)

  • Adds the specified DN represented by a string to the beginning of this DN.

  • AddParent(Rdn)

  • Adds the specified RDN to the end of this DN.

  • AddParent(DN)

  • Adds the specified DN to the end of this DN.

  • AddParent(string)

  • Adds the specified DN represented by a string to the end of this DN.

  • CompareTo()

  • Compares the DN with another DN.

Properties

  • Property

  • Description

  • Rdns

  • Gets a collection of relative distinguished names (RDNs) the distinguished name consists of.

  • Parent

  • Gets the parent DN of this DN. If this DN holds an empty DN (RootDSE), the returned instance of the DN class contains an empty DN as well.

  • Leaf

  • Gets the leaf relative distinguished name (RDN) of the DN.

Details

DN()

Constructs a new instance of the DN class.

DN()

DN(string)

Constructs a new instance of the DN class based on the specified string representation of the distinguished name.

DN(string dn)

Parameters

The dn parameter contains a string representation of the distinguished name.

Exceptions

  • ArgumentNullException

  • The dn parameter is null.

  • InvalidDNException

  • The value passed by the dn parameter does not adhere to the syntax described in RFC2253.

DN(DN)

Constructs a new instance of the DN class by copying the DN from another instance of the DN class.

DN(DN otherDn)

Exceptions

  • ArgumentNullException
  • The otherDn parameter is null.

Explode(bool)

Returns an array of the individual relative distinguished names (RDNs) that the DN consists of.

string[] Explode(bool noTypes)

Remarks

If the noTypes parameter is set to true, the method returns only RDN values without RDN types (e.g. John Doe, Accounting, com instead of CN=John Doe, OU=Accounting, and DC=com).


Explode(string,bool)

Returns an array of the individual relative distinguished names (RDNs) that a given DN consists of.

static string[] Explode(string dn, bool noTypes)

Parameters

  • dn - Contains the distinguished name to parse.
  • noTypes - If set to true, the method returns only RDN values without RDN types (e.g. John Doe, Accounting, com instead of CN=John Doe, OU=Accounting, and DC=com).

Normalize()

Normalizes a given DN by removing non-significant space characters as per RFC 2253, Section4.

static string Normalize(string dn)

Concat(string,string[])

Concatenates an attribute type and one or more attribute values into a distinguished name string.

static string Concat(string attributeType, string[] attributeValues)

Concat(string[],string[])

Concatenates one or more attribute types and one or more attribute values into a distinguished name string.

static string Concat(string[] attributeTypes, string[] attributeValues)

IsValid()

Checks whether the specified string conforms to the distinguished name syntax.

static bool IsValid(string dn)

AreEqual()

Checks whether the two strings correspond to the same DN using case-ignore matching.

static bool AreEqual(string x, string y)

Exceptions

  • InvalidDNException
  • One of or both the strings do not contain a valid DN.

IsDescendantOf()

Checks whether the directory object represented by the DN is a descendant of the specified DN of a directory object.

bool IsDescendantOf(DN containerDN)

AddLeaf(Rdn)

Adds the specified RDN to the beginning of this DN.

void AddLeaf(Rdn rdn)

AddLeaf(DN)

Adds the specified DN to the beginning of this DN.

void AddLeaf(DN dn)

AddLeaf(string)

Adds the specified DN represented by a string to the beginning of this DN.

void AddLeaf(string dn)

AddParent(Rdn)

Adds the specified RDN to the end of this DN.

void AddParent(Rdn rdn)

AddParent(DN)

Adds the specified DN to the end of this DN.

void AddParent(DN dn)

AddParent(string)

Adds the specified DN represented by a string to the end of this DN.

void AddParent(string dn)

CompareTo()

Compares the DN with another DN.

int CompareTo(DN otherDn)

Return value

The method returns an int that indicates the relative order of the objects being compared. The return value has the following meanings:

  • If the return value is less than zero, this DN is less than the DN specified in the otherDn parameter.
  • If the return value is 0, this DN is equal to the DN specified in the otherDn parameter.
  • If the return value is greater than zero, this DN is greater than the DN specified in the otherDn parameter.

Rdns

Gets a collection of relative distinguished names (RDNs) the distinguished name consists of. Each element in the collection is represented by the Rdn class.

  • Type:
  • Collection<Rdn>
  • Access:
  • Read-only

Parent

Gets the parent DN of this DN. If this DN holds an empty DN (RootDSE), the returned instance of the DN class contains an empty DN as well.

  • Type:
  • DN
  • Access:
  • Read-only

Leaf

Gets the leaf relative distinguished name (RDN) of the DN.

  • Type:
  • Rdn
  • Access:
  • Read-only

Requirements

Minimum required version: 2009.1

See also