protected function createPasswordHash(string $name, string $password)
{
// initialize the callback
$callback = null;
// query whether or not we've a callback configured
if ($this->params->exists(ParamKeys::DIGEST_CALLBACK)) {
try {
// load the callback class name and create a new callback instance
$callbackClassName = $this->params->get(ParamKeys::DIGEST_CALLBACK);
$callback = new $callbackClassName();
// initialize the callback
$tmp = new HashMap($this->params->toIndexedArray());
$tmp->add(SharedStateKeys::LOGIN_NAME, $name);
$tmp->add(SharedStateKeys::LOGIN_PASSWORD, $password);
$callback->init($tmp);
} catch (\Exception $e) {
throw new SecurityException("Failed to load DigestCallback");
}
}
// hash and return the password
return Util::createPasswordHash($this->hashAlgorithm, $this->hashEncoding, $this->hashCharset, $name, $password, $callback);
}