public function decryptUsingKeySet(JWE &$jwe, JWKSet $jwkset, int $recipient): bool
    {
        $this->checkJWKSet($jwkset);
        $this->checkPayload($jwe);
        $this->checkRecipients($jwe);

        $plaintext = $this->decryptRecipientKey($jwe, $jwkset, $recipient);
        if (null !== $plaintext) {
            $jwe = $jwe->withPayload($plaintext);

            return true;
        }

        return false;
    }
public function decryptUsingKeySet(JWE &$jwe, JWKSet $jwkset, int $recipient): bool
    {
        $this->checkJWKSet($jwkset);
        $this->checkPayload($jwe);
        $this->checkRecipients($jwe);

        $plaintext = $this->decryptRecipientKey($jwe, $jwkset, $recipient);
        if (null !== $plaintext) {
            $jwe = $jwe->withPayload($plaintext);

            return true;
        }

        return false;
    }
public function decryptUsingKeySet ( JWE & $ jwe , JWKSet $ jwkset , int $ recipient ) : bool { $ this -> checkJWKSet ( $ jwkset ) ; $ this -> checkPayload ( $ jwe ) ; $ this -> checkRecipients ( $ jwe ) ; $ plaintext = $ this -> decryptRecipientKey ( $ jwe , $ jwkset , $ recipient ) ; if ( null !== $ plaintext ) { $ jwe = $ jwe -> withPayload ( $ plaintext ) ; return true ; } return false ; }
This method will try to decrypt the given JWE and recipient using a JWKSet.

@param JWE    $jwe       A JWE object to decrypt
@param JWKSet $jwkset    The key set used to decrypt the input
@param int    $recipient The recipient used to decrypt the token
This method will try to decrypt the given JWE and recipient using a JWKSet .