2 * Copyright 2001-2007 Internet2
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file saml/saml2/profile/AssertionValidator.h
20 * SAML 2.0 basic assertion validator
23 #ifndef __saml2_assval_h__
24 #define __saml2_assval_h__
26 #include <saml/base.h>
27 #include <xmltooling/validation/Validator.h>
32 class SAML_API Assertion;
33 class SAML_API Condition;
36 * SAML 2.0 basic assertion validator provides time and audience condition checking.
38 class SAML_API AssertionValidator : public virtual xmltooling::Validator
44 * @param audiences set of audience values representing recipient
45 * @param ts timestamp to evaluate assertion conditions, or 0 to bypass check
47 AssertionValidator(const std::vector<const XMLCh*>& audiences, time_t ts=0) : m_ts(ts), m_audiences(audiences) {}
48 virtual ~AssertionValidator() {}
50 void validate(const xmltooling::XMLObject* xmlObject) const;
53 * Type-safe validation method.
55 * @param assertion assertion to validate
57 virtual void validateAssertion(const Assertion& assertion) const;
60 * Condition validation.
62 * <p>Base class version only understands AudienceRestrictionConditions.
64 * @param condition condition to validate
65 * @return true iff condition was understood
67 virtual bool validateCondition(const Condition* condition) const;
71 const std::vector<const XMLCh*>& m_audiences;
77 #endif /* __saml2_assval_h__ */