You are here

public function AsymmetricalEncryptionMethod::encrypt in Encrypt 8.3

Encrypt text.

Parameters

string $text: The text to be encrypted.

string $key: The key to encrypt the text with.

Return value

string The encrypted text

Throws

\Drupal\encrypt\Exception\EncryptException Thrown when encryption fails.

Overrides EncryptionMethodInterface::encrypt

File

tests/modules/encrypt_test/src/Plugin/EncryptionMethod/AsymmetricalEncryptionMethod.php, line 33

Class

AsymmetricalEncryptionMethod
Encryption-only encryption method, it can NOT decrypt.

Namespace

Drupal\encrypt_test\Plugin\EncryptionMethod

Code

public function encrypt($text, $key, $options = []) {
  return '###encrypted###';
}