You are here

protected static function LockrAesCbcKeyWrapper::decode in Lockr 7.2

Same name and namespace in other branches
  1. 7.3 vendor/lockr/lockr/src/KeyWrapper/LockrAesCbcKeyWrapper.php \Lockr\KeyWrapper\LockrAesCbcKeyWrapper::decode()
2 calls to LockrAesCbcKeyWrapper::decode()
LockrAesCbcKeyWrapper::decrypt in vendor/lockr/lockr-client/src/KeyWrapper/LockrAesCbcKeyWrapper.php
Decrypt the given ciphertext using encoded.
LockrAesCbcKeyWrapper::reencrypt in vendor/lockr/lockr-client/src/KeyWrapper/LockrAesCbcKeyWrapper.php
Encrypt the given plaintext using the same initial state as defined by encoded.

File

vendor/lockr/lockr-client/src/KeyWrapper/LockrAesCbcKeyWrapper.php, line 90

Class

LockrAesCbcKeyWrapper

Namespace

Lockr\KeyWrapper

Code

protected static function decode($encoded) {
  $parts = explode('$', $encoded, 4);
  if (!$parts || count($parts) != 4) {
    return false;
  }
  list($cipher, $mode, $iv, $key) = $parts;
  $iv = base64_decode($iv);
  $key = base64_decode($key);
  return array(
    $cipher,
    $mode,
    $iv,
    $key,
  );
}