You are here

private function SearchApiAcquiaSearchConnectionV3::createDerivedKey in Acquia Search for Search API 7.2

Creates derived key.

Parameters

string $salt: Key salt.

string $index_id: Index ID.

string $key: Secret key.

Return value

string Derived key.

2 calls to SearchApiAcquiaSearchConnectionV3::createDerivedKey()
SearchApiAcquiaSearchConnectionV3::buildAuthString in includes/v3/SearchApiAcquiaSearchConnectionV3.php
Builds auth string.
SearchApiAcquiaSearchConnectionV3::isValidResponse in includes/v3/SearchApiAcquiaSearchConnectionV3.php
Validates response.

File

includes/v3/SearchApiAcquiaSearchConnectionV3.php, line 236

Class

SearchApiAcquiaSearchConnectionV3
Starting point for the Solr API. Represents a Solr server resource and has methods for pinging, adding, deleting, committing, optimizing and searching.

Code

private function createDerivedKey($salt, $index_id, $key) {
  $pad_length = 80;
  $derivation_string = sprintf('%ssolr%s', $index_id, $salt);
  $data = str_pad($derivation_string, $pad_length, $derivation_string);
  $hmac = hash_hmac('sha1', $data, $key);
  return $hmac;
}