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 net.minidev.json.JSONObject; 022 023import com.nimbusds.openid.connect.sdk.federation.entities.EntityID; 024import com.nimbusds.openid.connect.sdk.federation.entities.FederationMetadataType; 025 026 027/** 028 * Federation entity metadata validator. 029 */ 030public interface EntityMetadataValidator { 031 032 033 /** 034 * Returns the type of federation metadata that is validated. 035 * 036 * @return The federation metadata type. 037 */ 038 FederationMetadataType getType(); 039 040 041 /** 042 * Validates the specified metadata. 043 * 044 * @param entityID The entity ID. 045 * @param metadata The metadata, {@code null} if none. 046 * 047 * @throws InvalidEntityMetadataException If validation failed. 048 */ 049 void validate(final EntityID entityID, final JSONObject metadata) 050 throws InvalidEntityMetadataException; 051}