CoreFiles by mySites.guru
JWEDecrypterFactory.php38 lines, 1,272 bytes, from Joomla_5.2.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 5.1.0-alpha4
md5
86a302d5747756dcef67cf8b9ef2399e
sha1
aee98c58aa441aff1f974e446588ab11f8a1e96f
sha256
a10f40447679eeaf8ebb70e413564c6a92e06769521560bd552f6e24d7aafb4b
<?php

declare(strict_types=1);

namespace Jose\Component\Encryption;

use Jose\Component\Core\AlgorithmManagerFactory;
use Jose\Component\Encryption\Compression\CompressionMethodManagerFactory;

class JWEDecrypterFactory
{
    public function __construct(
        private readonly AlgorithmManagerFactory $algorithmManagerFactory,
        private readonly CompressionMethodManagerFactory $compressionMethodManagerFactory
    ) {
    }

    /**
     * Creates a JWE Decrypter object using the given key encryption algorithms, content encryption algorithms and
     * compression methods.
     *
     * @param string[] $keyEncryptionAlgorithms
     * @param string[] $contentEncryptionAlgorithms
     * @param string[] $compressionMethods
     */
    public function create(
        array $keyEncryptionAlgorithms,
        array $contentEncryptionAlgorithms,
        array $compressionMethods
    ): JWEDecrypter {
        $algorithmManager = $this->algorithmManagerFactory->create(
            array_merge($keyEncryptionAlgorithms, $contentEncryptionAlgorithms)
        );
        $compressionMethodManager = $this->compressionMethodManagerFactory->create($compressionMethods);

        return new JWEDecrypter($algorithmManager, null, $compressionMethodManager);
    }
}

The same content is in 17 releases, Joomla 5.1.0-beta1 to 5.2.0-alpha1. See them all, or every version of this file.