本文整理匯總了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);
}