public static function CryptConnector::createDerivedKey in Acquia Connector 3.x
Same name and namespace in other branches
- 8.2 src/CryptConnector.php \Drupal\acquia_connector\CryptConnector::createDerivedKey()
- 8 src/CryptConnector.php \Drupal\acquia_connector\CryptConnector::createDerivedKey()
Derive a key for the solr hmac using a salt, id and key.
Parameters
string $salt: Salt.
string $id: Acquia Subscription ID.
string $key: Acquia Subscription Key.
Return value
string Derived Key.
File
- src/
CryptConnector.php, line 98
Class
- CryptConnector
- Class CryptConnector.
Namespace
Drupal\acquia_connectorCode
public static function createDerivedKey($salt, $id, $key) {
$derivation_string = $id . 'solr' . $salt;
return hash_hmac('sha1', str_pad($derivation_string, 80, $derivation_string), $key);
}