@@ 39-47 (lines=9) @@ | ||
36 | if($spec instanceof IJWE_ParamsSpecification) |
|
37 | { |
|
38 | ||
39 | if($spec->getRecipientKey()->getKeyUse()->getString() !== JSONWebKeyPublicKeyUseValues::Encryption) |
|
40 | throw new InvalidJWKType |
|
41 | ( |
|
42 | sprintf |
|
43 | ( |
|
44 | 'use %s not supported (should be "enc")', |
|
45 | $spec->getRecipientKey()->getKeyUse()->getString() |
|
46 | ) |
|
47 | ); |
|
48 | ||
49 | if($spec->getAlg()->getString() !== $spec->getRecipientKey()->getAlgorithm()->getString()) |
|
50 | throw new InvalidJWKAlgorithm |
@@ 38-46 (lines=9) @@ | ||
35 | ||
36 | if($spec instanceof IJWS_ParamsSpecification) |
|
37 | { |
|
38 | if($spec->getKey()->getKeyUse()->getString() !== JSONWebKeyPublicKeyUseValues::Signature) |
|
39 | throw new InvalidJWKType |
|
40 | ( |
|
41 | sprintf |
|
42 | ( |
|
43 | 'use % not supported (sig)', |
|
44 | $spec->getKey()->getKeyUse()->getString() |
|
45 | ) |
|
46 | ); |
|
47 | ||
48 | if($spec->getAlg()->getString() !== $spec->getKey()->getAlgorithm()->getString()) |
|
49 | throw new InvalidJWKAlgorithm |