Condividi tramite


X500Principal Constructors

Definition

Overloads

X500Principal(Byte[])

Creates an X500Principal from a distinguished name in ASN.

X500Principal(Stream)

Creates an X500Principal from an InputStream containing the distinguished name in ASN.

X500Principal(String)

Creates an X500Principal from a string representation of an X.

X500Principal(String, IDictionary<String,String>)

Creates an X500Principal from a string representation of an X.

X500Principal(Byte[])

Creates an X500Principal from a distinguished name in ASN.

[Android.Runtime.Register(".ctor", "([B)V", "")]
public X500Principal (byte[]? name);
[<Android.Runtime.Register(".ctor", "([B)V", "")>]
new Javax.Security.Auth.X500.X500Principal : byte[] -> Javax.Security.Auth.X500.X500Principal

Parameters

name
Byte[]

a byte array containing the distinguished name in ASN.1 DER encoded form

Attributes

Exceptions

if the ASN.1 DER-encoded distinguished name is incorrect

Remarks

Creates an X500Principal from a distinguished name in ASN.1 DER encoded form. The ASN.1 notation for this structure is as follows.

{@code
            Name ::= CHOICE {
              RDNSequence }

            RDNSequence ::= SEQUENCE OF RelativeDistinguishedName

            RelativeDistinguishedName ::=
              SET SIZE (1 .. MAX) OF AttributeTypeAndValue

            AttributeTypeAndValue ::= SEQUENCE {
              type     AttributeType,
              value    AttributeValue }

            AttributeType ::= OBJECT IDENTIFIER

            AttributeValue ::= ANY DEFINED BY AttributeType
            ....
            DirectoryString ::= CHOICE {
                  teletexString           TeletexString (SIZE (1..MAX)),
                  printableString         PrintableString (SIZE (1..MAX)),
                  universalString         UniversalString (SIZE (1..MAX)),
                  utf8String              UTF8String (SIZE (1.. MAX)),
                  bmpString               BMPString (SIZE (1..MAX)) }
            }

Java documentation for javax.security.auth.x500.X500Principal.X500Principal(byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

X500Principal(Stream)

Creates an X500Principal from an InputStream containing the distinguished name in ASN.

[Android.Runtime.Register(".ctor", "(Ljava/io/InputStream;)V", "")]
public X500Principal (System.IO.Stream? is);
[<Android.Runtime.Register(".ctor", "(Ljava/io/InputStream;)V", "")>]
new Javax.Security.Auth.X500.X500Principal : System.IO.Stream -> Javax.Security.Auth.X500.X500Principal

Parameters

is
Stream

an InputStream containing the distinguished name in ASN.1 DER encoded form

Attributes

Exceptions

if the ASN.1 DER-encoded distinguished name is incorrect

Remarks

Creates an X500Principal from an InputStream containing the distinguished name in ASN.1 DER encoded form. The ASN.1 notation for this structure is supplied in the documentation for #X500Principal(byte[] name) X500Principal(byte[] name).

The read position of the input stream is positioned to the next available byte after the encoded distinguished name.

Java documentation for javax.security.auth.x500.X500Principal.X500Principal(java.io.InputStream).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

X500Principal(String)

Creates an X500Principal from a string representation of an X.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")]
public X500Principal (string? name);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")>]
new Javax.Security.Auth.X500.X500Principal : string -> Javax.Security.Auth.X500.X500Principal

Parameters

name
String

an X.500 distinguished name in RFC 1779 or RFC 2253 format

Attributes

Exceptions

if the string representation of the distinguished name is incorrect

Remarks

Creates an 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 constructor recognizes the attribute type keywords defined in RFC 1779 and RFC 2253 (and listed in #getName(String format) getName(String format)), as well as the T, DNQ or DNQUALIFIER, SURNAME, GIVENNAME, INITIALS, GENERATION, EMAILADDRESS, and SERIALNUMBER keywords whose Object Identifiers (OIDs) are defined in RFC 3280 and its successor. Any other attribute type must be specified as an OID.

This implementation enforces a more restrictive OID syntax than defined in RFC 1779 and 2253. It uses the more correct syntax defined in RFC 4512, which specifies that OIDs contain at least 2 digits:

numericoid = number 1*( DOT number )

Java documentation for javax.security.auth.x500.X500Principal.X500Principal(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

X500Principal(String, IDictionary<String,String>)

Creates an X500Principal from a string representation of an X.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/util/Map;)V", "")]
public X500Principal (string? name, System.Collections.Generic.IDictionary<string,string>? keywordMap);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/util/Map;)V", "")>]
new Javax.Security.Auth.X500.X500Principal : string * System.Collections.Generic.IDictionary<string, string> -> Javax.Security.Auth.X500.X500Principal

Parameters

name
String

an X.500 distinguished name in RFC 1779 or RFC 2253 format

keywordMap
IDictionary<String,String>

an attribute type keyword map, where each key is a keyword String that maps to a corresponding object identifier in String form (a sequence of nonnegative integers separated by periods). The map may be empty but never null.

Attributes

Remarks

Creates an 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 constructor recognizes the attribute type keywords specified in #X500Principal(String) and also recognizes additional keywords that have entries in the keywordMap parameter. Keyword entries in the keywordMap take precedence over the default keywords recognized by X500Principal(String). Keywords MUST be specified in all upper-case, otherwise they will be ignored. Improperly specified keywords are ignored; however if a keyword in the name maps to an improperly specified Object Identifier (OID), an IllegalArgumentException is thrown. It is permissible to have 2 different keywords that map to the same OID.

This implementation enforces a more restrictive OID syntax than defined in RFC 1779 and 2253. It uses the more correct syntax defined in RFC 4512, which specifies that OIDs contain at least 2 digits:

numericoid = number 1*( DOT number )

Added in 1.6.

Java documentation for javax.security.auth.x500.X500Principal.X500Principal(java.lang.String, java.util.Map<java.lang.String, java.lang.String>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to