View Javadoc

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.relyingparty.provider.saml2;
19  
20  import java.util.Collection;
21  
22  import org.opensaml.xml.util.LazySet;
23  
24  import edu.internet2.middleware.shibboleth.common.attribute.provider.SAML2AttributeAuthority;
25  import edu.internet2.middleware.shibboleth.common.relyingparty.provider.AbstractSAMLProfileConfiguration;
26  import edu.internet2.middleware.shibboleth.common.relyingparty.provider.CryptoOperationRequirementLevel;
27  
28  /**
29   * SAML 2 communication profile configuration settings.
30   */
31  public abstract class AbstractSAML2ProfileConfiguration extends AbstractSAMLProfileConfiguration {
32  
33      /** Attribute authority to use. */
34      private SAML2AttributeAuthority attributeAuthority;
35  
36      /** Whether to encrypt NameIDs. */
37      private CryptoOperationRequirementLevel encryptNameID;
38  
39      /** Whether to encrypt Assertions. */
40      private CryptoOperationRequirementLevel encryptAssertion;
41  
42      /** Maximum proxy count for an assertion. */
43      private int proxyCount;
44  
45      /** Audiences for the proxy. */
46      private Collection<String> proxyAudiences;
47  
48      /** Constructor. */
49      protected AbstractSAML2ProfileConfiguration() {
50          proxyAudiences = new LazySet<String>();
51      }
52  
53      /**
54       * Gets the Attribute authority to use.
55       * 
56       * @return Attribute authority to use
57       */
58      public SAML2AttributeAuthority getAttributeAuthority() {
59          return attributeAuthority;
60      }
61  
62      /**
63       * Sets the Attribute authority to use.
64       * 
65       * @param authority Attribute authority to use
66       */
67      public void setAttributeAuthority(SAML2AttributeAuthority authority) {
68          attributeAuthority = authority;
69      }
70  
71      /**
72       * Gets whether NameIDs should be encrypted.
73       * 
74       * @return whether NameIDs should be encrypted
75       */
76      public CryptoOperationRequirementLevel getEncryptNameID() {
77          return encryptNameID;
78      }
79  
80      /**
81       * Sets whether NameIDs should be encrypted.
82       * 
83       * @param encrypt whether NameIDs should be encrypted
84       */
85      public void setEncryptNameID(CryptoOperationRequirementLevel encrypt) {
86          encryptNameID = encrypt;
87      }
88  
89      /**
90       * Gets whether assertions should be encrypted.
91       * 
92       * @return whether assertions should be encrypted
93       */
94      public CryptoOperationRequirementLevel getEncryptAssertion() {
95          return encryptAssertion;
96      }
97  
98      /**
99       * Sets whether assertions should be encrypted.
100      * 
101      * @param encrypt whether assertions should be encrypted
102      */
103     public void setEncryptAssertion(CryptoOperationRequirementLevel encrypt) {
104         encryptAssertion = encrypt;
105     }
106 
107     /**
108      * Gets the maximum number of times an assertion may be proxied.
109      * 
110      * @return maximum number of times an assertion may be proxied
111      */
112     public int getProxyCount() {
113         return proxyCount;
114     }
115 
116     /**
117      * Gets the maximum number of times an assertion may be proxied.
118      * 
119      * @param count maximum number of times an assertion may be proxied
120      */
121     public void setProxyCount(int count) {
122         proxyCount = count;
123     }
124 
125     /**
126      * Gets the audiences for a proxied assertion.
127      * 
128      * @return audiences for a proxied assertion
129      */
130     public Collection<String> getProxyAudiences() {
131         return proxyAudiences;
132     }
133 }