@@ 241-250 (lines=10) @@ | ||
238 | if (is_null($this->jwk)) |
|
239 | throw new JWEInvalidRecipientKeyException; |
|
240 | ||
241 | if($this->jwk->getAlgorithm()->getValue()!== $this->header->getAlgorithm()->getString()) |
|
242 | throw new InvalidJWKAlgorithm |
|
243 | ( |
|
244 | sprintf |
|
245 | ( |
|
246 | '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', |
|
247 | $this->jwk->getAlgorithm()->getValue(), |
|
248 | $this->header->getAlgorithm()->getString() |
|
249 | ) |
|
250 | ); |
|
251 | ||
252 | $recipient_public_key = $this->jwk->getKey(JSONWebKeyKeyOperationsValues::EncryptContent); |
|
253 | ||
@@ 419-428 (lines=10) @@ | ||
416 | ||
417 | if (!$this->should_decrypt) return $this; |
|
418 | ||
419 | if($this->jwk->getAlgorithm()->getValue()!== $this->header->getAlgorithm()->getString()) |
|
420 | throw new InvalidJWKAlgorithm |
|
421 | ( |
|
422 | sprintf |
|
423 | ( |
|
424 | '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', |
|
425 | $this->jwk->getAlgorithm()->getValue(), |
|
426 | $this->header->getAlgorithm()->getString() |
|
427 | ) |
|
428 | ); |
|
429 | ||
430 | $key_management_algorithm = KeyManagementAlgorithms_Registry::getInstance()->get |
|
431 | ( |