Lcobucci\JWT\Token::verify PHP Method

verify() public method

Verify if the key matches with the one that created the signature
public verify ( Lcobucci\JWT\Signer $signer, Lcobucci\JWT\Signer\Key | string $key ) : boolean
$signer Lcobucci\JWT\Signer
$key Lcobucci\JWT\Signer\Key | string
return boolean
    public function verify(Signer $signer, $key) : bool
    {
        if ($this->signature === null || $this->headers['alg'] !== $signer->getAlgorithmId()) {
            return false;
        }
        return $this->signature->verify($signer, $this->getPayload(), $key);
    }

Usage Example

コード例 #1
0
ファイル: TokenValidator.php プロジェクト: Algatux/symfony3.0
 /**
  * @param Token $token
  * @return bool
  */
 public function validateToken(Token $token) : bool
 {
     return $token->validate($this->validationData) && $token->verify($this->signer, $this->secret);
 }
All Usage Examples Of Lcobucci\JWT\Token::verify