001package com.nimbusds.jose.jwk.source; 002 003 004import java.util.List; 005 006import com.nimbusds.jose.jwk.JWK; 007import com.nimbusds.jose.jwk.JWKSelector; 008import com.nimbusds.jose.proc.SecurityContext; 009 010 011/** 012 * JSON Web Key (JWK) source. Exposes a method for retrieving JWKs matching a 013 * specified selector. An optional context parameter is available to facilitate 014 * passing of additional data between the caller and the underlying JWK source 015 * (in both directions). Implementations must be thread-safe. 016 * 017 * @author Vladimir Dzhuvinov 018 * @version 2016-04-10 019 */ 020public interface JWKSource <C extends SecurityContext> { 021 022 023 /** 024 * Retrieves a list of JWKs matching the specified selector. 025 * 026 * @param jwkSelector A JWK selector. Must not be {@code null}. 027 * @param context Optional context, {@code null} if not required. 028 * 029 * @return The matching JWKs, empty list if no matches were found. 030 */ 031 List<JWK> get(final JWKSelector jwkSelector, final C context); 032}