Java安全编程:加密、密钥管理与认证机制详解
1. CertStore参数与选择器
1.1 CertStore参数
类型参数代表存储库类型的名称,如LDAP或Java集合的Collection。特定的 CertStoreParameters
针对每种存储库类型。可使用以下方法检索初始化 CertStore
的参数:
public final CertStoreParameters getCertStoreParameters()
1.2 选择器概念
为从 CertStore
中检索证书和CRL,引入了选择器的概念。选择器定义了选择一组证书或CRL的标准。提供以下方法来选择并返回一组证书或CRL:
public final Collection getCertificates(CertSelector selector) throws CertStoreException
public final Collection getCRLs(CRLSelector selector) throws CertStoreException
每个方法返回其对应对象的集合。选择器接口都定义了一个名为 match
的方法,该方法接受一个证书或CRL,如果指定对象符合某些标准则返回 true
,否则返回