Search in sources :

Example 1 with JwsAlgorithms

use of org.springframework.security.oauth2.jose.jws.JwsAlgorithms in project spring-security by spring-projects.

the class JwtDecoderProviderConfigurationUtils method getSignatureAlgorithms.

static Set<SignatureAlgorithm> getSignatureAlgorithms(JWKSource<SecurityContext> jwkSource) {
    Set<JWSAlgorithm> jwsAlgorithms = getJWSAlgorithms(jwkSource);
    Set<SignatureAlgorithm> signatureAlgorithms = new HashSet<>();
    for (JWSAlgorithm jwsAlgorithm : jwsAlgorithms) {
        SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.from(jwsAlgorithm.getName());
        if (signatureAlgorithm != null) {
            signatureAlgorithms.add(signatureAlgorithm);
        }
    }
    return signatureAlgorithms;
}
Also used : SignatureAlgorithm(org.springframework.security.oauth2.jose.jws.SignatureAlgorithm) JWSAlgorithm(com.nimbusds.jose.JWSAlgorithm) HashSet(java.util.HashSet)

Aggregations

JWSAlgorithm (com.nimbusds.jose.JWSAlgorithm)1 HashSet (java.util.HashSet)1 SignatureAlgorithm (org.springframework.security.oauth2.jose.jws.SignatureAlgorithm)1