Jose\Encrypter::encryptJWE PHP Method

encryptJWE() private method

private encryptJWE ( Jose\Object\JWEInterface &$jwe, Jose\Algorithm\ContentEncryptionAlgorithmInterface $content_encryption_algorithm, string $cek, string $iv, Jose\Compression\CompressionInterface $compression_method = null )
$jwe Jose\Object\JWEInterface
$content_encryption_algorithm Jose\Algorithm\ContentEncryptionAlgorithmInterface
$cek string
$iv string
$compression_method Jose\Compression\CompressionInterface
    private function encryptJWE(Object\JWEInterface &$jwe, Algorithm\ContentEncryptionAlgorithmInterface $content_encryption_algorithm, $cek, $iv, Compression\CompressionInterface $compression_method = null)
    {
        if (!empty($jwe->getSharedProtectedHeaders())) {
            $jwe = $jwe->withEncodedSharedProtectedHeaders(Base64Url::encode(json_encode($jwe->getSharedProtectedHeaders())));
        }
        $tag = null;
        $payload = $this->preparePayload($jwe->getPayload(), $compression_method);
        $aad = null === $jwe->getAAD() ? null : Base64Url::encode($jwe->getAAD());
        $ciphertext = $content_encryption_algorithm->encryptContent($payload, $cek, $iv, $aad, $jwe->getEncodedSharedProtectedHeaders(), $tag);
        $jwe = $jwe->withCiphertext($ciphertext);
        $jwe = $jwe->withIV($iv);
        if (null !== $tag) {
            $jwe = $jwe->withTag($tag);
        }
    }