You are here

public static function MultiKeyWrapper::encrypt in Lockr 7.2

Same name and namespace in other branches
  1. 7.3 vendor/lockr/lockr/src/KeyWrapper/MultiKeyWrapper.php \Lockr\KeyWrapper\MultiKeyWrapper::encrypt()

Encrypt the given plaintext.

Parameters

string $plaintext:

Return value

array

Overrides KeyWrapperInterface::encrypt

1 call to MultiKeyWrapper::encrypt()
KeyClient::set in vendor/lockr/lockr-client/src/KeyClient.php
Sets a key in Lockr.

File

vendor/lockr/lockr-client/src/KeyWrapper/MultiKeyWrapper.php, line 31

Class

MultiKeyWrapper

Namespace

Lockr\KeyWrapper

Code

public static function encrypt($plaintext) {
  foreach (self::$wrappers as $wrapper) {
    if ($wrapper::enabled()) {
      return $wrapper::encrypt($plaintext);
    }
  }
  return false;
}