001/* 002 * oauth2-oidc-sdk 003 * 004 * Copyright 2012-2020, Connect2id Ltd and contributors. 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use 007 * this file except in compliance with the License. You may obtain a copy of the 008 * License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software distributed 013 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 014 * CONDITIONS OF ANY KIND, either express or implied. See the License for the 015 * specific language governing permissions and limitations under the License. 016 */ 017 018package com.nimbusds.openid.connect.sdk.federation.trust; 019 020 021import java.net.URI; 022 023import com.nimbusds.openid.connect.sdk.federation.entities.EntityID; 024import com.nimbusds.openid.connect.sdk.federation.entities.EntityStatement; 025 026 027/** 028 * Entity statement retriever for resolving trust chains. 029 */ 030public interface EntityStatementRetriever { 031 032 033 /** 034 * Fetches an entity's self-issued statement from its federation entity 035 * configuration endpoint. 036 * 037 * @param target The entity ID. Must not be {@code null}. 038 * 039 * @return The entity statement. 040 * 041 * @throws ResolveException If fetching failed. 042 */ 043 EntityStatement fetchSelfIssuedEntityStatement(final EntityID target) 044 throws ResolveException; 045 046 047 /** 048 * Fetches an entity statement from a federation API endpoint. 049 * 050 * @param federationAPIEndpoint The federation API endpoint. Must not 051 * be {@code null}. 052 * @param issuer The entity statement issuer, typically 053 * the ID of the entity operating the 054 * endpoint. Must not be {@code null}. 055 * @param subject The entity statement subject. Must not 056 * be {@code null}. 057 * 058 * @return The entity statement. 059 * 060 * @throws ResolveException If fetching failed. 061 */ 062 EntityStatement fetchEntityStatement(final URI federationAPIEndpoint, final EntityID issuer, final EntityID subject) 063 throws ResolveException; 064}