Jose\Encrypter::processRecipient PHP Method

processRecipient() private method

private processRecipient ( Jose\Object\JWEInterface $jwe, Jose\Object\RecipientInterface &$recipient, string $cek, Jose\Algorithm\ContentEncryptionAlgorithmInterface $content_encryption_algorithm, array &$additional_headers )
$jwe Jose\Object\JWEInterface
$recipient Jose\Object\RecipientInterface
$cek string
$content_encryption_algorithm Jose\Algorithm\ContentEncryptionAlgorithmInterface
$additional_headers array
    private function processRecipient(Object\JWEInterface $jwe, Object\RecipientInterface &$recipient, $cek, Algorithm\ContentEncryptionAlgorithmInterface $content_encryption_algorithm, array &$additional_headers)
    {
        if (null === $recipient->getRecipientKey()) {
            return;
        }
        $complete_headers = array_merge($jwe->getSharedProtectedHeaders(), $jwe->getSharedHeaders(), $recipient->getHeaders());
        $key_encryption_algorithm = $this->findKeyEncryptionAlgorithm($complete_headers);
        $this->checkKeys($key_encryption_algorithm, $content_encryption_algorithm, $recipient->getRecipientKey());
        $encrypted_content_encryption_key = $this->getEncryptedKey($complete_headers, $cek, $key_encryption_algorithm, $content_encryption_algorithm, $additional_headers, $recipient->getRecipientKey());
        $recipient_headers = $recipient->getHeaders();
        if (!empty($additional_headers) && 1 !== $jwe->countRecipients()) {
            $recipient_headers = array_merge($recipient_headers, $additional_headers);
            $additional_headers = [];
        }
        $recipient = Object\Recipient::createRecipientFromLoadedJWE($recipient_headers, $encrypted_content_encryption_key);
    }