Udostępnij za pośrednictwem


X509CertSelector.AddPathToName Method

Definition

Overloads

AddPathToName(Int32, Byte[])

Adds a name to the pathToNames criterion.

AddPathToName(Int32, String)

Adds a name to the pathToNames criterion.

AddPathToName(Int32, Byte[])

Adds a name to the pathToNames criterion.

[Android.Runtime.Register("addPathToName", "(I[B)V", "GetAddPathToName_IarrayBHandler")]
public virtual void AddPathToName (int type, byte[]? name);
[<Android.Runtime.Register("addPathToName", "(I[B)V", "GetAddPathToName_IarrayBHandler")>]
abstract member AddPathToName : int * byte[] -> unit
override this.AddPathToName : int * byte[] -> unit

Parameters

type
Int32

the name type (0-8, as specified in RFC 5280, section 4.2.1.6)

name
Byte[]

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

Attributes

Exceptions

if decoding fails.

Remarks

Adds a name to the pathToNames criterion. The X509Certificate must not include name constraints that would prohibit building a path to the specified name.

This method allows the caller to add a name to the set of names which the X509Certificates's name constraints must permit. The specified name is added to any previous value for the pathToNames criterion. If the name is a duplicate, it may be ignored.

The name is provided as a byte array. This byte array should contain the DER encoded name, as it would appear in the GeneralName structure defined in RFC 5280 and X.509. The ASN.1 definition of this structure appears in the documentation for #addSubjectAlternativeName(int type, byte [] name) addSubjectAlternativeName(int type, byte [] name).

Note that the byte array supplied here is cloned to protect against subsequent modifications.

Java documentation for java.security.cert.X509CertSelector.addPathToName(int, 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

AddPathToName(Int32, String)

Adds a name to the pathToNames criterion.

[Android.Runtime.Register("addPathToName", "(ILjava/lang/String;)V", "GetAddPathToName_ILjava_lang_String_Handler")]
public virtual void AddPathToName (int type, string? name);
[<Android.Runtime.Register("addPathToName", "(ILjava/lang/String;)V", "GetAddPathToName_ILjava_lang_String_Handler")>]
abstract member AddPathToName : int * string -> unit
override this.AddPathToName : int * string -> unit

Parameters

type
Int32

the name type (0-8, as specified in RFC 5280, section 4.2.1.6)

name
String

the name in string form

Attributes

Exceptions

if parsing fails.

Remarks

Adds a name to the pathToNames criterion. The X509Certificate must not include name constraints that would prohibit building a path to the specified name.

This method allows the caller to add a name to the set of names which the X509Certificates's name constraints must permit. The specified name is added to any previous value for the pathToNames criterion. If the name is a duplicate, it may be ignored.

The name is provided in string format. RFC 822, DNS, and URI names use the well-established string formats for those types (subject to the restrictions included in RFC 5280). IPv4 address names are supplied using dotted quad notation. OID address names are represented as a series of nonnegative integers separated by periods. And directory names (distinguished names) are supplied in RFC 2253 format. No standard string format is defined for otherNames, X.400 names, EDI party names, IPv6 address names, or any other type of names. They should be specified using the #addPathToName(int type, byte [] name) addPathToName(int type, byte [] name) method.

<strong>Note:</strong> for distinguished names, use #addPathToName(int, byte[]) instead. This method should not be relied on as it can fail to match some certificates because of a loss of encoding information in the RFC 2253 String form of some distinguished names.

Java documentation for java.security.cert.X509CertSelector.addPathToName(int, 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