public function verifyWithKeySet(JWS $jws, JWKSet $jwkset, int $signature, ?string $detachedPayload = null): bool
    {
        $this->checkJWKSet($jwkset);
        $this->checkSignatures($jws);
        $this->checkPayload($jws, $detachedPayload);

        $signature = $jws->getSignature($signature);

        return $this->verifySignature($jws, $jwkset, $signature, $detachedPayload);
    }
public function verifyWithKeySet(JWS $jws, JWKSet $jwkset, int $signature, ?string $detachedPayload = null): bool
    {
        $this->checkJWKSet($jwkset);
        $this->checkSignatures($jws);
        $this->checkPayload($jws, $detachedPayload);

        $signature = $jws->getSignature($signature);

        return $this->verifySignature($jws, $jwkset, $signature, $detachedPayload);
    }
public function verifyWithKeySet ( JWS $ jws , JWKSet $ jwkset , int $ signature , ? string $ detachedPayload = null ) : bool { $ this -> checkJWKSet ( $ jwkset ) ; $ this -> checkSignatures ( $ jws ) ; $ this -> checkPayload ( $ jws , $ detachedPayload ) ; $ signature = $ jws -> getSignature ( $ signature ) ; return $ this -> verifySignature ( $ jws , $ jwkset , $ signature , $ detachedPayload ) ; }
This method will try to verify the JWS object using the given key set and for the given signature.
It returns true if the signature is verified, otherwise false.

@param JWS         $jws             A JWS object
@param JWKSet      $jwkset          The signature will be verified using keys in the key set
@param string|null $detachedPayload If not null, the value must be the detached payload encoded in Base64 URL safe. If the input contains a payload, throws an exception.

@return bool true if the verification of the signature succeeded, else false
This method will try to verify the JWS object using the given key set and for the given signature . It returns true if the signature is verified otherwise false .