public class CertStore extends Object
Certificates和
CRLs类。
该类使用基于提供程序的架构。创建一个CertStore,调用一个静态getInstance方法,通过在CertStore类型所需的任何适用的初始化参数的名称和可选的供应商的期望。
一旦CertStore已经建立,它可以通过调用它的getCertificates和getCRLs方法检索Certificates和CRLs。
不像KeyStore,它提供了访问缓存的私钥和证书信任,一CertStore旨在提供一个潜在的巨大的资源库不受信任的证书和CRL。例如,对CertStore LDAP实现提供了访问存储在一个或多个目录的证书和CRL使用LDAP协议和架构在RFC服务属性定义。
java平台的每种实现都要求支持以下标准CertStore型:
Collection并发访问
CertStore所有公共方法的对象必须是线程安全的。就是说,多个线程可以同时在一个单一的CertStore对象调用这些方法(或多个)无不良影响。这允许一个CertPathBuilder寻找CRL同时搜索进一步证明,例如。
这个类的静态方法也保证是线程安全的。多线程可以同时调用在这个类中定义的静态方法,没有任何不良影响。
| Modifier | Constructor and Description |
|---|---|
protected |
CertStore(CertStoreSpi storeSpi, Provider provider, String type, CertStoreParameters params)
创建一个
CertStore给定类型的对象,并封装了提供程序实现(SPI对象)在这。
|
| Modifier and Type | Method and Description |
|---|---|
Collection<? extends Certificate> |
getCertificates(CertSelector selector)
返回一个
Collection,指定选择器匹配
Certificates。
|
CertStoreParameters |
getCertStoreParameters()
返回用于初始化这个
CertStore参数。
|
Collection<? extends CRL> |
getCRLs(CRLSelector selector)
返回一个
Collection,指定选择器匹配
CRLs。
|
static String |
getDefaultType()
返回默认
CertStore型的
certstore.type安全属性中指定,或字符串“LDAP”如果没有这种属性的存在。
|
static CertStore |
getInstance(String type, CertStoreParameters params)
返回一个实现指定
CertStore类型与指定的参数初始化
CertStore对象。
|
static CertStore |
getInstance(String type, CertStoreParameters params, Provider provider)
返回一个实现指定
CertStore型
CertStore对象。
|
static CertStore |
getInstance(String type, CertStoreParameters params, String provider)
返回一个实现指定
CertStore型
CertStore对象。
|
Provider |
getProvider()
返回该
CertStore提供者。
|
String |
getType()
返回该
CertStore类型。
|
protected CertStore(CertStoreSpi storeSpi, Provider provider, String type, CertStoreParameters params)
CertStore给定类型的对象,并封装了提供程序实现(SPI对象)在这。
storeSpi -提供程序实现
provider -供应商
type -类型
params -初始化参数(可能是
null)
public final Collection<? extends Certificate> getCertificates(CertSelector selector) throws CertStoreException
Collection,指定选择器匹配
Certificates。如果没有
Certificates选择器匹配,将返回空
Collection。
对于一些CertStore类型,由此产生的Collection可能不包含全部的的Certificates选择器匹配。例如,一个LDAP CertStore可能不在目录中搜索所有条目。相反,它可能只是搜索条目可能包含Certificates是寻找。
一些CertStore实现(尤其是LDAP CertStores)可以把一个CertStoreException除非提供一个非空的CertSelector包含特定的标准,可以用来寻找证书。发行人和/或主题的名称是特别有用的标准。
selector -
CertSelector用来选择
Certificates应该归还。指定返回所有
Certificates
null(如果支持的话)。
Collection,指定选择器匹配
Certificates(不
null)
CertStoreException -如果发生异常
public final Collection<? extends CRL> getCRLs(CRLSelector selector) throws CertStoreException
Collection,指定选择器匹配
CRLs。如果没有
CRLs选择器匹配,将返回空
Collection。
对于一些CertStore类型,由此产生的Collection可能不包含的CRLs选择器匹配的全部的。例如,一个LDAP CertStore可能不在目录中搜索所有条目。相反,它可能只是搜索条目可能包含CRLs是寻找。
一些CertStore实现(尤其是LDAP CertStores)可以把一个CertStoreException除非非空CRLSelector提供包括具体的标准,可以用来寻找CRL。发行人的名称和/或要检查的证书是特别有用的。
selector -
CRLSelector用来选择
CRLs应该归还。指定返回所有
CRLs
null(如果支持的话)。
Collection,指定选择器匹配
CRLs(不
null)
CertStoreException -如果发生异常
public static CertStore getInstance(String type, CertStoreParameters params) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
CertStore类型与指定的参数初始化
CertStore对象。
该方法通过注册安全提供商列表,从最开始的首选供应商。一个新的certstore对象封装certstorespi实施支持指定类型的第一个提供程序返回。
注意,注册商的列表可以通过Security.getProviders()检索方法。
的CertStore,返回与指定的CertStoreParameters初始化。所需的参数类型可能不同CertStores之间变化。注意,指定的CertStoreParameters对象克隆。
type -要求的
CertStore类型的名称。看到有关标准类型的信息在
Java Cryptography Architecture Standard Algorithm Name Documentation的certstore节。
params -初始化参数(可能是
null)。
CertStore型
CertStore对象。
NoSuchAlgorithmException -如果没有供应商的支持为指定的类型certstorespi实施。
InvalidAlgorithmParameterException -如果指定初始化参数,这是不合适的
CertStore。
Provider
public static CertStore getInstance(String type, CertStoreParameters params, String provider) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException
CertStore对象实现指定的
CertStore型。
一个新的certstore对象封装certstorespi实现从指定的提供程序返回。指定的提供程序必须在安全提供程序列表中注册。
注意,注册商的列表可以通过Security.getProviders()检索方法。
的CertStore,返回与指定的CertStoreParameters初始化。所需的参数类型可能不同CertStores之间变化。注意,指定的CertStoreParameters对象克隆。
type -要求的
CertStore型。看到有关标准类型的信息在
Java Cryptography Architecture Standard Algorithm Name Documentation的certstore节。
params -初始化参数(可能是
null)。
provider -提供者的名称。
CertStore指定类型的对象。
NoSuchAlgorithmException -如果一个指定类型的certstorespi执行不可从指定的供应商。
InvalidAlgorithmParameterException -如果指定初始化参数,这是不合适的
CertStore。
NoSuchProviderException -如果指定的供应商不在安全提供商注册名单。
IllegalArgumentException -如果
provider是null或空。
Provider
public static CertStore getInstance(String type, CertStoreParameters params, Provider provider) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
CertStore型
CertStore对象。
一个新的certstore对象封装certstorespi实现从指定的提供程序对象返回。请注意,指定的提供程序对象不必在提供者列表中注册。
的CertStore,返回与指定的CertStoreParameters初始化。所需的参数类型可能不同CertStores之间变化。注意,指定的CertStoreParameters对象克隆。
type -要求的
CertStore型。看到有关标准类型的信息在
Java Cryptography Architecture Standard Algorithm Name Documentation的certstore节。
params -初始化参数(可能是
null)。
provider -供应商。
CertStore指定类型的对象。
NoSuchAlgorithmException -如果一个指定类型的certstorespi执行不可从指定的提供程序对象。
InvalidAlgorithmParameterException -如果指定初始化参数,这是不合适的
CertStore
IllegalArgumentException -如果
provider是空的。
Provider
public final CertStoreParameters getCertStoreParameters()
CertStore参数。注意,是克隆之前返回的
CertStoreParameters对象。
CertStore(可能
null)
public final String getType()
CertStore类型。
CertStore类型
public final Provider getProvider()
CertStore提供者。
CertStore提供者
public static final String getDefaultType()
CertStore型的
certstore.type安全属性中指定,或字符串“LDAP”如果没有这种属性的存在。
默认CertStore型可以用,不想用一个硬编码的类型时,调用的getInstance方法应用的使用,并要提供一个默认CertStore型如果用户不指定自己的。
默认CertStore型可以通过设置的certstore.type安全属性的值为所需类型的改变。
CertStore型的
certstore.type安全属性中指定,或字符串“LDAP”如果没有这种属性的存在。
security properties
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.