public function decryptUsingKeySet(Object\JWEInterface &$jwe, Object\JWKSetInterface $jwk_set, &$recipient_index = null)
{
$this->checkJWKSet($jwk_set);
$this->checkPayload($jwe);
$this->checkRecipients($jwe);
$nb_recipients = $jwe->countRecipients();
for ($i = 0; $i < $nb_recipients; $i++) {
if (is_int($result = $this->decryptRecipientKey($jwe, $jwk_set, $i))) {
$recipient_index = $result;
return;
}
}
throw new \InvalidArgumentException('Unable to decrypt the JWE.');
}