You are here

function _lockr_get_key in Lockr 7.2

Same name and namespace in other branches
  1. 7.3 lockr.module \_lockr_get_key()
  2. 7 lockr.module \_lockr_get_key()

Gets a key from Lockr.

Parameters

string $key_name: The key name.

Return value

string | FALSE Returns the key value, or FALSE on failure.

1 call to _lockr_get_key()
key_provider_lockr_get_key_value in plugins/key_provider/lockr.inc
Get callback for key_provider plugin.

File

./lockr.module, line 211
Hook implementations and callbacks for lockr.

Code

function _lockr_get_key($key_name, $encoded) {
  $client = lockr_key_client();
  try {
    if ($client) {
      return $client
        ->encrypted($encoded)
        ->get($key_name);
    }
    else {
      return FALSE;
    }
  } catch (\Exception $e) {
    watchdog_exception('lockr', $e);
    return FALSE;
  }
}