createJWE() public static method

public static createJWE ( $payload, array $shared_protected_headers = [], array $shared_headers = [], $aad = null )
$shared_protected_headers array
$shared_headers array
Beispiel #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);
 }