类java.security.cert.CertStoreException源码实例Demo

下面列出了怎么用java.security.cert.CertStoreException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: CertStoreHelper.java
static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
    switch (type) {
        case "LDAP":
        case "SSLServer":
            try {
                CertStoreHelper csh = CertStoreHelper.getInstance(type);
                return csh.isCausedByNetworkIssue(cse);
            } catch (NoSuchAlgorithmException nsae) {
                return false;
            }
        case "URI":
            Throwable t = cse.getCause();
            return (t != null && t instanceof IOException);
        default:
            // we don't know about any other remote CertStore types
            return false;
    }
}
 
源代码2 项目: RipplePower   文件: MultiCertStoreSpi.java
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;
}
 
源代码3 项目: jdk8u-jdk   文件: CertStoreHelper.java
static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
    switch (type) {
        case "LDAP":
        case "SSLServer":
            try {
                CertStoreHelper csh = CertStoreHelper.getInstance(type);
                return csh.isCausedByNetworkIssue(cse);
            } catch (NoSuchAlgorithmException nsae) {
                return false;
            }
        case "URI":
            Throwable t = cse.getCause();
            return (t != null && t instanceof IOException);
        default:
            // we don't know about any other remote CertStore types
            return false;
    }
}
 
源代码4 项目: jdk8u-dev-jdk   文件: ReverseBuilder.java
/**
 * Retrieves all certs from the specified CertStores that satisfy the
 * requirements specified in the parameters and the current
 * PKIX state (name constraints, policy constraints, etc).
 *
 * @param currentState the current state.
 *        Must be an instance of <code>ReverseState</code>
 * @param certStores list of CertStores
 */
@Override
Collection<X509Certificate> getMatchingCerts
    (State currState, List<CertStore> certStores)
    throws CertStoreException, CertificateException, IOException
{
    ReverseState currentState = (ReverseState) currState;

    if (debug != null)
        debug.println("In ReverseBuilder.getMatchingCerts.");

    /*
     * The last certificate could be an EE or a CA certificate
     * (we may be building a partial certification path or
     * establishing trust in a CA).
     *
     * Try the EE certs before the CA certs. It will be more
     * common to build a path to an end entity.
     */
    Collection<X509Certificate> certs =
        getMatchingEECerts(currentState, certStores);
    certs.addAll(getMatchingCACerts(currentState, certStores));

    return certs;
}
 
源代码5 项目: RipplePower   文件: PKIXCRLStoreSelector.java
public static Collection<? extends CRL> getCRLs(final PKIXCRLStoreSelector selector, CertStore certStore)
    throws CertStoreException
{
    return certStore.getCRLs(new CRLSelector()
    {
        public boolean match(CRL crl)
        {
            return selector.match(crl);
        }

        public Object clone()
        {
            return this;
        }
    });
}
 
源代码6 项目: openjdk-8   文件: CertStoreHelper.java
static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
    switch (type) {
        case "LDAP":
        case "SSLServer":
            try {
                CertStoreHelper csh = CertStoreHelper.getInstance(type);
                return csh.isCausedByNetworkIssue(cse);
            } catch (NoSuchAlgorithmException nsae) {
                return false;
            }
        case "URI":
            Throwable t = cse.getCause();
            return (t != null && t instanceof IOException);
        default:
            // we don't know about any other remote CertStore types
            return false;
    }
}
 
源代码7 项目: jdk8u60   文件: ReverseBuilder.java
/**
 * Retrieves all certs from the specified CertStores that satisfy the
 * requirements specified in the parameters and the current
 * PKIX state (name constraints, policy constraints, etc).
 *
 * @param currentState the current state.
 *        Must be an instance of <code>ReverseState</code>
 * @param certStores list of CertStores
 */
@Override
Collection<X509Certificate> getMatchingCerts
    (State currState, List<CertStore> certStores)
    throws CertStoreException, CertificateException, IOException
{
    ReverseState currentState = (ReverseState) currState;

    if (debug != null)
        debug.println("In ReverseBuilder.getMatchingCerts.");

    /*
     * The last certificate could be an EE or a CA certificate
     * (we may be building a partial certification path or
     * establishing trust in a CA).
     *
     * Try the EE certs before the CA certs. It will be more
     * common to build a path to an end entity.
     */
    Collection<X509Certificate> certs =
        getMatchingEECerts(currentState, certStores);
    certs.addAll(getMatchingCACerts(currentState, certStores));

    return certs;
}
 
