Condividi tramite


PKIXBuilderParameters.MaxPathLength Property

Definition

Returns the value of the maximum number of intermediate non-self-issued certificates that may exist in a certification path. -or- Sets the value of the maximum number of non-self-issued intermediate certificates that may exist in a certification path.

public virtual int MaxPathLength { [Android.Runtime.Register("getMaxPathLength", "()I", "GetGetMaxPathLengthHandler")] get; [Android.Runtime.Register("setMaxPathLength", "(I)V", "GetSetMaxPathLength_IHandler")] set; }
[<get: Android.Runtime.Register("getMaxPathLength", "()I", "GetGetMaxPathLengthHandler")>]
[<set: Android.Runtime.Register("setMaxPathLength", "(I)V", "GetSetMaxPathLength_IHandler")>]
member this.MaxPathLength : int with get, set

Property Value

the maximum number of non-self-issued intermediate certificates that may exist in a certification path, or -1 if there is no limit

Attributes

Exceptions

if maxPathLength is less than -1.

Remarks

Property getter documentation:

Returns the value of the maximum number of intermediate non-self-issued certificates that may exist in a certification path. See the #setMaxPathLength method for more details.

Java documentation for java.security.cert.PKIXBuilderParameters.getMaxPathLength().

Property setter documentation:

Sets the value of the maximum number of non-self-issued intermediate certificates that may exist in a certification path. A certificate is self-issued if the DNs that appear in the subject and issuer fields are identical and are not empty. Note that the last certificate in a certification path is not an intermediate certificate, and is not included in this limit. Usually the last certificate is an end entity certificate, but it can be a CA certificate. A PKIX CertPathBuilder instance must not build paths longer than the length specified.

A value of 0 implies that the path can only contain a single certificate. A value of -1 implies that the path length is unconstrained (i.e. there is no maximum). The default maximum path length, if not specified, is 5. Setting a value less than -1 will cause an exception to be thrown.

If any of the CA certificates contain the BasicConstraintsExtension, the value of the pathLenConstraint field of the extension overrides the maximum path length parameter whenever the result is a certification path of smaller length.

Java documentation for java.security.cert.PKIXBuilderParameters.setMaxPathLength(int).

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