Partager via


CertPathValidator Class

Definition

A class for validating certification paths (also known as certificate chains).

[Android.Runtime.Register("java/security/cert/CertPathValidator", DoNotGenerateAcw=true)]
public class CertPathValidator : Java.Lang.Object
[<Android.Runtime.Register("java/security/cert/CertPathValidator", DoNotGenerateAcw=true)>]
type CertPathValidator = class
    inherit Object
Inheritance
CertPathValidator
Attributes

Remarks

A class for validating certification paths (also known as certificate chains).

This class uses a provider-based architecture. To create a CertPathValidator, call one of the static getInstance methods, passing in the algorithm name of the CertPathValidator desired and optionally the name of the provider desired.

Once a CertPathValidator object has been created, it can be used to validate certification paths by calling the #validate validate method and passing it the CertPath to be validated and an algorithm-specific set of parameters. If successful, the result is returned in an object that implements the CertPathValidatorResult interface.

The #getRevocationChecker method allows an application to specify additional algorithm-specific parameters and options used by the CertPathValidator when checking the revocation status of certificates. Here is an example demonstrating how it is used with the PKIX algorithm:

CertPathValidator cpv = CertPathValidator.getInstance("PKIX");
            PKIXRevocationChecker rc = (PKIXRevocationChecker)cpv.getRevocationChecker();
            rc.setOptions(EnumSet.of(Option.SOFT_FAIL));
            params.addCertPathChecker(rc);
            CertPathValidatorResult cpvr = cpv.validate(path, params);

Every implementation of the Java platform is required to support the following standard CertPathValidator algorithm: <ul> <li>PKIX</li> </ul> This algorithm is described in the CertPathValidator section of the Java Security Standard Algorithm Names Specification. Consult the release documentation for your implementation to see if any other algorithms are supported.

<b>Concurrent Access</b>

The static methods of this class are guaranteed to be thread-safe. Multiple threads may concurrently invoke the static methods defined in this class with no ill effects.

However, this is not true for the non-static methods defined by this class. Unless otherwise documented by a specific provider, threads that need to access a single CertPathValidator instance concurrently should synchronize amongst themselves and provide the necessary locking. Multiple threads each manipulating a different CertPathValidator instance need not synchronize.

Added in 1.4.

Java documentation for java.security.cert.CertPathValidator.

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.

Constructors

CertPathValidator(CertPathValidatorSpi, Provider, String)

Creates a CertPathValidator object of the given algorithm, and encapsulates the given provider implementation (SPI object) in it.

CertPathValidator(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Algorithm

Returns the algorithm name of this CertPathValidator.

Class

Returns the runtime class of this Object.

(Inherited from Object)
DefaultType

Returns the default CertPathValidator type as specified by the certpathvalidator.type security property, or the string "PKIX" if no such property exists.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
Provider

Returns the Provider of this CertPathValidator.

RevocationChecker

Returns a CertPathChecker that the encapsulated CertPathValidatorSpi implementation uses to check the revocation status of certificates.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetInstance(String, Provider)

Returns a CertPathValidator object that implements the specified algorithm.

GetInstance(String, String)

Returns a CertPathValidator object that implements the specified algorithm.

GetInstance(String)

Returns a CertPathValidator object that implements the specified algorithm.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Validate(CertPath, ICertPathParameters)

Validates the specified certification path using the specified algorithm parameter set.

Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to