public static char[] getValueFromKeystore(String keystorePath, String key) throws IOException {
    char[] valueCharArray = null;
    if (keystorePath != null && key != null) {
      Configuration conf = new Configuration();
      conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, keystorePath);
      valueCharArray = conf.getPassword(key);
    }
    return valueCharArray;
  }
Dump the configuration file to the log.  It will be dumped at an INFO level.  This can
potentially produce a lot of logs, so you might want to be careful when and where you do it.
It takes care not to dump hidden keys.
@param conf Configuration file to dump
@return String containing dumped config file.
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java