You are here

class LockrAes256CbcSha256RawKeyWrapperTest in Lockr 7.3

Hierarchy

Expanded class hierarchy of LockrAes256CbcSha256RawKeyWrapperTest

File

vendor/lockr/lockr/tests/KeyWrapper/LockrAes256CbcSha256RawKeyWrapperTest.php, line 8

Namespace

Lockr\Tests\KeyWrapper
View source
class LockrAes256CbcSha256RawKeyWrapperTest extends TestCase {
  public function testEncryptsData() {
    $text = 'abcd';
    $data = KeyWrapper::encrypt($text);
    $plaintext = KeyWrapper::decrypt($data['ciphertext'], $data['encoded']);
    $this
      ->assertSame($text, $plaintext);
  }
  public function testReencryptsData() {
    $data = KeyWrapper::encrypt('aaaa');
    $wk = $data['encoded'];
    $text = 'abcd';
    $data = KeyWrapper::reencrypt($text, $wk);
    $plaintext = KeyWrapper::decrypt($data['ciphertext'], $wk);
    $this
      ->assertSame($text, $plaintext);
  }

}

Members