protected function verify($input, $signature)
    {
        $algo = $this->algos[$this->algo];

        // HMAC SHA.
        if (\substr($this->algo, 0, 2) === 'HS') {
            return \hash_equals($this->urlSafeEncode(\hash_hmac($algo, $input, $this->key, true)), $signature);
        }

        $this->validateKey();

        $pubKey = \openssl_pkey_get_details($this->key)['key'];

        return \openssl_verify($input, $this->urlSafeDecode($signature, false), $pubKey, $algo) === 1;
    }
protected function verify($input, $signature)
    {
        $algo = $this->algos[$this->algo];

        // HMAC SHA.
        if (\substr($this->algo, 0, 2) === 'HS') {
            return \hash_equals($this->urlSafeEncode(\hash_hmac($algo, $input, $this->key, true)), $signature);
        }

        $this->validateKey();

        $pubKey = \openssl_pkey_get_details($this->key)['key'];

        return \openssl_verify($input, $this->urlSafeDecode($signature, false), $pubKey, $algo) === 1;
    }
protected function verify ( $ input , $ signature ) { $ algo = $ this -> algos [ $ this -> algo ] ; // HMAC SHA. if ( \ substr ( $ this -> algo , 0 , 2 ) === 'HS' ) { return \ hash_equals ( $ this -> urlSafeEncode ( \ hash_hmac ( $ algo , $ input , $ this -> key , true ) ) , $ signature ) ; } $ this -> validateKey ( ) ; $ pubKey = \ openssl_pkey_get_details ( $ this -> key ) [ 'key' ] ; return \ openssl_verify ( $ input , $ this -> urlSafeDecode ( $ signature , false ) , $ pubKey , $ algo ) === 1 ; }
Verify the signature of given input.

@param string $input
@param string $signature

@throws JWTException When key is invalid.

@return bool
Verify the signature of given input .