模块 java.base

类 CertStoreSpi

java.lang.Object
java.security.cert.CertStoreSpi

public abstract class CertStoreSpi extends Object
服务提供商接口 (SPICertStore 类。所有 CertStore 实现都必须包含一个扩展此类 (CertStoreSpi ) 的类(SPI 类),提供具有类型为 CertStoreParameters 的单个参数的构造函数,并实现其所有方法。通常,此类的实例只能通过 CertStore 类访问。有关详细信息,请参阅 Java 密码体系结构。

并发访问

所有 CertStoreSpi 对象的公共方法必须是线程安全的。也就是说,多个线程可以在单个 CertStoreSpi 对象(或多个)上同时调用这些方法,而不会产生不良影响。例如,这允许 CertPathBuilder 搜索 CRL,同时搜索更多证书。

简单的 CertStoreSpi 实现可能会通过向其 engineGetCertificatesengineGetCRLs 方法添加 synchronized 关键字来确保线程安全。更复杂的可能允许真正的并发访问。

自从:
1.4
  • 构造方法详细信息

  • 方法详情

    • engineGetCertificates

      public abstract Collection <? extends Certificate > engineGetCertificates(CertSelector  selector) throws CertStoreException
      返回与指定选择器匹配的 Collection 个,共 Certificate 个。如果没有 Certificate 与选择器匹配,将返回一个空的 Collection

      对于某些 CertStore 类型,生成的 Collection 可能不包含all与选择器匹配的 Certificate 。例如,LDAP CertStore 可能不会搜索目录中的所有条目。相反,它可能只搜索可能包含它正在寻找的 Certificate 的条目。

      某些 CertStore 实现(尤其是 LDAP CertStore s)可能会抛出 CertStoreException 除非提供非空 CertSelector 包含可用于查找证书的特定标准。发行者和/或主题名称是特别有用的标准。

      参数:
      selector - A CertSelector 用于选择应返回哪些 Certificate s。指定 null 以返回所有 Certificate s(如果支持)。
      返回:
      与指定选择器匹配的 Certificate 中的 Collection (从不匹配 null
      抛出:
      CertStoreException - 如果发生异常
    • engineGetCRLs

      public abstract Collection <? extends CRL > engineGetCRLs(CRLSelector  selector) throws CertStoreException
      返回与指定选择器匹配的 CollectionCRL 个。如果没有 CRL 与选择器匹配,将返回一个空的 Collection

      对于某些 CertStore 类型,生成的 Collection 可能不包含all与选择器匹配的 CRL s。例如,LDAP CertStore 可能不会搜索目录中的所有条目。相反,它可能只搜索可能包含它正在寻找的 CRL 的条目。

      某些 CertStore 实现(尤其是 LDAP CertStore s)可能会抛出 CertStoreException 除非提供非空 CRLSelector,其中包含可用于查找 CRL 的特定标准。颁发者名称和/或要检查的证书特别有用。

      参数:
      selector - 用于选择应返回哪些 CRLCRLSelector。指定 null 以返回所有 CRL s(如果支持)。
      返回:
      与指定选择器匹配的 CRL 中的 Collection (从不匹配 null
      抛出:
      CertStoreException - 如果发生异常