File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -102,17 +102,11 @@ public static function parseKey(array $jwk, string $defaultAlg = null): ?Key
102
102
throw new UnexpectedValueException ('JWK must contain a "kty" parameter ' );
103
103
}
104
104
105
- $ ktyNotRequiringAlg = [
106
- // In Octet Key Pair (OKP) keys, the signing algorithm (alg) will not be read from the
107
- // JWK, as it can be inferred directly from the curve type (crv).
108
- // @see https://datatracker.ietf.org/doc/html/rfc8037#section-3.1
109
- 'OKP ' ,
110
- ];
111
- if (!isset ($ jwk ['alg ' ]) && !\in_array ($ jwk ['kty ' ], $ ktyNotRequiringAlg , true )) {
105
+ if (!isset ($ jwk ['alg ' ])) {
112
106
if (\is_null ($ defaultAlg )) {
113
107
// The "alg" parameter is optional in a KTY, but an algorithm is required
114
- // for parsing certain key types in this library. Use the $defaultAlg parameter
115
- // when parsing the key set in order to prevent this error.
108
+ // for parsing in this library. Use the $defaultAlg parameter when parsing the
109
+ // key set in order to prevent this error.
116
110
// @see https://datatracker.ietf.org/doc/html/rfc7517#section-4.4
117
111
throw new UnexpectedValueException ('JWK must contain an "alg" parameter ' );
118
112
}
You can’t perform that action at this time.
0 commit comments