本文整理汇总了Java中java.security.cert.PKIXParameters.getCertStores方法的典型用法代码示例。如果您正苦于以下问题:Java PKIXParameters.getCertStores方法的具体用法?Java PKIXParameters.getCertStores怎么用?Java PKIXParameters.getCertStores使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.security.cert.PKIXParameters
的用法示例。
在下文中一共展示了PKIXParameters.getCertStores方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetCertStores02
import java.security.cert.PKIXParameters; //导入方法依赖的package包/类
/**
* Test #2 for <code>getCertStores()</code> method<br>
* Assertion: returns an immutable <code>List</code>
* of <code>CertStores</code>
* @throws InvalidAlgorithmParameterException
*/
public final void testGetCertStores02() throws Exception {
Set taSet = TestUtils.getTrustAnchorSet();
if (taSet == null) {
fail(getName() + ": not performed (could not create test TrustAnchor set)");
}
PKIXParameters p = new PKIXParameters(taSet);
List cs = p.getCertStores();
try {
// try to modify returned list
cs.add(new Object());
fail("must be immutable");
} catch (Exception e) {
}
}
示例2: CrlRevocationChecker
import java.security.cert.PKIXParameters; //导入方法依赖的package包/类
CrlRevocationChecker(TrustAnchor anchor, PKIXParameters params,
Collection<X509Certificate> certs, boolean onlyEECert)
throws CertPathValidatorException {
mAnchor = anchor;
mParams = params;
mStores = new ArrayList<CertStore>(params.getCertStores());
mSigProvider = params.getSigProvider();
if (certs != null) {
try {
mStores.add(CertStore.getInstance("Collection",
new CollectionCertStoreParameters(certs)));
} catch (Exception e) {
// should never occur but not necessarily fatal, so log it,
// ignore and continue
if (debug != null) {
debug.println("CrlRevocationChecker: " +
"error creating Collection CertStore: " + e);
}
}
}
Date testDate = params.getDate();
mCurrentTime = (testDate != null ? testDate : new Date());
mOnlyEECert = onlyEECert;
init(false);
}