1 /* 2 * Licensed to the University Corporation for Advanced Internet Development, 3 * Inc. (UCAID) under one or more contributor license agreements. See the 4 * NOTICE file distributed with this work for additional information regarding 5 * copyright ownership. The UCAID licenses this file to You under the Apache 6 * License, Version 2.0 (the "License"); you may not use this file except in 7 * compliance with the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package edu.internet2.middleware.shibboleth.common.config.security; 19 20 import java.util.List; 21 22 import org.opensaml.xml.security.credential.UsageType; 23 import org.springframework.beans.factory.config.AbstractFactoryBean; 24 25 /** 26 * Abstract factory bean for building {@link org.opensaml.xml.security.credential.Credential}s. 27 */ 28 public abstract class AbstractCredentialFactoryBean extends AbstractFactoryBean { 29 30 /** Usage type of the credential. */ 31 private UsageType usageType; 32 33 /** Names for the key represented by the credential. */ 34 private List<String> keyNames; 35 36 /** Identifier for the owner of the credential. */ 37 private String entityID; 38 39 /** 40 * Gets the names for the key represented by the credential. 41 * 42 * @return names for the key represented by the credential 43 */ 44 public List<String> getKeyNames() { 45 return keyNames; 46 } 47 48 /** 49 * Gets the usage type of the credential. 50 * 51 * @return usage type of the credential 52 */ 53 public UsageType getUsageType(){ 54 return usageType; 55 } 56 57 /** 58 * Get the entity ID of the credential. 59 * 60 * @return the entity ID 61 */ 62 public String getEntityID() { 63 return entityID; 64 } 65 66 /** 67 * Sets the names for the key represented by the credential. 68 * 69 * @param names names for the key represented by the credential 70 */ 71 public void setKeyNames(List<String> names) { 72 keyNames = names; 73 } 74 75 /** 76 * Sets the usage type of the credential. 77 * 78 * @param type usage type of the credential 79 */ 80 public void setUsageType(UsageType type){ 81 usageType = type; 82 } 83 84 /** 85 * Set the entity ID of the credential. 86 * 87 * @param newEntityID the entity ID 88 */ 89 public void setEntityID(String newEntityID) { 90 entityID = newEntityID; 91 } 92 }