public class CertPathValidatorException extends GeneralSecurityException
一个CertPathValidatorException提供异常的包装支持。如果有任何错误,返回getCause方法,造成这种异常被抛出。
一个CertPathValidatorException可能还包括证书路径被验证时抛出异常,在导致引发异常的认证证书路径的指标,而原因导致失败。使用getCertPath,getIndex,和getReason方法检索此信息。
并发访问
除非另有说明,在这个类中定义的方法不是线程安全的。需要访问一个单一对象的多个线程同时应同步,并提供必要的锁。多线程每个操作单独的对象不需要同步。
CertPathValidator,
Serialized Form
| Modifier and Type | Class and Description |
|---|---|
static class |
CertPathValidatorException.BasicReason
根本原因列举了一个任何类型的证书路径可能无效的潜在原因。
|
static interface |
CertPathValidatorException.Reason
验证算法失败的原因。
|
| Constructor and Description |
|---|
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)
创建一个
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()方法检索)。(一
null值是允许的,并指出原因是不存在的或未知的。)
public CertPathValidatorException(String msg, Throwable cause)
CertPathValidatorException。
msg -详细信息
cause的原因(这是以后的
getCause()方法检索)。(一
null值是允许的,并指出原因是不存在的或未知的。)
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
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
null
reason
NullPointerException
public CertPath getCertPath()
CertPath被验证时抛出异常(或
null如果不指定)
public int getIndex()
CertPath证书列表是零基础。如果没有设置索引,-返回1。
public CertPathValidatorException.Reason getReason()
getIndex()。
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.