to top
Android APIs
public class

CertPathValidatorException

extends GeneralSecurityException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.security.GeneralSecurityException
         ↳ java.security.cert.CertPathValidatorException

Class Overview

The exception that is thrown when a certification path (or certificate chain) cannot be validated.

A CertPathValidatorException may optionally include the certification path instance that failed the validation and the index of the failed certificate.

Summary

Public Constructors
CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index)
Creates a new CertPathValidatorException with the specified message , cause, certification path and certificate index in the certification path.
CertPathValidatorException(String msg, Throwable cause)
Creates a new CertPathValidatorException with the specified message and cause.
CertPathValidatorException(Throwable cause)
Creates a new CertPathValidatorException with the specified cause.
CertPathValidatorException(String msg)
Creates a new CertPathValidatorException with the specified message.
CertPathValidatorException()
Creates a new CertPathValidatorException.
Public Methods
CertPath getCertPath()
Returns the certification path that failed validation.
int getIndex()
Returns the index of the failed certificate in the certification path.
[Expand]
Inherited Methods
From class java.lang.Throwable
From class java.lang.Object

Public Constructors

public CertPathValidatorException (String msg, Throwable cause, CertPath certPath, int index)

Since: API Level 1

Creates a new CertPathValidatorException with the specified message , cause, certification path and certificate index in the certification path.

Parameters
msg the detail message for this exception.
cause the cause.
certPath the certification path that failed the validation.
index the index of the failed certificate.
Throws
IllegalArgumentException if certPath is null and index is not -1.
IndexOutOfBoundsException if certPath is not null and index is not referencing an certificate in the certification path.

public CertPathValidatorException (String msg, Throwable cause)

Since: API Level 1

Creates a new CertPathValidatorException with the specified message and cause.

Parameters
msg the detail message for this exception.
cause the cause why the path could not be validated.

public CertPathValidatorException (Throwable cause)

Since: API Level 1

Creates a new CertPathValidatorException with the specified cause.

Parameters
cause the cause why the path could not be validated.

public CertPathValidatorException (String msg)

Since: API Level 1

Creates a new CertPathValidatorException with the specified message.

Parameters
msg the detail message for this exception.

public CertPathValidatorException ()

Since: API Level 1

Creates a new CertPathValidatorException.

Public Methods

public CertPath getCertPath ()

Since: API Level 1

Returns the certification path that failed validation.

Returns
  • the certification path that failed validation, or null if none was specified.

public int getIndex ()

Since: API Level 1

Returns the index of the failed certificate in the certification path.

Returns
  • the index of the failed certificate in the certification path, or -1 if none was specified.