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