Skip to content

Commit

Permalink
Merge branch '4.11.x' into 4.12.x
Browse files Browse the repository at this point in the history
  • Loading branch information
sdelamo committed Nov 29, 2024
2 parents 06ddf39 + 4876089 commit bd47b8c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
Expand Down Expand Up @@ -71,10 +72,7 @@ public static boolean verify(SignedJWT jwt, JWKSet jwkSet, JwkValidator jwkValid
* @return whether this signature configuration supports this algorithm
*/
public static boolean supports(JWSAlgorithm algorithm, JWKSet jwkSet) {
return jwkSet.getKeys()
.stream()
.map(JWK::getAlgorithm)
.anyMatch(algorithm::equals);
return supports(algorithm, jwkSet.getKeys());
}

/**
Expand All @@ -88,6 +86,7 @@ public static boolean supports(JWSAlgorithm algorithm, List<JWK> keys) {
return keys
.stream()
.map(JWK::getAlgorithm)
.filter(Objects::nonNull)
.anyMatch(algorithm::equals);
}

Expand All @@ -106,6 +105,7 @@ public static String supportedAlgorithmsMessage(JWKSet jwkSet) {
public static String supportedAlgorithmsMessage(List<JWK> keys) {
return keys.stream()
.map(JWK::getAlgorithm)
.filter(Objects::nonNull)
.map(Algorithm::getName)
.distinct()
.reduce((a, b) -> a + ", " + b)
Expand Down

0 comments on commit bd47b8c

Please sign in to comment.