modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/EntryManager.java [105:125]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static void keyPasswd(KeytoolParameters param) throws KeyStoreException,
            NoSuchAlgorithmException, UnrecoverableKeyException,
            CertificateException, FileNotFoundException,
            NoSuchProviderException, IOException {
        KeyStore keyStore = param.getKeyStore();
        String alias = param.getAlias();
        Key key;
        Certificate[] chain;
        try {
            key = keyStore.getKey(alias, param.getKeyPass());
            chain = keyStore.getCertificateChain(alias);
        } catch (NoSuchAlgorithmException e) {
            throw new NoSuchAlgorithmException(
                    "Cannot find the algorithm to recover the key. ", e);
        }

        keyStore.deleteEntry(alias);
        keyStore.setKeyEntry(alias, key, param.getNewPasswd(), chain);
        param.setKeyPass(param.getNewPasswd());
        param.setNeedSaveKS(true);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/EntryManager.java [105:125]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static void keyPasswd(KeytoolParameters param) throws KeyStoreException,
            NoSuchAlgorithmException, UnrecoverableKeyException,
            CertificateException, FileNotFoundException,
            NoSuchProviderException, IOException {
        KeyStore keyStore = param.getKeyStore();
        String alias = param.getAlias();
        Key key;
        Certificate[] chain;
        try {
            key = keyStore.getKey(alias, param.getKeyPass());
            chain = keyStore.getCertificateChain(alias);
        } catch (NoSuchAlgorithmException e) {
            throw new NoSuchAlgorithmException(
                    "Cannot find the algorithm to recover the key. ", e);
        }

        keyStore.deleteEntry(alias);
        keyStore.setKeyEntry(alias, key, param.getNewPasswd(), chain);
        param.setKeyPass(param.getNewPasswd());
        param.setNeedSaveKS(true);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