源代码8 项目: openjdk-jdk8u   文件: CertStoreHelper.java
static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
    switch (type) {
        case "LDAP":
        case "SSLServer":
            try {
                CertStoreHelper csh = CertStoreHelper.getInstance(type);
                return csh.isCausedByNetworkIssue(cse);
            } catch (NoSuchAlgorithmException nsae) {
                return false;
            }
        case "URI":
            Throwable t = cse.getCause();
            return (t != null && t instanceof IOException);
        default:
            // we don't know about any other remote CertStore types
            return false;
    }
}
 
源代码9 项目: lams   文件: CertPathPKIXTrustEvaluator.java
/**
 * Determine whether there are any CRL's in the {@link CertStore} that is to be used.
 * 
 * @param certStore the cert store that will be used for validation
 * @return true if the store contains at least 1 CRL instance, false otherwise
 */
protected boolean storeContainsCRLs(CertStore certStore) {
    Collection<? extends CRL> crls = null;
    try {
        //Save some cycles and memory: Collection cert store allows null as specifier to return all.
        //crls = certStore.getCRLs( new X509CRLSelector() );
        crls = certStore.getCRLs(null);
    } catch (CertStoreException e) {
        log.error("Error examining cert store for CRL's, treating as if no CRL's present", e);
        return false;
    }
    if (crls != null && !crls.isEmpty()) {
        return true;
    }
    return false;
}
 
源代码10 项目: openjdk-jdk8u-backup   文件: CertStoreHelper.java
static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
    switch (type) {
        case "LDAP":
        case "SSLServer":
            try {
                CertStoreHelper csh = CertStoreHelper.getInstance(type);
                return csh.isCausedByNetworkIssue(cse);
            } catch (NoSuchAlgorithmException nsae) {
                return false;
            }
        case "URI":
            Throwable t = cse.getCause();
            return (t != null && t instanceof IOException);
        default:
            // we don't know about any other remote CertStore types
            return false;
    }
}
 
源代码11 项目: grpc-java   文件: SdsSslContextProvider.java
private void updateSslContext() {
  try {
    CertificateValidationContext localCertValidationContext = mergeStaticAndDynamicCertContexts();
    SslContextBuilder sslContextBuilder = getSslContextBuilder(localCertValidationContext);
    CommonTlsContext commonTlsContext = getCommonTlsContext();
    if (commonTlsContext != null && commonTlsContext.getAlpnProtocolsCount() > 0) {
      List<String> alpnList = commonTlsContext.getAlpnProtocolsList();
      ApplicationProtocolConfig apn = new ApplicationProtocolConfig(
          ApplicationProtocolConfig.Protocol.ALPN,
          ApplicationProtocolConfig.SelectorFailureBehavior.NO_ADVERTISE,
          ApplicationProtocolConfig.SelectedListenerFailureBehavior.ACCEPT,
          alpnList);
      sslContextBuilder.applicationProtocolConfig(apn);
    }
    SslContext sslContextCopy = sslContextBuilder.build();
    sslContext = sslContextCopy;
    makePendingCallbacks(sslContextCopy);
  } catch (CertificateException | IOException | CertStoreException e) {
    logger.log(Level.SEVERE, "exception in updateSslContext", e);
  }
}
 
源代码12 项目: ripple-lib-java   文件: PKIXCRLStoreSelector.java
public static Collection<? extends CRL> getCRLs(final PKIXCRLStoreSelector selector, CertStore certStore)
    throws CertStoreException
{
    return certStore.getCRLs(new CRLSelector()
    {
        public boolean match(CRL crl)
        {
            return selector.match(crl);
        }

        public Object clone()
        {
            return this;
        }
    });
}
 
