You are here

public static function LockrAes128CtrSha256KeyWrapper::reencrypt in Lockr 7.3

Same name and namespace in other branches
  1. 7.2 vendor/lockr/lockr-client/src/KeyWrapper/LockrAes128CtrSha256KeyWrapper.php \Lockr\KeyWrapper\LockrAes128CtrSha256KeyWrapper::reencrypt()

Encrypt the given plaintext reusing state.

Parameters

string $plaintext:

string $wrapping_key:

Return value

array

Overrides KeyWrapperInterface::reencrypt

1 call to LockrAes128CtrSha256KeyWrapper::reencrypt()
LockrAes128CtrSha256KeyWrapperTest::testReencryptsData in vendor/lockr/lockr/tests/KeyWrapper/LockrAes128CtrSha256KeyWrapperTest.php

File

vendor/lockr/lockr/src/KeyWrapper/LockrAes128CtrSha256KeyWrapper.php, line 37

Class

LockrAes128CtrSha256KeyWrapper

Namespace

Lockr\KeyWrapper

Code

public static function reencrypt($plaintext, $wrapping_key) {
  $parts = self::decode($wrapping_key);
  if (!$parts) {
    return false;
  }
  list($key, $iv, $hmac_key) = $parts;
  return self::doEncrypt($plaintext, $key, $iv, $hmac_key);
}