java.security.cert
Class CertPathValidatorException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.security.GeneralSecurityException
              extended by java.security.cert.CertPathValidatorException
All Implemented Interfaces:
Serializable

public class CertPathValidatorException
extends GeneralSecurityException

Indicates a problem while validating a certification path. In addition, it can store the path an index in that path that caused the problem. This class is not thread-safe.

Since:
1.4
See Also:
CertPathValidator, Serialized Form

Constructor Summary
CertPathValidatorException()
          Create an exception without a message.
CertPathValidatorException(String msg)
          Create an exception with a message.
CertPathValidatorException(String msg, Throwable cause)
          Create an exception with a cause and a message.
CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index)
          Create an exception with a cause, message, failed object, and index of failure in that CertPath.
CertPathValidatorException(Throwable cause)
          Create an exception with a cause.
 
Method Summary
 Throwable getCause()
          Get the cause, null if unknown.
 CertPath getCertPath()
          Get the certificate path that had the failure, or null.
 int getIndex()
          Get the index that failed, or -1.
 String getMessage()
          Get the detail message.
 void printStackTrace()
          Print the stack trace to System.err.
 void printStackTrace(PrintStream stream)
          Print the stack trace to a stream.
 void printStackTrace(PrintWriter stream)
          Print the stack trace to a stream.
 String toString()
          Convert this to a string, including its cause.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CertPathValidatorException

public CertPathValidatorException()
Create an exception without a message. The cause may be initialized. The index is set to -1 and the failed CertPath object to null.


CertPathValidatorException

public CertPathValidatorException(String msg)
Create an exception with a message. The cause may be initialized. The index is set to -1 and the failed CertPath object to null.

Parameters:
msg - a message to display with exception

CertPathValidatorException

public CertPathValidatorException(Throwable cause)
Create an exception with a cause. The message will be cause == null ? null : cause.toString(). The index is set to -1 and the failed CertPath object to null.

Parameters:
cause - the cause

CertPathValidatorException

public CertPathValidatorException(String msg,
                                  Throwable cause)
Create an exception with a cause and a message. The index is set to -1 and the failed CertPath object to null.

Parameters:
msg - the message
cause - the cause

CertPathValidatorException

public CertPathValidatorException(String msg,
                                  Throwable cause,
                                  CertPath certPath,
                                  int index)
Create an exception with a cause, message, failed object, and index of failure in that CertPath.

Parameters:
msg - the message
cause - the cause
certPath - the path that was being validated, or null
index - the index of the path, or -1
Throws:
IndexOutOfBoundsException - if index is < -1 or > certPath.getCertificates().size()
IllegalArgumentException - if certPath is null but index != -1
Method Detail

getMessage

public String getMessage()
Get the detail message.

Overrides:
getMessage in class Throwable
Returns:
the detail message

getCertPath

public CertPath getCertPath()
Get the certificate path that had the failure, or null.

Returns:
the culprit path

getIndex

public int getIndex()
Get the index that failed, or -1.

Returns:
the colprit index

getCause

public Throwable getCause()
Get the cause, null if unknown.

Overrides:
getCause in class Throwable
Returns:
the cause

toString

public String toString()
Convert this to a string, including its cause.

Overrides:
toString in class Throwable
Returns:
the string conversion
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)

printStackTrace

public void printStackTrace()
Print the stack trace to System.err.

Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream stream)
Print the stack trace to a stream.

Overrides:
printStackTrace in class Throwable
Parameters:
stream - the stream

printStackTrace

public void printStackTrace(PrintWriter stream)
Print the stack trace to a stream.

Overrides:
printStackTrace in class Throwable
Parameters:
stream - the stream