Boost changes
[shibboleth/cpp-opensaml.git] / saml / saml2 / profile / impl / SAML2AssertionPolicy.cpp
1 /**
2  * Licensed to the University Corporation for Advanced Internet
3  * Development, Inc. (UCAID) under one or more contributor license
4  * agreements. See the NOTICE file distributed with this work for
5  * additional information regarding copyright ownership.
6  *
7  * UCAID licenses this file to you under the Apache License,
8  * Version 2.0 (the "License"); you may not use this file except
9  * in compliance with the License. You may obtain a copy of the
10  * License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17  * either express or implied. See the License for the specific
18  * language governing permissions and limitations under the License.
19  */
20
21 /**
22  * SAML2AssertionPolicy.cpp
23  *
24  * Policy subclass to track SAML 2.0 Assertion SubjectConfirmation.
25  */
26
27 #include "internal.h"
28 #include "saml2/profile/SAML2AssertionPolicy.h"
29
30 using namespace opensaml::saml2md;
31 using namespace opensaml::saml2;
32 using namespace opensaml;
33 using namespace xmltooling;
34
35 SAML2AssertionPolicy::SAML2AssertionPolicy(
36     const MetadataProvider* metadataProvider, const xmltooling::QName* role, const TrustEngine* trustEngine, bool validate
37     ) : SecurityPolicy(metadataProvider, role, trustEngine, validate), m_confirmation(nullptr)
38 {
39 }
40
41 SAML2AssertionPolicy::~SAML2AssertionPolicy()
42 {
43 }
44
45 void SAML2AssertionPolicy::reset(bool messageOnly)
46 {
47     SecurityPolicy::reset(messageOnly);
48     SAML2AssertionPolicy::_reset(messageOnly);
49 }
50
51 void SAML2AssertionPolicy::_reset(bool messageOnly)
52 {
53     m_confirmation = nullptr;
54 }
55
56 const SubjectConfirmation* SAML2AssertionPolicy::getSubjectConfirmation() const
57 {
58     return m_confirmation;
59 }
60
61 void SAML2AssertionPolicy::setSubjectConfirmation(const SubjectConfirmation* confirmation)
62 {
63     m_confirmation = confirmation;
64 }