File: XMLSecurityDSig.php

package info (click to toggle)
simplesamlphp 1.13.1-2%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 11,304 kB
  • sloc: php: 65,124; xml: 629; python: 376; sh: 193; perl: 185; makefile: 43
file content (31 lines) | stat: -rw-r--r-- 866 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

/**
 * This class should be considered a temporary workaround to
 * solve the lack of custom formatting in XMLSecurityDSig
 * (xmlseclibs). It should be possible to either configure
 * the original class to avoid formatting, or to use a custom
 * template for the signature.
 *
 * @todo Move this functionality to xmlseclibs.
 *
 * @author Daniel Tsosie
 * @package simpleSAMLphp
 */
class sspmod_adfs_XMLSecurityDSig extends XMLSecurityDSig {

    function __construct($metaxml) {
        $sigdoc = new DOMDocument();
        $template = '';

        if (strpos("\n", $metaxml) === FALSE) {
            foreach (explode("\n", self::template) as $line)
                $template .= trim($line);
        } else {
            $template = self::template;
        }

        $sigdoc->loadXML($template);
        $this->sigNode = $sigdoc->documentElement;
    }
}