源代码13 项目: j2objc   文件: CertStoreHelper.java
static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
        switch (type) {
//            case "LDAP":
            case "SSLServer":
                try {
                    CertStoreHelper csh = CertStoreHelper.getInstance(type);
                    return csh.isCausedByNetworkIssue(cse);
                } catch (NoSuchAlgorithmException nsae) {
                    return false;
                }
            case "URI":
                Throwable t = cse.getCause();
                return (t != null && t instanceof IOException);
            default:
                // we don't know about any other remote CertStore types
                return false;
        }
    }
 
源代码14 项目: jdk8u_jdk   文件: CertStoreHelper.java
static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
    switch (type) {
        case "LDAP":
        case "SSLServer":
            try {
                CertStoreHelper csh = CertStoreHelper.getInstance(type);
                return csh.isCausedByNetworkIssue(cse);
            } catch (NoSuchAlgorithmException nsae) {
                return false;
            }
        case "URI":
            Throwable t = cse.getCause();
            return (t != null && t instanceof IOException);
        default:
            // we don't know about any other remote CertStore types
            return false;
    }
}
 
源代码15 项目: RipplePower   文件: MultiCertStoreSpi.java
public Collection engineGetCRLs(CRLSelector crlSelector)
    throws CertStoreException
{
    boolean searchAllStores = params.getSearchAllStores();
    Iterator iter = params.getCertStores().iterator();
    List allCRLs = searchAllStores ? new ArrayList() : Collections.EMPTY_LIST;
    
    while (iter.hasNext())
    {
        CertStore store = (CertStore)iter.next();
        Collection crls = store.getCRLs(crlSelector);

        if (searchAllStores)
        {
            allCRLs.addAll(crls);
        }
        else if (!crls.isEmpty())
        {
            return crls;
        }
    }

    return allCRLs;
}
 
源代码16 项目: hottub   文件: CertStoreHelper.java
static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
    switch (type) {
        case "LDAP":
        case "SSLServer":
            try {
                CertStoreHelper csh = CertStoreHelper.getInstance(type);
                return csh.isCausedByNetworkIssue(cse);
            } catch (NoSuchAlgorithmException nsae) {
                return false;
            }
        case "URI":
            Throwable t = cse.getCause();
            return (t != null && t instanceof IOException);
        default:
            // we don't know about any other remote CertStore types
            return false;
    }
}
 
源代码17 项目: ripple-lib-java   文件: MultiCertStoreSpi.java
public Collection engineGetCRLs(CRLSelector crlSelector)
    throws CertStoreException
{
    boolean searchAllStores = params.getSearchAllStores();
    Iterator iter = params.getCertStores().iterator();
    List allCRLs = searchAllStores ? new ArrayList() : Collections.EMPTY_LIST;
    
    while (iter.hasNext())
    {
        CertStore store = (CertStore)iter.next();
        Collection crls = store.getCRLs(crlSelector);

        if (searchAllStores)
        {
            allCRLs.addAll(crls);
        }
        else if (!crls.isEmpty())
        {
            return crls;
        }
    }

    return allCRLs;
}
 
源代码18 项目: openjdk-8-source   文件: ReverseBuilder.java
/**
 * Retrieves all certs from the specified CertStores that satisfy the
 * requirements specified in the parameters and the current
 * PKIX state (name constraints, policy constraints, etc).
 *
 * @param currentState the current state.
 *        Must be an instance of <code>ReverseState</code>
 * @param certStores list of CertStores
 */
@Override
Collection<X509Certificate> getMatchingCerts
    (State currState, List<CertStore> certStores)
    throws CertStoreException, CertificateException, IOException
{
    ReverseState currentState = (ReverseState) currState;

    if (debug != null)
        debug.println("In ReverseBuilder.getMatchingCerts.");

    /*
     * The last certificate could be an EE or a CA certificate
     * (we may be building a partial certification path or
     * establishing trust in a CA).
     *
     * Try the EE certs before the CA certs. It will be more
     * common to build a path to an end entity.
     */
    Collection<X509Certificate> certs =
        getMatchingEECerts(currentState, certStores);
    certs.addAll(getMatchingCACerts(currentState, certStores));

    return certs;
}
 
