- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.security.GeneralSecurityException
-
- java.security.cert.CertPathValidatorException
-
- 实现的所有接口
-
Serializable
public class CertPathValidatorException extends GeneralSecurityException
一个异常,表示验证证书路径时遇到的各种问题之一。CertPathValidatorException为包装异常提供支持。getCause方法返回引发此异常的throwable(如果有)。CertPathValidatorException还可以包括在抛出异常时验证的证书路径,导致引发异常的证书路径中的证书索引以及导致失败的原因。 使用getCertPath,getIndex和getReason方法来获取这些信息。并发访问
除非另有说明,否则此类中定义的方法不是线程安全的。 需要同时访问单个对象的多个线程应在它们之间进行同步并提供必要的锁定。 每个操作单独对象的多个线程不需要同步。
- 从以下版本开始:
- 1.4
- 另请参见:
-
CertPathValidator, Serialized Form
-
-
嵌套类汇总
嵌套类 变量和类型 类 描述 static classCertPathValidatorException.BasicReasonBasicReason列举了任何类型的证书路径可能无效的潜在原因。static interfaceCertPathValidatorException.Reason验证算法失败的原因。
-
构造方法摘要
构造方法 构造器 描述 CertPathValidatorException()创建一个没有详细消息的CertPathValidatorException。CertPathValidatorException(String msg)使用给定的详细消息创建CertPathValidatorException。CertPathValidatorException(String msg, Throwable cause)创建具有指定详细消息和原因的CertPathValidatorException。CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index)使用指定的详细消息,原因,证书路径和索引创建CertPathValidatorException。CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index, CertPathValidatorException.Reason reason)使用指定的详细消息,原因,证书路径,索引和原因创建CertPathValidatorException。CertPathValidatorException(Throwable cause)创建一个包装指定throwable的CertPathValidatorException。
-
方法摘要
所有方法 实例方法 具体的方法 变量和类型 方法 描述 CertPathgetCertPath()返回抛出异常时验证的证书路径。intgetIndex()返回导致引发异常的证书路径中的证书索引。CertPathValidatorException.ReasongetReason()返回验证失败的原因。
-
-
-
构造方法详细信息
-
CertPathValidatorException
public CertPathValidatorException()
创建一个没有详细消息的CertPathValidatorException。
-
CertPathValidatorException
public CertPathValidatorException(String msg)
使用给定的详细消息创建CertPathValidatorException。 详细消息是描述此特定异常的String。- 参数
-
msg- 详细信息
-
CertPathValidatorException
public CertPathValidatorException(Throwable cause)
创建一个包装指定throwable的CertPathValidatorException。 这允许将任何异常转换为CertPathValidatorException,同时保留有关包装异常的信息,这可能对调试很有用。 详细消息设置为(cause==null ? null : cause.toString())(通常包含原因的类和详细消息)。- 参数
-
cause- 原因(保存以供以后通过getCause()方法检索)。 (允许值为null,表示原因不存在或未知。)
-
CertPathValidatorException
public CertPathValidatorException(String msg, Throwable cause)
创建具有指定详细消息和原因的CertPathValidatorException。- 参数
-
msg- 详细信息 -
cause- 原因(保存以供以后通过getCause()方法检索)。 (允许值为null,表示原因不存在或未知。)
-
CertPathValidatorException
public CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index)
创建具有指定详细消息,原因,证书路径和索引的CertPathValidatorException。- 参数
-
msg- 详细信息(如果没有,null) -
cause- 原因(如果没有null) -
certPath- 遇到错误时正在验证的证书路径 -
index- 导致错误的证书路径中的证书索引(如果不适用,则为-1)。 请注意,CertPath中的证书列表基于零。 - 异常
-
IndexOutOfBoundsException- 如果索引超出范围(index < -1 || (certPath != null && index >= certPath.getCertificates().size()) -
IllegalArgumentException- 如果certPath是null并且index不是-1
-
CertPathValidatorException
public CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index, CertPathValidatorException.Reason reason)
创建具有指定详细消息,原因,证书路径,索引和原因的CertPathValidatorException。- 参数
-
msg- 详细消息(如果没有,null) -
cause- 原因(如果没有null) -
certPath- 遇到错误时正在验证的证书路径 -
index- 导致错误的证书路径中的证书索引(如果不适用,则为-1)。 请注意,CertPath中的证书列表基于零。 -
reason- 验证失败的原因 - 异常
-
IndexOutOfBoundsException- 如果指数超出范围(index < -1 || (certPath != null && index >= certPath.getCertificates().size()) -
IllegalArgumentException- 如果certPath是null并且index不是-1 -
NullPointerException- 如果reason是null - 从以下版本开始:
- 1.7
-
-
方法详细信息
-
getCertPath
public CertPath getCertPath()
返回抛出异常时验证的证书路径。- 结果
-
的
CertPath(或当抛出异常正被验证的null如果未指定)
-
getIndex
public int getIndex()
返回导致引发异常的证书路径中的证书索引。 请注意,CertPath中的证书列表基于零。 如果未设置索引,则返回-1。- 结果
- 已设置的索引,如果没有设置,则返回-1
-
getReason
public CertPathValidatorException.Reason getReason()
返回验证失败的原因。 原因与getIndex()返回的证书索引相关联。- 结果
-
验证失败的原因,或
BasicReason.UNSPECIFIED如果未指定原因) - 从以下版本开始:
- 1.7
-
-