- md5
- 0e5cb8c5c6ad77d90918b345487ad4f0
- sha1
- dbaacd7a4701b92430b93dc81fb61488994a3482
- sha256
- f5238a4cb29cb240504539f629aef97069bd1f02325efb0d1fa78fc7c67d9dfe
<?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 null|CompressionMethodManagerFactory $compressionMethodManagerFactory = null
) {
if ($compressionMethodManagerFactory !== null) {
trigger_deprecation(
'web-token/jwt-library',
'3.3.0',
'The parameter "$compressionMethodManagerFactory" is deprecated and will be removed in 4.0.0. Compression is not recommended for JWE. Please set "null" instead.'
);
}
}
/**
* Creates a JWE Decrypter object using the given key encryption algorithms, content encryption algorithms and
* compression methods.
*
* @param string[] $encryptionAlgorithms
* @param null|string[] $contentEncryptionAlgorithms
* @param null|string[] $compressionMethods
*/
public function create(
array $encryptionAlgorithms,
null|array $contentEncryptionAlgorithms = null,
null|array $compressionMethods = null
): JWEDecrypter {
if ($contentEncryptionAlgorithms !== null) {
$encryptionAlgorithms = array_merge($encryptionAlgorithms, $contentEncryptionAlgorithms);
}
$algorithmManager = $this->algorithmManagerFactory->create($encryptionAlgorithms);
$compressionMethodManager = $compressionMethods === null ? null : $this->compressionMethodManagerFactory?->create(
$compressionMethods
);
return new JWEDecrypter($algorithmManager, null, $compressionMethodManager);
}
}
The same content is in 118 releases, Joomla 5.2.0-alpha2 to 6.2.1. See them all, or every version of this file.