You are here

protected function KeyClient::decrypt in Lockr 7

1 call to KeyClient::decrypt()
KeyClient::get in src/Lockr/KeyClient.php
Gets a key from Lockr.

File

src/Lockr/KeyClient.php, line 147

Class

KeyClient

Namespace

Lockr

Code

protected function decrypt($ciphertext, $encoded) {
  list($cipher, $mode, $iv, $key) = $this
    ->decode($encoded);
  $ciphertext = base64_decode($ciphertext);
  $key = mcrypt_decrypt($cipher, $key, $ciphertext, $mode, $iv);
  return trim($key);
}