源代码19 项目: jdk8u-dev-jdk   文件: ForwardBuilder.java
/**
 * Retrieves all certs from the specified CertStores that satisfy the
 * requirements specified in the parameters and the current
 * PKIX state (name constraints, policy constraints, etc).
 *
 * @param currentState the current state.
 *        Must be an instance of <code>ForwardState</code>
 * @param certStores list of CertStores
 */
@Override
Collection<X509Certificate> getMatchingCerts(State currentState,
                                             List<CertStore> certStores)
    throws CertStoreException, CertificateException, IOException
{
    if (debug != null) {
        debug.println("ForwardBuilder.getMatchingCerts()...");
    }

    ForwardState currState = (ForwardState) currentState;

    /*
     * We store certs in a Set because we don't want duplicates.
     * As each cert is added, it is sorted based on the PKIXCertComparator
     * algorithm.
     */
    Set<X509Certificate> certs = new TreeSet<>(comparator);

    /*
     * Only look for EE certs if search has just started.
     */
    if (currState.isInitial()) {
        getMatchingEECerts(currState, certStores, certs);
    }
    getMatchingCACerts(currState, certStores, certs);

    return certs;
}
 
源代码20 项目: dragonwell8_jdk   文件: ForwardBuilder.java
/**
 * Retrieves all certs from the specified CertStores that satisfy the
 * requirements specified in the parameters and the current
 * PKIX state (name constraints, policy constraints, etc).
 *
 * @param currentState the current state.
 *        Must be an instance of <code>ForwardState</code>
 * @param certStores list of CertStores
 */
@Override
Collection<X509Certificate> getMatchingCerts(State currentState,
                                             List<CertStore> certStores)
    throws CertStoreException, CertificateException, IOException
{
    if (debug != null) {
        debug.println("ForwardBuilder.getMatchingCerts()...");
    }

    ForwardState currState = (ForwardState) currentState;

    /*
     * We store certs in a Set because we don't want duplicates.
     * As each cert is added, it is sorted based on the PKIXCertComparator
     * algorithm.
     */
    Comparator<X509Certificate> comparator =
        new PKIXCertComparator(trustedSubjectDNs, currState.cert);
    Set<X509Certificate> certs = new TreeSet<>(comparator);

    /*
     * Only look for EE certs if search has just started.
     */
    if (currState.isInitial()) {
        getMatchingEECerts(currState, certStores, certs);
    }
    getMatchingCACerts(currState, certStores, certs);

    return certs;
}
 
源代码21 项目: openjdk-8-source   文件: ForwardBuilder.java
/**
 * Download Certificates from the given AIA and add them to the
 * specified Collection.
 */
// cs.getCertificates(caSelector) returns a collection of X509Certificate's
// because of the selector, so the cast is safe
@SuppressWarnings("unchecked")
private boolean getCerts(AuthorityInfoAccessExtension aiaExt,
                         Collection<X509Certificate> certs)
{
    if (Builder.USE_AIA == false) {
        return false;
    }
    List<AccessDescription> adList = aiaExt.getAccessDescriptions();
    if (adList == null || adList.isEmpty()) {
        return false;
    }

    boolean add = false;
    for (AccessDescription ad : adList) {
        CertStore cs = URICertStore.getInstance(ad);
        if (cs != null) {
            try {
                if (certs.addAll((Collection<X509Certificate>)
                    cs.getCertificates(caSelector))) {
                    add = true;
                    if (!searchAllCertStores) {
                        return true;
                    }
                }
            } catch (CertStoreException cse) {
                if (debug != null) {
                    debug.println("exception getting certs from CertStore:");
                    cse.printStackTrace();
                }
            }
        }
    }
    return add;
}
 
源代码22 项目: TencentKona-8   文件: ForwardBuilder.java
/**
 * Retrieves all certs from the specified CertStores that satisfy the
 * requirements specified in the parameters and the current
 * PKIX state (name constraints, policy constraints, etc).
 *
 * @param currentState the current state.
 *        Must be an instance of <code>ForwardState</code>
 * @param certStores list of CertStores
 */
