@@ 238-247 (lines=10) @@ | ||
235 | if (is_null($this->jwk)) |
|
236 | throw new JWEInvalidRecipientKeyException; |
|
237 | ||
238 | if($this->jwk->getAlgorithm()->getValue()!== $this->header->getAlgorithm()->getString()) |
|
239 | throw new InvalidJWKAlgorithm |
|
240 | ( |
|
241 | sprintf |
|
242 | ( |
|
243 | 'mismatch between algorithm intended for use with the key %s and the cryptographic algorithm used to encrypt or determine the value of the CEK %s', |
|
244 | $this->jwk->getAlgorithm()->getValue(), |
|
245 | $this->header->getAlgorithm()->getString() |
|
246 | ) |
|
247 | ); |
|
248 | ||
249 | $recipient_public_key = $this->jwk->getKey(JSONWebKeyKeyOperationsValues::EncryptContent); |
|
250 | ||
@@ 417-426 (lines=10) @@ | ||
414 | ||
415 | if (!$this->should_decrypt) return $this; |
|
416 | ||
417 | if($this->jwk->getAlgorithm()->getValue()!== $this->header->getAlgorithm()->getString()) |
|
418 | throw new InvalidJWKAlgorithm |
|
419 | ( |
|
420 | sprintf |
|
421 | ( |
|
422 | 'mismatch between algorithm intended for use with the key %s and the cryptographic algorithm used to encrypt or determine the value of the CEK %s', |
|
423 | $this->jwk->getAlgorithm()->getValue(), |
|
424 | $this->header->getAlgorithm()->getString() |
|
425 | ) |
|
426 | ); |
|
427 | ||
428 | $key_management_algorithm = KeyManagementAlgorithms_Registry::getInstance()->get |
|
429 | ( |