1 /* 2 * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.] 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.opensaml.xml.security.keyinfo; 18 19 import java.util.List; 20 21 import org.opensaml.xml.security.credential.Credential; 22 import org.opensaml.xml.security.credential.StaticCredentialResolver; 23 24 /** 25 * Simple implementation of {@link KeyInfoCredentialResolver} which just stores and returns a static set of credentials. 26 * 27 * <p> 28 * Note: no filtering or other evaluation of the credentials is performed. Any Criteria 29 * specified are ignored. For a similar Collection-based KeyInfoCredentialResolver implementation which does support 30 * evaluation and filtering based on supplied evaluable criteria, see {@link CollectionKeyInfoCredentialResolver}. 31 * </p> 32 * 33 * <p> 34 * This implementation might also be used at the end of a chain of KeyInfoCredentialResolvers in 35 * order to supply a default, fallback set of credentials, if none could otherwise be resolved. 36 * </p> 37 */ 38 public class StaticKeyInfoCredentialResolver extends StaticCredentialResolver implements KeyInfoCredentialResolver { 39 40 /** 41 * Constructor. 42 * 43 * @param credentials collection of credentials to be held by this resolver 44 */ 45 public StaticKeyInfoCredentialResolver(List<Credential> credentials) { 46 super(credentials); 47 } 48 49 /** 50 * Constructor. 51 * 52 * @param credential a single credential to be held by this resolver 53 */ 54 public StaticKeyInfoCredentialResolver(Credential credential) { 55 super(credential); 56 } 57 58 }