Edit

Share via


X500DistinguishedNameBuilder Class

Definition

Facilitates building a distinguished name for an X.509 certificate.

public ref class X500DistinguishedNameBuilder sealed
public sealed class X500DistinguishedNameBuilder
type X500DistinguishedNameBuilder = class
Public NotInheritable Class X500DistinguishedNameBuilder
Inheritance
X500DistinguishedNameBuilder

Remarks

When constructing the SEQUENCE OF Relative Distinguished Names, this builder constructs the SEQUENCE OF in the opposite order which they were added to the builder. For example:

builder.AddCommonName("Contoso");
builder.AddCountryOrRegion("US");

Will produce a SEQUENCE OF with the country or region first, and the common name second. Because X500DistinguishedName follows RFC 4514 when converting a Distinguished Name to a string, it starts with the last Relative Distinguished Name component, moving backward toward the first.

Because the builder creates the SEQUENCE OF in reverse, and X500DistinguishedName is also in reverse, it gives the appearance of the added attributes and the string representation of the Distinguished Name in the same order.

Constructors

X500DistinguishedNameBuilder()

Initializes a new instance of the X500DistinguishedNameBuilder class.

Methods

Add(Oid, String, Nullable<UniversalTagNumber>)

Adds a Relative Distinguished Name attribute identified by an OID.

Add(String, String, Nullable<UniversalTagNumber>)

Adds a Relative Distinguished Name attribute identified by an OID.

AddCommonName(String)

Adds a common name attribute.

AddCountryOrRegion(String)

Adds a country or region attribute.

AddDomainComponent(String)

Adds a domain component attribute.

AddEmailAddress(String)

Adds an email address attribute.

AddLocalityName(String)

Adds a locality name attribute.

AddOrganizationalUnitName(String)

Adds an organizational unit name attribute.

AddOrganizationName(String)

Adds an organization name attribute.

AddStateOrProvinceName(String)

Adds a state or province name attribute.

Build()

Builds an X500DistinguishedName that represents the encoded attributes.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to