You are here

public static function LockrEncryptionKeyType::generateKeyValue in Lockr 8.2

Same name and namespace in other branches
  1. 8.4 src/Plugin/KeyType/LockrEncryptionKeyType.php \Drupal\lockr\Plugin\KeyType\LockrEncryptionKeyType::generateKeyValue()
  2. 8.3 src/Plugin/KeyType/LockrEncryptionKeyType.php \Drupal\lockr\Plugin\KeyType\LockrEncryptionKeyType::generateKeyValue()
  3. 4.x src/Plugin/KeyType/LockrEncryptionKeyType.php \Drupal\lockr\Plugin\KeyType\LockrEncryptionKeyType::generateKeyValue()

Generate a key value of this type using the submitted configuration.

Parameters

array $configuration: The configuration for the key type plugin.

Return value

string The generated key value.

Overrides KeyTypeInterface::generateKeyValue

File

src/Plugin/KeyType/LockrEncryptionKeyType.php, line 83

Class

LockrEncryptionKeyType
Defines a key type for encryption that generates keys with Lockr.

Namespace

Drupal\lockr\Plugin\KeyType

Code

public static function generateKeyValue(array $configuration) {
  $key_size = $configuration['key_size'];
  $key_client = \Drupal::service('lockr.client_factory')
    ->getKeyClient();
  return $key_client
    ->create($key_size);
}