Package java.security.cert
Class CertPathValidatorException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.security.GeneralSecurityException
-
- java.security.cert.CertPathValidatorException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ExtCertPathValidatorException
public class CertPathValidatorException extends GeneralSecurityException
The exception that is thrown when a certification path (or certificate chain) cannot be validated.A
CertPathValidatorExceptionmay optionally include the certification path instance that failed the validation and the index of the failed certificate.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CertPathValidatorException()Creates a newCertPathValidatorException.CertPathValidatorException(String msg)Creates a newCertPathValidatorExceptionwith the specified message.CertPathValidatorException(String msg, Throwable cause)Creates a newCertPathValidatorExceptionwith the specified message and cause.CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index)Creates a newCertPathValidatorExceptionwith the specified message , cause, certification path and certificate index in the certification path.CertPathValidatorException(Throwable cause)Creates a newCertPathValidatorExceptionwith the specified cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CertPathgetCertPath()Returns the certification path that failed validation.intgetIndex()Returns the index of the failed certificate in the certification path.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
CertPathValidatorException
public CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index)
Creates a newCertPathValidatorExceptionwith 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- ifcertPathisnulland index is not-1.IndexOutOfBoundsException- ifcertPathis notnulland index is not referencing an certificate in the certification path.
-
CertPathValidatorException
public CertPathValidatorException(String msg, Throwable cause)
Creates a newCertPathValidatorExceptionwith the specified message and cause.- Parameters:
msg- the detail message for this exception.cause- the cause why the path could not be validated.
-
CertPathValidatorException
public CertPathValidatorException(Throwable cause)
Creates a newCertPathValidatorExceptionwith the specified cause.- Parameters:
cause- the cause why the path could not be validated.
-
CertPathValidatorException
public CertPathValidatorException(String msg)
Creates a newCertPathValidatorExceptionwith the specified message.- Parameters:
msg- the detail message for this exception.
-
CertPathValidatorException
public CertPathValidatorException()
Creates a newCertPathValidatorException.
-
-
Method Detail
-
getCertPath
public CertPath getCertPath()
Returns the certification path that failed validation.- Returns:
- the certification path that failed validation, or
nullif none was specified.
-
getIndex
public int getIndex()
Returns the index of the failed certificate in the certification path.- Returns:
- the index of the failed certificate in the certification path, or
-1if none was specified.
-
-