@Override
Collection<X509Certificate> getMatchingCerts(State currentState,
                                             List<CertStore> certStores)
    throws CertStoreException, CertificateException, IOException
{
    if (debug != null) {
        debug.println("ForwardBuilder.getMatchingCerts()...");
    }

    ForwardState currState = (ForwardState) currentState;

    /*
     * We store certs in a Set because we don't want duplicates.
     * As each cert is added, it is sorted based on the PKIXCertComparator
     * algorithm.
     */
    Comparator<X509Certificate> comparator =
        new PKIXCertComparator(trustedSubjectDNs, currState.cert);
    Set<X509Certificate> certs = new TreeSet<>(comparator);

    /*
     * Only look for EE certs if search has just started.
     */
    if (currState.isInitial()) {
        getMatchingEECerts(currState, certStores, certs);
    }
    getMatchingCACerts(currState, certStores, certs);

    return certs;
}
 
源代码23 项目: TencentKona-8   文件: ForwardBuilder.java
/**
 * Download Certificates from the given AIA and add them to the
 * specified Collection.
 */
// cs.getCertificates(caSelector) returns a collection of X509Certificate's
// because of the selector, so the cast is safe
@SuppressWarnings("unchecked")
private boolean getCerts(AuthorityInfoAccessExtension aiaExt,
                         Collection<X509Certificate> certs)
{
    if (Builder.USE_AIA == false) {
        return false;
    }
    List<AccessDescription> adList = aiaExt.getAccessDescriptions();
    if (adList == null || adList.isEmpty()) {
        return false;
    }

    boolean add = false;
    for (AccessDescription ad : adList) {
        CertStore cs = URICertStore.getInstance(ad);
        if (cs != null) {
            try {
                if (certs.addAll((Collection<X509Certificate>)
                    cs.getCertificates(caSelector))) {
                    add = true;
                    if (!searchAllCertStores) {
                        return true;
                    }
                }
            } catch (CertStoreException cse) {
                if (debug != null) {
                    debug.println("exception getting certs from CertStore:");
                    cse.printStackTrace();
                }
            }
        }
    }
    return add;
}
 
private static boolean match(X509CertSelector selector) throws TechnicalConnectorException {
   try {
      return !tsloStore.getCertificates(selector).isEmpty();
   } catch (CertStoreException var2) {
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_GENERAL, var2, new Object[]{"Unable to select certificates."});
   }
}
 
private static boolean match(X509CertSelector selector) throws TechnicalConnectorException {
   try {
      return !tsloStore.getCertificates(selector).isEmpty();
   } catch (CertStoreException var2) {
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_GENERAL, var2, new Object[]{"Unable to select certificates."});
   }
}
 
源代码26 项目: grpc-java   文件: SdsX509TrustManagerTest.java
private SSLParameters buildTrustManagerAndGetSslParameters()
    throws CertificateException, IOException, CertStoreException {
  X509Certificate[] caCerts =
      CertificateUtils.toX509Certificates(TestUtils.loadCert(CA_PEM_FILE));
  trustManager = SdsTrustManagerFactory.createSdsX509TrustManager(caCerts,
      null);
  when(mockSession.getProtocol()).thenReturn("TLSv1.2");
  when(mockSession.getPeerHost()).thenReturn("peer-host-from-mock");
  SSLParameters sslParams = new SSLParameters();
  sslParams.setEndpointIdentificationAlgorithm("HTTPS");
  return sslParams;
}
 
源代码27 项目: jdk8u60   文件: ForwardBuilder.java
/**
 * Download Certificates from the given AIA and add them to the
 * specified Collection.
 */
// cs.getCertificates(caSelector) returns a collection of X509Certificate's
// because of the selector, so the cast is safe
@SuppressWarnings("unchecked")
private boolean getCerts(AuthorityInfoAccessExtension aiaExt,
                         Collection<X509Certificate> certs)
{
    if (Builder.USE_AIA == false) {
        return false;
    }
    List<AccessDescription> adList = aiaExt.getAccessDescriptions();
    if (adList == null || adList.isEmpty()) {
        return false;
    }

    boolean add = false;
    for (AccessDescription ad : adList) {
        CertStore cs = URICertStore.getInstance(ad);
        if (cs != null) {
            try {
                if (certs.addAll((Collection<X509Certificate>)
                    cs.getCertificates(caSelector))) {
                    add = true;
                    if (!searchAllCertStores) {
                        return true;
                    }
                }
            } catch (CertStoreException cse) {
                if (debug != null) {
                    debug.println("exception getting certs from CertStore:");
                    cse.printStackTrace();
                }
            }
        }
    }
    return add;
}
 
