View Javadoc

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