private void doChangeKeyPasswd(String alias) throws Exception {
  if (alias == null) {
    alias=keyAlias;
  }
  Pair<Key,char[]> objs=recoverKey(alias,storePass,keyPass);
  Key privKey=objs.fst;
  if (keyPass == null) {
    keyPass=objs.snd;
  }
  if (keyPassNew == null) {
    MessageFormat form=new MessageFormat(rb.getString("key.password.for.alias."));
    Object[] source={alias};
    keyPassNew=getNewPasswd(form.format(source),keyPass);
  }
  keyStore.setKeyEntry(alias,privKey,keyPassNew,keyStore.getCertificateChain(alias));
}

private void doChangeKeyPasswd ( String alias ) throws Exception { if ( alias == null ) { alias = keyAlias ; } Pair < Key , char [ ] > objs = recoverKey ( alias , storePass , keyPass ) ; Key privKey = objs . fst ; if ( keyPass == null ) { keyPass = objs . snd ; } if ( keyPassNew == null ) { MessageFormat form = new MessageFormat ( rb . getString ( "key.password.for.alias." ) ) ; Object [ ] source = { alias } ; keyPassNew = getNewPasswd ( form . format ( source ) , keyPass ) ; } keyStore . setKeyEntry ( alias , privKey , keyPassNew , keyStore . getCertificateChain ( alias ) ) ; }
changes a key password .
