You are here

public static function MultiKeyWrapper::decrypt in Lockr 7.3

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

Decrypt the given ciphertext.

Parameters

string $ciphertext:

string $wrapping_key:

Return value

string|bool

Overrides KeyWrapperInterface::decrypt

1 call to MultiKeyWrapper::decrypt()
Lockr::getSecretValue in vendor/lockr/lockr/src/Lockr.php
Gets the latest value of a secret by name.

File

vendor/lockr/lockr/src/KeyWrapper/MultiKeyWrapper.php, line 55

Class

MultiKeyWrapper

Namespace

Lockr\KeyWrapper

Code

public static function decrypt($ciphertext, $wrapping_key) {
  foreach (self::$wrappers as $prefix => $wrapper) {
    if (!$prefix || strpos($wrapping_key, $prefix) === 0) {
      return $wrapper::decrypt($ciphertext, $wrapping_key);
    }
  }
  return false;
}