// Save the new keystore contents FileOutputStream out = new FileOutputStream(keystoreFile); keystore.store(out, storePass); out.close();