当前位置: 首页>>代码示例>>Java>>正文


Java PKIXBuilderParameters.getTrustAnchors方法代码示例

本文整理汇总了Java中java.security.cert.PKIXBuilderParameters.getTrustAnchors方法的典型用法代码示例。如果您正苦于以下问题:Java PKIXBuilderParameters.getTrustAnchors方法的具体用法?Java PKIXBuilderParameters.getTrustAnchors怎么用?Java PKIXBuilderParameters.getTrustAnchors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.security.cert.PKIXBuilderParameters的用法示例。


在下文中一共展示了PKIXBuilderParameters.getTrustAnchors方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ForwardBuilder

import java.security.cert.PKIXBuilderParameters; //导入方法依赖的package包/类
/**
 * Initialize the builder with the input parameters.
 *
 * @param params the parameter set used to build a certification path
 */
ForwardBuilder(PKIXBuilderParameters buildParams,
    X500Principal targetSubjectDN, boolean searchAllCertStores,
    boolean onlyEECert)
{
    super(buildParams, targetSubjectDN);

    // populate sets of trusted certificates and subject DNs
    trustAnchors = buildParams.getTrustAnchors();
    trustedCerts = new HashSet<X509Certificate>(trustAnchors.size());
    trustedSubjectDNs = new HashSet<X500Principal>(trustAnchors.size());
    for (TrustAnchor anchor : trustAnchors) {
        X509Certificate trustedCert = anchor.getTrustedCert();
        if (trustedCert != null) {
            trustedCerts.add(trustedCert);
            trustedSubjectDNs.add(trustedCert.getSubjectX500Principal());
        } else {
            trustedSubjectDNs.add(anchor.getCA());
        }
    }
    comparator = new PKIXCertComparator(trustedSubjectDNs);
    this.searchAllCertStores = searchAllCertStores;
    this.onlyEECert = onlyEECert;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:29,代码来源:ForwardBuilder.java

示例2: testPKIXBuilderParametersSetCertSelector03

import java.security.cert.PKIXBuilderParameters; //导入方法依赖的package包/类
/**
 * Test #3 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
 * constructor<br>
 * Assertion: ... the <code>Set</code> is copied to protect against
 * subsequent modifications
 * @throws InvalidAlgorithmParameterException
 */
public final void testPKIXBuilderParametersSetCertSelector03()
    throws InvalidAlgorithmParameterException {
    Set taSet = TestUtils.getTrustAnchorSet();
    if (taSet == null) {
        fail(getName() + ": not performed (could not create test TrustAnchor set)");
    }
    HashSet originalSet = (HashSet)taSet;
    HashSet originalSetCopy = (HashSet)originalSet.clone();
    // create test object using originalSet 
    PKIXBuilderParameters pp =
        new PKIXBuilderParameters(originalSetCopy, null);
    // modify originalSet
    originalSetCopy.clear();
    // check that test object's internal state
    // has not been affected by the above modification
    Set returnedSet = pp.getTrustAnchors();
    assertEquals(originalSet, returnedSet);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:26,代码来源:PKIXBuilderParametersTest.java

示例3: PKIXExtendedParameters

import java.security.cert.PKIXBuilderParameters; //导入方法依赖的package包/类
public PKIXExtendedParameters(PKIXBuilderParameters params,
        Timestamp timestamp, String variant)
        throws InvalidAlgorithmParameterException {
    super(params.getTrustAnchors(), null);
    p = params;
    jarTimestamp = timestamp;
    this.variant = variant;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:PKIXExtendedParameters.java

示例4: testPKIXBuilderParametersSetCertSelector03

import java.security.cert.PKIXBuilderParameters; //导入方法依赖的package包/类
/**
 * Test #3 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
 * constructor<br>
 * Assertion: ... the <code>Set</code> is copied to protect against
 * subsequent modifications
 * @throws InvalidAlgorithmParameterException
 */
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "Verifies null as a CertSelector parameter.",
    method = "PKIXBuilderParameters",
    args = {java.util.Set.class, java.security.cert.CertSelector.class}
)
@SuppressWarnings("unchecked")
public final void testPKIXBuilderParametersSetCertSelector03()
    throws InvalidAlgorithmParameterException {
    Set<TrustAnchor> taSet = TestUtils.getTrustAnchorSet();
    if (taSet == null) {
        fail(getName() + ": not performed (could not create test TrustAnchor set)");
    }
    HashSet<TrustAnchor> originalSet = (HashSet<TrustAnchor>) taSet;
    HashSet<TrustAnchor> originalSetCopy = (HashSet<TrustAnchor>) originalSet
            .clone();
    // create test object using originalSet
    PKIXBuilderParameters pp =
        new PKIXBuilderParameters(originalSetCopy, null);
    // modify originalSet
    originalSetCopy.clear();
    // check that test object's internal state
    // has not been affected by the above modification
    Set returnedSet = pp.getTrustAnchors();
    assertEquals(originalSet, returnedSet);
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:34,代码来源:PKIXBuilderParametersTest.java

示例5: PKIXTimestampParameters

import java.security.cert.PKIXBuilderParameters; //导入方法依赖的package包/类
public PKIXTimestampParameters(PKIXBuilderParameters params,
        Timestamp timestamp) throws InvalidAlgorithmParameterException {
    super(params.getTrustAnchors(), null);
    p = params;
    jarTimestamp = timestamp;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:PKIXTimestampParameters.java


注:本文中的java.security.cert.PKIXBuilderParameters.getTrustAnchors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。