src/Parse.php
private function validateSignature(): void
    {
        $signature = '';

        try {
            $signature = $this->encode->signature(
                $this->encode->decode($this->getHeader()),
                $this->encode->decode($this->getPayload()),
                $this->jwt->getSecret()
            );
        } catch (\Throwable $e) {
            throw new ValidateException('Token could not be parsed.', 2);
        }

        if (!$this->validate->signature($signature, $this->getSignature())) {
            throw new ValidateException('Signature is invalid.', 3);
        }
    }
private function validateSignature(): void
    {
        $signature = '';

        try {
            $signature = $this->encode->signature(
                $this->encode->decode($this->getHeader()),
                $this->encode->decode($this->getPayload()),
                $this->jwt->getSecret()
            );
        } catch (\Throwable $e) {
            throw new ValidateException('Token could not be parsed.', 2);
        }

        if (!$this->validate->signature($signature, $this->getSignature())) {
            throw new ValidateException('Signature is invalid.', 3);
        }
    }
private function validateSignature ( ) : void { $ signature = '' ; try { $ signature = $ this -> encode -> signature ( $ this -> encode -> decode ( $ this -> getHeader ( ) ) , $ this -> encode -> decode ( $ this -> getPayload ( ) ) , $ this -> jwt -> getSecret ( ) ) ; } catch ( \ Throwable $ e ) { throw new ValidateException ( 'Token could not be parsed.' , 2 ) ; } if ( ! $ this -> validate -> signature ( $ signature , $ this -> getSignature ( ) ) ) { throw new ValidateException ( 'Signature is invalid.' , 3 ) ; } }
Validate the JWT's signature. The provided signature taken from the JWT
should match one newly generated from the JWT header and payload.

@throws Exception\ValidateException
Validate the JWT s signature . The provided signature taken from the JWT should match one newly generated from the JWT header and payload .