-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNestedTokenLoaderFactory.php
39 lines (33 loc) · 1.16 KB
/
NestedTokenLoaderFactory.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
declare(strict_types=1);
namespace Jose\Bundle\JoseFramework\Services;
use Psr\EventDispatcher\EventDispatcherInterface;
final class NestedTokenLoaderFactory
{
public function __construct(
private readonly JWELoaderFactory $jweLoaderFactory,
private readonly JWSLoaderFactory $jwsLoaderFactory,
private readonly EventDispatcherInterface $eventDispatcher
) {
}
public function create(
array $jweSerializers,
array $keyEncryptionAlgorithms,
array $contentEncryptionAlgorithms,
array $compressionMethods,
array $jweHeaderCheckers,
array $jwsSerializers,
array $signatureAlgorithms,
array $jwsHeaderCheckers
): NestedTokenLoader {
$jweLoader = $this->jweLoaderFactory->create(
$jweSerializers,
$keyEncryptionAlgorithms,
$contentEncryptionAlgorithms,
$compressionMethods,
$jweHeaderCheckers
);
$jwsLoader = $this->jwsLoaderFactory->create($jwsSerializers, $signatureAlgorithms, $jwsHeaderCheckers);
return new NestedTokenLoader($jweLoader, $jwsLoader, $this->eventDispatcher);
}
}