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 configuration.
035         *
036         * @param target The entity ID. Must not be {@code null}.
037         *
038         * @return The entity statement.
039         *
040         * @throws ResolveException If fetching failed.
041         */
042        EntityStatement fetchEntityConfiguration(final EntityID target)
043                throws ResolveException;
044        
045        
046        /**
047         * Fetches an entity statement.
048         *
049         * @param federationAPIEndpoint The federation API endpoint. Must not
050         *                              be {@code null}.
051         * @param issuer                The entity statement issuer, typically
052         *                              the ID of the entity operating the
053         *                              endpoint. Must not be {@code null}.
054         * @param subject               The entity statement subject. Must not
055         *                              be {@code null}.
056         *
057         * @return The entity statement.
058         *
059         * @throws ResolveException If fetching failed.
060         */
061        EntityStatement fetchEntityStatement(final URI federationAPIEndpoint, final EntityID issuer, final EntityID subject)
062                throws ResolveException;
063}