modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/CertChainVerifier.java [705:730]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static boolean isTrusted(KeytoolParameters param, X509Certificate cert)
            throws FileNotFoundException, NoSuchAlgorithmException,
            CertificateException, IOException, KeyStoreException,
            NoSuchProviderException {
        // check the main keyStore
        KeyStore keyStore = param.getKeyStore();
        String alias = keyStore.getCertificateAlias(cert);
        if (alias != null) {
            if (keyStore.isCertificateEntry(alias)) {
                return true;
            }
        }

        if (!param.isTrustCACerts()) {
            return false;
        } else {// check cacerts file
            KeyStore cacerts = param.getCacerts();
            alias = cacerts.getCertificateAlias(cert);
            if (alias != null) {
                if (cacerts.isCertificateEntry(alias)) {
                    return true;
                }
            }
            return false;
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/CertChainVerifier.java [705:730]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static boolean isTrusted(KeytoolParameters param, X509Certificate cert)
            throws FileNotFoundException, NoSuchAlgorithmException,
            CertificateException, IOException, KeyStoreException,
            NoSuchProviderException {
        // check the main keyStore
        KeyStore keyStore = param.getKeyStore();
        String alias = keyStore.getCertificateAlias(cert);
        if (alias != null) {
            if (keyStore.isCertificateEntry(alias)) {
                return true;
            }
        }

        if (!param.isTrustCACerts()) {
            return false;
        } else {// check cacerts file
            KeyStore cacerts = param.getCacerts();
            alias = cacerts.getCertificateAlias(cert);
            if (alias != null) {
                if (cacerts.isCertificateEntry(alias)) {
                    return true;
                }
            }
            return false;
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



