code: private char[] readKeystorePassword(String keystorePasswordURL, File policyFile) throws Exception {
          // try relative path to policy file
          File f = new File(getPolicyFileHome(policyFile), keystorePasswordURL);
          if (!f.exists()) {
              // try absoluth path
              f = new File(keystorePasswordURL);
              if (!f.exists()) {
                  throw new Exception("ER005: File on keystorePasswordURL doesn't exists!");
              }
          }
          Reader reader = new FileReader(f);
          StringBuilder sb = new StringBuilder();
          char buffer[] = new char[64];
          int len;
          while ((len = reader.read(buffer)) > 0) {
              sb.append(buffer, 0, len);
          }
          reader.close();
          return sb.toString().trim().toCharArray();
      }
docs: Private method for reading password for keystore from file.
  
  @param keystorePasswordURL URL to file which contain password for keystore
  @param policyFile used policy file
  @return password for keystore
  @throws Exception when there was any problem during reading keystore password