You are here

function _key_default_obscure_key_value in Key 7.3

Default function to obscure a key value.

Parameters

string $key_value: The key value to obscure.

array $options: Options to use when obscuring the value.

Return value

string The obscured key value.

1 string reference to '_key_default_obscure_key_value'
key_ctools_plugin_type in ./key.module
Implements hook_ctools_plugin_type().

File

./key.module, line 867
Main Key functionality and hook implementations.

Code

function _key_default_obscure_key_value($key_value, $options = array()) {
  switch ($options['key_type_group']) {
    case 'authentication':
      $options['visible_right'] = 4;
      $obscured_value = _key_obscure_value($key_value, $options);
      break;
    case 'encryption':
      $options['visible_right'] = 0;
      $options['fixed_length'] = 30;
      $obscured_value = _key_obscure_value($key_value, $options);
      break;
    default:
      $obscured_value = $key_value;
  }
  return $obscured_value;
}