public abstract class CertStoreSpi
extends Object
| java.lang.Object | |
| java.security.cert.CertStoreSpi | |
CertStore类的 ( SPI )。 所有的CertStore实现都必须包含一个扩展这个类的类(SPI类)( CertStoreSpi ),为构造函数提供了一个类型为CertStoreParameters参数,并实现了它的所有方法。 一般而言,只能通过CertStore类访问此类的实例。 有关详细信息,请参阅Java加密体系结构。
并发访问
所有CertStoreSpi对象的公共方法必须是线程安全的。 也就是说,多个线程可以同时在单个CertStoreSpi对象(或多个对象)上调用这些方法,而不会产生不良影响。 例如,这允许CertPathBuilder搜索CRL,同时搜索更多证书。
简单的CertStoreSpi实现可能会通过在其engineGetCertificates和engineGetCRLs方法中添加synchronized关键字来确保线程安全。 更复杂的可能允许真正的并发访问。
Public constructors |
|
|---|---|
CertStoreSpi(CertStoreParameters params) 唯一的构造函数。 |
|
公共方法(Public methods) |
|
|---|---|
abstract Collection<? extends CRL> |
engineGetCRLs(CRLSelector selector) 返回与指定选择器匹配的 |
abstract Collection<? extends Certificate> |
engineGetCertificates(CertSelector selector) 返回与指定选择器匹配的 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
CertStoreSpi (CertStoreParameters params)
唯一的构造函数。
| 参数(Parameters) | |
|---|---|
params |
CertStoreParameters: the initialization parameters (may be null) |
| 抛出异常(Throws) | |
|---|---|
InvalidAlgorithmParameterException |
if the initialization parameters are inappropriate for this CertStoreSpi |
Collection<? extends CRL> engineGetCRLs (CRLSelector selector)
返回与指定选择器匹配的Collection个CRL 。 如果没有CRL与选择器匹配,则会返回一个空的Collection 。
对于某些CertStore类型,生成的Collection可能不包含与选择器匹配的所有 CRL 。 例如,LDAP CertStore可能不会搜索目录中的所有条目。 相反,它可能只是搜索可能包含它正在寻找的CRL的条目。
一些CertStore实现(尤其是LDAP CertStore )可能会抛出CertStoreException除非提供了包含可用于查找CRL的特定条件的非空CRLSelector 。 发行人名称和/或要检查的证书特别有用。
| 参数(Parameters) | |
|---|---|
selector |
CRLSelector: A CRLSelector used to select which CRLs should be returned. Specify null to return all CRLs (if supported). |
| 返回(Returns) | |
|---|---|
Collection<? extends CRL> |
A Collection of CRLs that match the specified selector (never null) |
| 抛出异常(Throws) | |
|---|---|
CertStoreException |
if an exception occurs |
Collection<? extends Certificate> engineGetCertificates (CertSelector selector)
返回与指定选择器匹配的Collection个Certificate 。 如果没有Certificate与选择器匹配,则返回一个空的Collection 。
对于某些CertStore类型,生成的Collection可能不包含匹配选择器的所有 Certificate 。 例如,LDAP CertStore可能不会搜索目录中的所有条目。 相反,它可能只是搜索可能包含正在查找的Certificate的条目。
某些CertStore实现(特别是LDAP CertStore )可能会抛出CertStoreException除非提供了包含可用于查找证书的特定条件的非空CertSelector 。 发行人和/或主题名称是特别有用的标准。
| 参数(Parameters) | |
|---|---|
selector |
CertSelector: A CertSelector used to select which Certificates should be returned. Specify null to return all Certificates (if supported). |
| 返回(Returns) | |
|---|---|
Collection<? extends Certificate> |
A Collection of Certificates that match the specified selector (never null) |
| 抛出异常(Throws) | |
|---|---|
CertStoreException |
if an exception occurs |