Class 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 CertPathValidatorException may optionally include the certification path instance that failed the validation and the index of the failed certificate.

    See Also:
    Serialized Form
    • Constructor Detail

      • CertPathValidatorException

        public 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.
        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.
      • CertPathValidatorException

        public CertPathValidatorException​(String msg,
                                          Throwable cause)
        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.
      • CertPathValidatorException

        public CertPathValidatorException​(Throwable cause)
        Creates a new CertPathValidatorException with the specified cause.
        Parameters:
        cause - the cause why the path could not be validated.
      • CertPathValidatorException

        public CertPathValidatorException​(String msg)
        Creates a new CertPathValidatorException with the specified message.
        Parameters:
        msg - the detail message for this exception.
      • CertPathValidatorException

        public CertPathValidatorException()
        Creates a new CertPathValidatorException.
    • Method Detail

      • getCertPath

        public CertPath getCertPath()
        Returns the certification path that failed validation.
        Returns:
        the certification path that failed validation, or null if 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 -1 if none was specified.