All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wiremock.extension.jwt.Rsa256JsonWebKeySet Maven / Gradle / Ivy

package org.wiremock.extension.jwt;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.tomakehurst.wiremock.common.Json;
import java.util.List;
import java.util.Optional;

public class Rsa256JsonWebKeySet {

    private final List keys;

    public Rsa256JsonWebKeySet(@JsonProperty("keys") List keys) {
        this.keys = keys;
    }

    public List getKeys() {
        return keys;
    }

    public Optional getKey(String keyId) {
        return keys.stream()
                .filter(key -> keyId.equals(key.kid))
                .findFirst();
    }

    public static Rsa256JsonWebKeySet parse(String json) {
        return Json.read(json, Rsa256JsonWebKeySet.class);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy