19declare(strict_types=1);
56 $this->salt_factory =
new Factory();
76 $this->payload_builder =
new Builder();
82 Disposition $disposition,
84 ?\DateTimeImmutable $until =
null
86 $payload = $this->payload_builder->shortFile(
91 if ($until !==
null) {
92 $payload->setUntil($until->getTimestamp());
95 return $this->signing_serializer->sign(
97 $this->salt_factory->create(
'stream')
104 if (
$data ===
null) {
107 return $this->payload_builder->shortFileFromRaw(
$data);
113 ?\DateTimeImmutable $until =
null
117 if ($until !==
null) {
118 $payload->setUntil($until->getTimestamp());
121 return $this->signing_serializer->sign(
123 $this->salt_factory->create($salt)
131 return $this->signing_serializer->verify(
133 $this->salt_factory->create($salt)
sign(array $data, string $salt, ?\DateTimeImmutable $until=null)
__construct(SecretKeyRotation $key_rotation, ?Algorithm $algorithm=null, ?Compression $compression=null, ?Transport $transport=null)
getSignedStreamToken(FileStream $stream, string $filename, Disposition $disposition, int $user_id, ?\DateTimeImmutable $until=null)
verifyStreamToken(string $token)
SigningSerializer $signing_serializer
verify(string $token, string $salt)
Key rotation can provide an extra layer of mitigation against an attacker discovering a secret key.
The salt is combined with the secret key to derive a unique key for distinguishing different contexts...
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
The base interface for all filesystem streams.
if(count($parts) !=3) $payload