2 * Copyright 2001-2005 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 #include <saml/signature/SignatureProfileValidator.h>
20 #include <xmltooling/signature/CredentialResolver.h>
21 #include <xmltooling/signature/KeyInfo.h>
22 #include <xmltooling/signature/SignatureValidator.h>
24 using namespace xmlsignature;
26 class _addcert : public std::binary_function<X509Data*,XSECCryptoX509*,void> {
28 void operator()(X509Data* bag, XSECCryptoX509* cert) const {
29 safeBuffer& buf=cert->getDEREncodingSB();
30 X509Certificate* x=X509CertificateBuilder::buildX509Certificate();
31 x->setValue(buf.sbStrToXMLCh());
32 bag->getX509Certificates().push_back(x);
36 class SAMLSignatureTestBase : public SAMLObjectBaseTestCase {
38 CredentialResolver* m_resolver;
42 SAMLObjectBaseTestCase::setUp();
43 string config = data_path + "FilesystemCredentialResolver.xml";
44 ifstream in(config.c_str());
45 DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
46 XercesJanitor<DOMDocument> janitor(doc);
47 m_resolver = XMLToolingConfig::getConfig().CredentialResolverManager.newPlugin(
48 FILESYSTEM_CREDENTIAL_RESOLVER,doc->getDocumentElement()
54 SAMLObjectBaseTestCase::tearDown();