modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/KeyStoreCertPrinter.java [274:299]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static void printMD(byte[] encoding, String mdAlgorithm,
            String providerName) throws NoSuchAlgorithmException,
            NoSuchProviderException {
        byte[] digest;
        // if provider name is given, use it when getting
        // an instance of MessageDigest.
        try {
            if (providerName != null) {
                digest = MessageDigest.getInstance(mdAlgorithm, providerName)
                        .digest(encoding);
            } else {
                digest = MessageDigest.getInstance(mdAlgorithm)
                        .digest(encoding);
            }
        } catch (NoSuchAlgorithmException e) {
            throw new NoSuchAlgorithmException("The algorithm " + mdAlgorithm
                    + " is not found in the environment.", e);
        } catch (NoSuchProviderException e) {
            throw (NoSuchProviderException) new NoSuchProviderException(
                    "The provider " + providerName
                            + " is not found in the environment.").initCause(e);
        }

        // print out in the way: "0A:1B:C3:D4:..."
        System.out.println(formatBytes(digest));
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreCertPrinter.java [274:299]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static void printMD(byte[] encoding, String mdAlgorithm,
            String providerName) throws NoSuchAlgorithmException,
            NoSuchProviderException {
        byte[] digest;
        // if provider name is given, use it when getting
        // an instance of MessageDigest.
        try {
            if (providerName != null) {
                digest = MessageDigest.getInstance(mdAlgorithm, providerName)
                        .digest(encoding);
            } else {
                digest = MessageDigest.getInstance(mdAlgorithm)
                        .digest(encoding);
            }
        } catch (NoSuchAlgorithmException e) {
            throw new NoSuchAlgorithmException("The algorithm " + mdAlgorithm
                    + " is not found in the environment.", e);
        } catch (NoSuchProviderException e) {
            throw (NoSuchProviderException) new NoSuchProviderException(
                    "The provider " + providerName
                            + " is not found in the environment.").initCause(e);
        }

        // print out in the way: "0A:1B:C3:D4:..."
        System.out.println(formatBytes(digest));
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



