|
7 | 7 | use DOMElement; |
8 | 8 | use SimpleSAML\Assert\Assert; |
9 | 9 | use SimpleSAML\XML\Chunk; |
10 | | -use SimpleSAML\XML\Constants as C; |
11 | 10 | use SimpleSAML\XML\Exception\InvalidDOMElementException; |
| 11 | +use SimpleSAML\XMLSecurity\Constants as C; |
12 | 12 | use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException; |
13 | 13 | use SimpleSAML\XMLSecurity\XML\dsig11\X509Digest; |
14 | 14 |
|
@@ -74,18 +74,22 @@ public static function fromXML(DOMElement $xml): static |
74 | 74 | for ($n = $xml->firstChild; $n !== null; $n = $n->nextSibling) { |
75 | 75 | if (!($n instanceof DOMElement)) { |
76 | 76 | continue; |
77 | | - } elseif ($n->namespaceURI !== self::NS) { |
| 77 | + } elseif ($n->namespaceURI === self::NS) { |
| 78 | + $data[] = match ($n->localName) { |
| 79 | + 'X509Certificate' => X509Certificate::fromXML($n), |
| 80 | + 'X509IssuerSerial' => X509IssuerSerial::fromXML($n), |
| 81 | + 'X509SubjectName' => X509SubjectName::fromXML($n), |
| 82 | + default => new Chunk($n), |
| 83 | + }; |
| 84 | + } elseif ($n->namespaceURI === C::NS_XDSIG11) { |
| 85 | + $data[] = match ($n->localName) { |
| 86 | + 'X509Digest' => X509Digest::fromXML($n), |
| 87 | + default => new Chunk($n), |
| 88 | + }; |
| 89 | + } else { |
78 | 90 | $data[] = new Chunk($n); |
79 | 91 | continue; |
80 | 92 | } |
81 | | - |
82 | | - $data[] = match ($n->localName) { |
83 | | - 'X509Certificate' => X509Certificate::fromXML($n), |
84 | | - 'X509IssuerSerial' => X509IssuerSerial::fromXML($n), |
85 | | - 'X509SubjectName' => X509SubjectName::fromXML($n), |
86 | | - 'X509Digest' => X509Digest::fromXML($n), |
87 | | - default => new Chunk($n), |
88 | | - }; |
89 | 93 | } |
90 | 94 |
|
91 | 95 | return new static($data); |
|
0 commit comments