You are here

class AcquiaCryptConnector in Acquia Search 3.x

Class CryptConnector.

@package Drupal\acquia_search

Hierarchy

Expanded class hierarchy of AcquiaCryptConnector

2 files declare their use of AcquiaCryptConnector
AcquiaCryptConnectorTest.php in tests/src/Unit/AcquiaCryptConnectorTest.php
SearchSubscriber.php in src/EventSubscriber/SearchSubscriber.php

File

src/AcquiaCryptConnector.php, line 10

Namespace

Drupal\acquia_search
View source
class AcquiaCryptConnector {

  /**
   * Derive a key for the solr hmac using a salt, id and key.
   *
   * @param string $salt
   *   Salt.
   * @param string $id
   *   Acquia Search Core ID.
   * @param string $key
   *   Acquia Subscription Key.
   *
   * @return string
   *   Derived Key.
   */
  public static function createDerivedKey($salt, $id, $key) {
    $derivation_string = $id . 'solr' . $salt;
    return hash_hmac('sha1', str_pad($derivation_string, 80, $derivation_string), $key);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AcquiaCryptConnector::createDerivedKey public static function Derive a key for the solr hmac using a salt, id and key.