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


Java CertSelector类代码示例

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


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

示例1: engineGetCertificates

import java.security.cert.CertSelector; //导入依赖的package包/类
public Collection engineGetCertificates(CertSelector certSelector)
    throws CertStoreException
{
    boolean searchAllStores = params.getSearchAllStores();
    Iterator iter = params.getCertStores().iterator();
    List allCerts = searchAllStores ? new ArrayList() : Collections.EMPTY_LIST;

    while (iter.hasNext())
    {
        CertStore store = (CertStore)iter.next();
        Collection certs = store.getCertificates(certSelector);

        if (searchAllStores)
        {
            allCerts.addAll(certs);
        }
        else if (!certs.isEmpty())
        {
            return certs;
        }
    }

    return allCerts;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:MultiCertStoreSpi.java

示例2: if

import java.security.cert.CertSelector; //导入依赖的package包/类
/**
 * Iterates over the specified Collection of X509Certificates and
 * returns only those that match the criteria specified in the
 * CertSelector.
 */
private static Collection<X509Certificate> getMatchingCerts
    (Collection<X509Certificate> certs, CertSelector selector) {
    // if selector not specified, all certs match
    if (selector == null) {
        return certs;
    }
    List<X509Certificate> matchedCerts =
        new ArrayList<X509Certificate>(certs.size());
    for (X509Certificate cert : certs) {
        if (selector.match(cert)) {
            matchedCerts.add(cert);
        }
    }
    return matchedCerts;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:21,代码来源:URICertStore.java

示例3: getCertificates

import java.security.cert.CertSelector; //导入依赖的package包/类
public static Collection<? extends Certificate> getCertificates(final PKIXCertStoreSelector selector, CertStore certStore)
    throws CertStoreException
{
    return certStore.getCertificates(new CertSelector()
    {
        public boolean match(Certificate certificate)
        {
            return (selector == null) ? true : selector.match(certificate);
        }

        public Object clone()
        {
            return this;
        }
    });
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:17,代码来源:PKIXCertStoreSelector.java

示例4: if

import java.security.cert.CertSelector; //导入依赖的package包/类
/**
 * Iterates over the specified Collection of X509Certificates and
 * returns only those that match the criteria specified in the
 * CertSelector.
 */
private static Collection<X509Certificate> getMatchingCerts
    (Collection<X509Certificate> certs, CertSelector selector) {
    // if selector not specified, all certs match
    if (selector == null) {
        return certs;
    }
    List<X509Certificate> matchedCerts = new ArrayList<>(certs.size());
    for (X509Certificate cert : certs) {
        if (selector.match(cert)) {
            matchedCerts.add(cert);
        }
    }
    return matchedCerts;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:URICertStore.java

示例5: if

import java.security.cert.CertSelector; //导入依赖的package包/类
private static List<X509Certificate> getMatchingCerts
    (List<X509Certificate> certs, CertSelector selector)
{
    // if selector not specified, all certs match
    if (selector == null) {
        return certs;
    }
    List<X509Certificate> matchedCerts = new ArrayList<>(certs.size());
    for (X509Certificate cert : certs) {
        if (selector.match(cert)) {
            matchedCerts.add(cert);
        }
    }
    return matchedCerts;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:SSLServerCertStore.java

示例6: setTargetCertConstraints

import java.security.cert.CertSelector; //导入依赖的package包/类
@Override
public void setTargetCertConstraints(CertSelector selector) {
    // To avoid problems with PKIXBuilderParameter's constructors
    if (p == null) {
        return;
    }
    p.setTargetCertConstraints(selector);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:PKIXTimestampParameters.java

示例7: keyStoreSelect

import java.security.cert.CertSelector; //导入依赖的package包/类
/**
 * Searches the specified keystore for a certificate that matches the
 * criteria specified in the CertSelector.
 *
 * @return a KeySelectorResult containing the cert's public key if there
 *   is a match; otherwise null
 */
private KeySelectorResult keyStoreSelect(CertSelector cs)
    throws KeyStoreException {
    Enumeration<String> aliases = ks.aliases();
    while (aliases.hasMoreElements()) {
        String alias = aliases.nextElement();
        Certificate cert = ks.getCertificate(alias);
        if (cert != null && cs.match(cert)) {
            return new SimpleKeySelectorResult(cert.getPublicKey());
        }
    }
    return null;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:X509KeySelector.java


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