You are here

function bakery_bake_data in Bakery Single Sign-On System 7.2

Same name and namespace in other branches
  1. 6.2 bakery.module \bakery_bake_data()
  2. 7.4 bakery.module \bakery_bake_data()

Encrypt and sign data for Bakery transfer.

Parameters

array $data: Array of data to be transferred.

Return value

string String of signed and encrypted data, url safe.

5 calls to bakery_bake_data()
bakery_bake_oatmeal_cookie in ./bakery.module
Create a cookie for passing information between sites.
bakery_eat_gingerbread_cookie in ./bakery.module
Respond with account information.
bakery_request_account in ./bakery.module
Request account information from master to create account locally.
bakery_user_update in ./bakery.module
Implements hook_user_update().
_bakery_bake_chocolatechip_cookie in ./bakery.module
Create a new cookie for identification.

File

./bakery.module, line 986
Module file for the Bakery.

Code

function bakery_bake_data($data) {
  $key = variable_get('bakery_key', '');
  $data = bakery_encrypt(serialize($data));
  $signature = hash_hmac('sha256', $data, $key);
  return base64_encode($signature . $data);
}