// replacing old certificate chain with the new one
char[] keyPassword = param.getKeyPass();
PrivateKey privateKey = (PrivateKey) keyStore
.getKey(alias, keyPassword);
keyStore.deleteEntry(alias);
keyStore.setKeyEntry(alias, privateKey, keyPassword, orderedChain);
param.setNeedSaveKS(true);
System.out.println("The certificate reply is " + "successfully "
+ "installed into the keystore.");
}