java.security.cert

Class CertPathValidatorException

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

UNKNOWN: updated to 1.4

Constructor Summary
CertPathValidatorException()
Create an exception without a message.
CertPathValidatorException(String msg)
Create an exception with a message.
CertPathValidatorException(Throwable cause)
Create an exception with a cause.
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.
Method Summary
ThrowablegetCause()
Get the cause, null if unknown.
CertPathgetCertPath()
Get the certificate path that had the failure, or null.
intgetIndex()
Get the index that failed, or -1.
StringgetMessage()
Get the detail message.
voidprintStackTrace()
Print the stack trace to System.err.
voidprintStackTrace(PrintStream stream)
Print the stack trace to a stream.
voidprintStackTrace(PrintWriter stream)
Print the stack trace to a stream.
StringtoString()
Convert this to a string, including its cause.

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

getCause

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

Returns: the cause

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

getMessage

public String getMessage()
Get the detail message.

Returns: the detail message

printStackTrace

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

printStackTrace

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

Parameters: stream the stream

printStackTrace

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

Parameters: stream the stream

toString

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

Returns: the string conversion