public function verifySignatureHash(UserInterface
$user, int
$expires, string
$hash): void
{ if ($expires <
time()) { throw new ExpiredSignatureException('Signature has expired.'
);
} if (!
hash_equals($hash,
$this->
computeSignatureHash($user,
$expires))) { throw new InvalidSignatureException('Invalid or expired signature.'
);
} if ($this->expiredSignaturesStorage &&
$this->maxUses
) { if ($this->expiredSignaturesStorage->
countUsages($hash) >=
$this->maxUses
) { throw new ExpiredSignatureException(sprintf('Signature can only be used "%d" times.',
$this->maxUses
));
} $this->expiredSignaturesStorage->
incrementUsages($hash);
} } /**
* Computes the secure hash for the provided user and expire time.
*
* @param int $expires The expiry time as a unix timestamp
*/