You are here

public static function LockrEncryptionKeyType::generateKeyValue in Lockr 8.4

Same name and namespace in other branches
  1. 8.2 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 132

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'];
  return \Drupal::service('lockr.lockr')
    ->generateKey((int) $key_size);
}