74745fffb31566d75d13a2ac1e7dc7b65902c5b8
[shibboleth/sp.git] / shibsp / security / SecurityPolicy.h
1 /*
2  *  Copyright 2001-2007 Internet2
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 /**
18  * @file shibsp/security/SecurityPolicy.h
19  * 
20  * SP-specific SecurityPolicy subclass.
21  */
22
23 #ifndef __shibsp_secpol_h__
24 #define __shibsp_secpol_h__
25
26 #include <shibsp/base.h>
27 #include <saml/binding/SecurityPolicy.h>
28
29 namespace shibsp {
30     
31     class SHIBSP_API Application;
32
33     /**
34      * SP-specific SecurityPolicy subclass.
35      */
36     class SHIBSP_API SecurityPolicy : public opensaml::SecurityPolicy
37     {
38     public:
39         /**
40          * Constructor for policy.
41          * 
42          * @param application       an Application instance
43          * @param role              identifies the role (generally IdP or SP) of the policy peer 
44          * @param validate          true iff XML parsing should be done with validation
45          */
46         SecurityPolicy(const Application& application, const xmltooling::QName* role=NULL, bool validate=true);
47
48         virtual ~SecurityPolicy() {}
49
50         /**
51          * Returns the Application associated with the policy.
52          * 
53          * @return the associated Application
54          */
55         const Application& getApplication() const {
56             return m_application;
57         }
58
59     private:
60         const Application& m_application;
61     };
62
63 };
64
65 #endif /* __shibsp_secpol_h__ */