public function verifyWithKey(JWS $jws, JWK $jwk, int $signature, ?string $detachedPayload = null): bool
    {
        $jwkset = new JWKSet([$jwk]);

        return $this->verifyWithKeySet($jws, $jwkset, $signature, $detachedPayload);
    }
public function verifyWithKey(JWS $jws, JWK $jwk, int $signature, ?string $detachedPayload = null): bool
    {
        $jwkset = new JWKSet([$jwk]);

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

@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 and for the given signature . It returns true if the signature is verified otherwise false .