code: public final void saveKeyStore(OutputStream output, KeyStore keyStore, char[] password) throws IOException {
          logger.entry();
          try {
              keyStore.store(output, password);
          } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException e) {
              RuntimeException exception = new RuntimeException("An unexpected exception occurred while attempting to save a keystore.", e);
              logger.error(exception.toString());
              throw exception;
          }
          logger.exit();
      }
docs: This method saves a PKCS12 format key store out to an output stream.
  
  @param output The output stream to be written to.
  @param keyStore The PKCS12 format key store.
  @param password The password that should be used to encrypt the file.
  @throws java.io.IOException Unable to save the key store to the specified output stream.