Jose\EncrypterInterface::encrypt PHP Méthode

encrypt() public méthode

public encrypt ( Jose\Object\JWEInterface &$jwe )
$jwe Jose\Object\JWEInterface
    public function encrypt(Object\JWEInterface &$jwe);

Usage Example

Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function encrypt($payload, array $encryption_protected_headers, Object\JWKInterface $encryption_key)
 {
     Assertion::true($this->isEncryptionSupportEnabled(), 'The encryption support is not enabled');
     $jwe = Factory\JWEFactory::createJWE($payload, $encryption_protected_headers);
     $jwe = $jwe->addRecipientInformation($encryption_key);
     $this->encrypter->encrypt($jwe);
     return $jwe->toCompactJSON(0);
 }
All Usage Examples Of Jose\EncrypterInterface::encrypt