X500Principal

<p> This class represents an X.500 {@code Principal}. {@code X500Principal}s are represented by distinguished names such as "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US".

<p> This class can be instantiated by using a string representation of the distinguished name, or by using the ASN.1 DER encoded byte representation of the distinguished name. The current specification for the string representation of a distinguished name is defined in <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253: Lightweight Directory Access Protocol (v3): UTF-8 string Representation of Distinguished Names</a>. This class, however, accepts string formats from both RFC 2253 and <a href="http://www.ietf.org/rfc/rfc1779.txt">RFC 1779: A string Representation of Distinguished Names</a>, and also recognizes attribute type keywords whose OIDs (Object Identifiers) are defined in <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile</a>.

<p> The string representation for this {@code X500Principal} can be obtained by calling the {@code getName} methods.

<p> Note that the {@code getSubjectX500Principal} and {@code getIssuerX500Principal} methods of {@code X509Certificate} return X500Principals representing the issuer and subject fields of the certificate.

@see java.security.cert.X509Certificate @since 1.4

Constructors

this
this(X500Name x500Name)

Creates an X500Principal by wrapping an X500Name.

this
this(string name)

Creates an {@code X500Principal} from a string representation of an X.500 distinguished name (ex: "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US"). The distinguished name must be specified using the grammar defined in RFC 1779 or RFC 2253 (either format is acceptable).

this
this(string name, Map!(string, string) keywordMap)

Creates an {@code X500Principal} from a string representation of an X.500 distinguished name (ex: "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US"). The distinguished name must be specified using the grammar defined in RFC 1779 or RFC 2253 (either format is acceptable).

this
this(byte[] name)

Creates an {@code X500Principal} from a distinguished name in ASN.1 DER encoded form. The ASN.1 notation for this structure is as follows. <pre>{@code Name ::= CHOICE { RDNSequence }

Members

Functions

getEncoded
byte[] getEncoded()

Returns the distinguished name in ASN.1 DER encoded form. The ASN.1 notation for this structure is supplied in the documentation for {@link #X500Principal(byte[] name) X500Principal(byte[] name)}.

getName
string getName()

Returns a string representation of the X.500 distinguished name using the format defined in RFC 2253.

getName
string getName(string format)

Returns a string representation of the X.500 distinguished name using the specified format. Valid values for the format are "RFC1779", "RFC2253", and "CANONICAL" (case insensitive).

getName
string getName(string format, Map!(string, string) oidMap)

Returns a string representation of the X.500 distinguished name using the specified format. Valid values for the format are "RFC1779" and "RFC2253" (case insensitive). "CANONICAL" is not permitted and an {@code IllegalArgumentException} will be thrown.

opEquals
bool opEquals(Object o)

Compares the specified {@code Object} with this {@code X500Principal} for equality.

toHash
size_t toHash()

Return a hash code for this {@code X500Principal}.

toString
string toString()

Return a user-friendly string representation of this {@code X500Principal}.

Variables

CANONICAL
enum string CANONICAL;

Canonical string format of Distinguished Names.

RFC1779
enum string RFC1779;

RFC 1779 string format of Distinguished Names.

RFC2253
enum string RFC2253;

RFC 2253 string format of Distinguished Names.

Inherited Members

From Principal

getName
string getName()

Returns the name of this principal.

Meta