源代码28 项目: jdk8u-jdk   文件: ForwardBuilder.java
/**
 * Retrieves all certs from the specified CertStores that satisfy the
 * requirements specified in the parameters and the current
 * PKIX state (name constraints, policy constraints, etc).
 *
 * @param currentState the current state.
 *        Must be an instance of <code>ForwardState</code>
 * @param certStores list of CertStores
 */
@Override
Collection<X509Certificate> getMatchingCerts(State currentState,
                                             List<CertStore> certStores)
    throws CertStoreException, CertificateException, IOException
{
    if (debug != null) {
        debug.println("ForwardBuilder.getMatchingCerts()...");
    }

    ForwardState currState = (ForwardState) currentState;

    /*
     * We store certs in a Set because we don't want duplicates.
     * As each cert is added, it is sorted based on the PKIXCertComparator
     * algorithm.
     */
    Set<X509Certificate> certs = new TreeSet<>(comparator);

    /*
     * Only look for EE certs if search has just started.
     */
    if (currState.isInitial()) {
        getMatchingEECerts(currState, certStores, certs);
    }
    getMatchingCACerts(currState, certStores, certs);

    return certs;
}
 
源代码29 项目: openjdk-jdk8u   文件: ForwardBuilder.java
/**
 * Retrieves all certs from the specified CertStores that satisfy the
 * requirements specified in the parameters and the current
 * PKIX state (name constraints, policy constraints, etc).
 *
 * @param currentState the current state.
 *        Must be an instance of <code>ForwardState</code>
 * @param certStores list of CertStores
 */
@Override
Collection<X509Certificate> getMatchingCerts(State currentState,
                                             List<CertStore> certStores)
    throws CertStoreException, CertificateException, IOException
{
    if (debug != null) {
        debug.println("ForwardBuilder.getMatchingCerts()...");
    }

    ForwardState currState = (ForwardState) currentState;

    /*
     * We store certs in a Set because we don't want duplicates.
     * As each cert is added, it is sorted based on the PKIXCertComparator
     * algorithm.
     */
    Comparator<X509Certificate> comparator =
        new PKIXCertComparator(trustedSubjectDNs, currState.cert);
    Set<X509Certificate> certs = new TreeSet<>(comparator);

    /*
     * Only look for EE certs if search has just started.
     */
    if (currState.isInitial()) {
        getMatchingEECerts(currState, certStores, certs);
    }
    getMatchingCACerts(currState, certStores, certs);

    return certs;
}
 
源代码30 项目: openjdk-jdk8u   文件: ForwardBuilder.java
/**
 * Download Certificates from the given AIA and add them to the
 * specified Collection.
 */
// cs.getCertificates(caSelector) returns a collection of X509Certificate's
// because of the selector, so the cast is safe
@SuppressWarnings("unchecked")
private boolean getCerts(AuthorityInfoAccessExtension aiaExt,
                         Collection<X509Certificate> certs)
{
    if (Builder.USE_AIA == false) {
        return false;
    }
    List<AccessDescription> adList = aiaExt.getAccessDescriptions();
    if (adList == null || adList.isEmpty()) {
        return false;
    }

    boolean add = false;
    for (AccessDescription ad : adList) {
        CertStore cs = URICertStore.getInstance(ad);
        if (cs != null) {
            try {
                if (certs.addAll((Collection<X509Certificate>)
                    cs.getCertificates(caSelector))) {
                    add = true;
                    if (!searchAllCertStores) {
                        return true;
                    }
                }
            } catch (CertStoreException cse) {
                if (debug != null) {
                    debug.println("exception getting certs from CertStore:");
                    cse.printStackTrace();
                }
            }
        }
    }
    return add;
}
 
 类所在包
 同包方法