OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
lcobucci
/
jwt
/
src
/
Validation
/
Constraint
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:35:50 AM
rwxr-xr-x
📄
IdentifiedBy.php
623 bytes
08/12/2024 10:35:50 AM
rw-r--r--
📄
IssuedBy.php
673 bytes
08/12/2024 10:35:50 AM
rw-r--r--
📄
LeewayCannotBeNegative.php
354 bytes
08/12/2024 10:35:51 AM
rw-r--r--
📄
PermittedFor.php
657 bytes
08/12/2024 10:35:51 AM
rw-r--r--
📄
RelatedTo.php
642 bytes
08/12/2024 10:35:51 AM
rw-r--r--
📄
SignedWith.php
1.01 KB
08/12/2024 10:35:51 AM
rw-r--r--
📄
ValidAt.php
1.95 KB
08/12/2024 10:35:51 AM
rw-r--r--
Editing: SignedWith.php
Close
<?php declare(strict_types=1); namespace Lcobucci\JWT\Validation\Constraint; use Lcobucci\JWT\Signer; use Lcobucci\JWT\Token; use Lcobucci\JWT\Validation\Constraint; use Lcobucci\JWT\Validation\ConstraintViolation; final class SignedWith implements Constraint { private Signer $signer; private Signer\Key $key; public function __construct(Signer $signer, Signer\Key $key) { $this->signer = $signer; $this->key = $key; } public function assert(Token $token): void { if (! $token instanceof Token\Plain) { throw new ConstraintViolation('You should pass a plain token'); } if ($token->headers()->get('alg') !== $this->signer->algorithmId()) { throw new ConstraintViolation('Token signer mismatch'); } if (! $this->signer->verify($token->signature()->hash(), $token->payload(), $this->key)) { throw new ConstraintViolation('Token signature mismatch'); } } }