rotateKey() public static method

Key rotation method -- decrypt with your old key then re-encrypt with your new key
public static rotateKey ( string $ciphertext, Defuse\Crypto\Key $oldKey, Defuse\Crypto\Key $newKey ) : string
$ciphertext string
$oldKey Defuse\Crypto\Key
$newKey Defuse\Crypto\Key
return string
Esempio n. 1
0
 /**
  * Key rotation method -- decrypt with your old key then re-encrypt with your new key
  *
  * @param string             $hashedValue
  * @param \Defuse\Crypto\Key $newKey
  *
  * @return string
  */
 public function shouldRecreate(string $hashedValue, Key $newKey) : string
 {
     return PasswordLock::rotateKey($hashedValue, $this->key, $newKey);
 }