private void loadCredentialProvider(Configuration configuration) {
    if (credentialProvider == null) {
      try {
        LOCK.lock();
        credentialProvider = new CredentialProvider(null, configuration);
      } catch (Exception e) {
        LOG.info("Credential provider creation failed", e);
        credentialProvider = null;
      } finally {
        LOCK.unlock();
      }
    }
  }
Reading the password from Credential Store for the given alias

@param aliasStr
         the Credential Store alias you want to read the password for
@param configuration with configured master key:
masterKeyLocation
         the master key location file
isMasterKeyPersisted
         a flag indicating whether the master key is persisted
masterKeyStoreLocation
         the master key-store location file
@return the password of the given alias if it is not <code>blank</code> and
        there is password stored for this alias in Credential Store;
        <code>null</code> otherwise
ambari-server/src/main/java/org/apache/ambari/server/utils/PasswordUtils.java