You are here

private function AcquiaSearchSolrService::createDerivedKey in Acquia Connector 7.3

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 AcquiaSearchSolrService::createDerivedKey()
AcquiaSearchSolrService::buildAuthString in acquia_search/includes/AcquiaSearchSolrService.php
Builds auth string.
AcquiaSearchSolrService::isValidResponse in acquia_search/includes/AcquiaSearchSolrService.php
Validates response.

File

acquia_search/includes/AcquiaSearchSolrService.php, line 231

Class

AcquiaSearchSolrService
Class AcquiaSearchSolrService.

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;
}