public class CertPathValidatorException extends GeneralSecurityException
A CertPathValidatorException提供对包装异常的支持。 getCause方法返回引发此异常抛出的throwable(如果有)。
CertPathValidatorException还可以包括在引发异常时验证的认证路径,导致异常抛出的认证路径中的证书索引以及导致失败的原因。 使用getCertPath , getIndex和getReason方法来获取这些信息。
并发访问
除非另有说明,否则此类中定义的方法不是线程安全的。 需要同时访问单个对象的多个线程应在其间同步并提供必要的锁定。 每个操作单独对象的多个线程不需要同步。
CertPathValidator , Serialized Form
| Modifier and Type | Class and Description |
|---|---|
static class |
CertPathValidatorException.BasicReason
BasicReason列举了任何类型的认证路径可能无效的潜在原因。
|
static interface |
CertPathValidatorException.Reason
验证算法失败的原因。
|
| Constructor and Description |
|---|
CertPathValidatorException()
创建一个没有详细消息的
CertPathValidatorException 。
|
CertPathValidatorException(String msg)
使用给定的详细信息创建一个
CertPathValidatorException 。
|
CertPathValidatorException(String msg, Throwable cause)
创建具有
CertPathValidatorException的详细消息和原因的CertPathValidatorException。
|
CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index)
创建具有
CertPathValidatorException的详细消息,原因,认证路径和索引的CertPathValidatorException。
|
CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index, CertPathValidatorException.Reason reason)
创建具有
CertPathValidatorException的详细消息,原因,认证路径,索引和原因的CertPathValidatorException。
|
CertPathValidatorException(Throwable cause)
创建一个
CertPathValidatorException ,它包装指定的抛出。
|
| Modifier and Type | Method and Description |
|---|---|
CertPath |
getCertPath()
返回在抛出异常时验证的认证路径。
|
int |
getIndex()
返回导致异常抛出的认证路径中的证书的索引。
|
CertPathValidatorException.Reason |
getReason()
返回验证失败的原因。
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic CertPathValidatorException()
CertPathValidatorException 。
public CertPathValidatorException(String msg)
CertPathValidatorException 。
详细消息是一个String描述这个特定异常。
msg - 详细信息
public CertPathValidatorException(Throwable cause)
CertPathValidatorException ,它包装指定的抛出。
这允许将任何异常转换为CertPathValidatorException ,同时保留关于包装异常的信息,这可能对调试有用。
详细消息设置为( cause==null ? null : cause.toString() )(其通常包含原因的类和详细消息)。
cause - 原因(由getCause()方法保存供以后检索)。
(A null值,并表示原因不存在或未知。)
public CertPathValidatorException(String msg, Throwable cause)
CertPathValidatorException带指定详细消息和原因。
msg - 详细信息
cause - 原因(保存以供稍后通过getCause()方法检索 )。
(A null值是允许的,并且表示原因不存在或未知。)
public CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index)
CertPathValidatorException的详细消息,原因,认证路径和索引的CertPathValidatorException。
msg - 详细信息(或
null如果没有)
cause - 原因(或
null如果没有)
certPath - 当遇到错误时正在验证的认证路径
index - 导致错误的认证路径中的证书索引(或-1(如果不适用))。
请注意,CertPath中的CertPath列表为零。
IndexOutOfBoundsException - 如果索引超出范围
(index < -1 || (certPath != null && index >= certPath.getCertificates().size())
IllegalArgumentException - 如果
certPath是
null和
index不是-1
public CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index, CertPathValidatorException.Reason reason)
CertPathValidatorException的详细消息,原因,认证路径,索引和原因的CertPathValidatorException。
msg - 详细信息(或
null如果没有)
cause - 原因(或
null如果没有)
certPath - 遇到错误时正在验证的认证路径
index - 导致错误的认证路径中的证书索引(或-1如果不适用)。
请注意,CertPath中的CertPath列表为零。
reason - 验证失败的原因
IndexOutOfBoundsException - 如果索引超出范围
(index < -1 || (certPath != null && index >= certPath.getCertificates().size())
IllegalArgumentException - 如果
certPath是
null和
index不是-1
NullPointerException - 如果
reason是
null
public CertPath getCertPath()
CertPath (或当抛出异常正被验证的
null如果未指定)
public int getIndex()
CertPath列表为零。
如果没有设置索引,则返回-1。
public CertPathValidatorException.Reason getReason()
BasicReason.UNSPECIFIED如果没有指定原因
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.