public static createRecipient ( Jose\Object\JWKInterface $recipient_key, array $headers = [] ) | ||
$recipient_key | Jose\Object\JWKInterface | |
$headers | array |
public static function createRecipient(JWKInterface $recipient_key, array $headers = [])
{
$recipient = new self();
$recipient->headers = $headers;
$recipient->recipient_key = $recipient_key;
return $recipient;
}
/** * {@inheritdoc} */ public function addRecipientInformation(JWKInterface $recipient_key, $recipient_headers = []) { Assertion::true(null === $this->getCiphertext(), 'The JWE is encrypted. No additional recipient allowed.'); $jwe = clone $this; $jwe->recipients[] = Recipient::createRecipient($recipient_key, $recipient_headers); return $jwe; }