77use DOMElement ;
88use SimpleSAML \WSSecurity \Assert \Assert ;
99use SimpleSAML \WSSecurity \Constants as C ;
10- use SimpleSAML \XML \Exception \InvalidDOMElementException ;
11- use SimpleSAML \XML \XsNamespace as NS ;
10+ use SimpleSAML \XMLSchema \Exception \InvalidDOMElementException ;
1211use SimpleSAML \XMLSchema \Type \AnyURIValue ;
13- use SimpleSAML \XMLSchema \Type \IDValue ;
12+ use SimpleSAML \WSSecurity \XML \wsu \Type \IDValue ;
13+ use SimpleSAML \XMLSchema \Type \Base64BinaryValue ;
1414use SimpleSAML \XMLSchema \Type \StringValue ;
15+ use SimpleSAML \XMLSchema \XML \Constants \NS ;
1516
1617/**
1718 * Class defining the BinarySecurityTokenType element
@@ -28,20 +29,20 @@ abstract class AbstractBinarySecurityTokenType extends AbstractEncodedString
2829 * AbstractBinarySecurityTokenType constructor
2930 *
3031 * @param \SimpleSAML\XMLSchema\Type\StringValue $content
32+ * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id
33+ * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes
3134 * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $valueType
32- * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id
3335 * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $EncodingType
34- * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes
3536 */
3637 final public function __construct (
3738 StringValue $ content ,
38- protected ?AnyURIValue $ valueType = null ,
3939 ?IDValue $ Id = null ,
40- ?string $ EncodingType = null ,
4140 array $ namespacedAttributes = [],
41+ protected ?AnyURIValue $ valueType = null ,
42+ ?AnyURIValue $ EncodingType = null ,
4243 ) {
4344 Assert::validBase64Binary ($ content ->getValue ());
44- parent ::__construct ($ content , $ Id , $ EncodingType , $ namespacedAttributes );
45+ parent ::__construct ($ content , $ Id , $ namespacedAttributes , $ EncodingType );
4546 }
4647
4748
@@ -60,7 +61,7 @@ public function getValueType(): ?AnyURIValue
6061 * @param \DOMElement $xml
6162 * @return static
6263 *
63- * @throws \SimpleSAML\XML \Exception\InvalidDOMElementException
64+ * @throws \SimpleSAML\XMLSchema \Exception\InvalidDOMElementException
6465 * if the qualified name of the supplied element is wrong
6566 */
6667 public static function fromXML (DOMElement $ xml ): static
@@ -73,18 +74,18 @@ public static function fromXML(DOMElement $xml): static
7374 $ Id = null ;
7475 foreach ($ nsAttributes as $ i => $ attr ) {
7576 if ($ attr ->getNamespaceURI () === C::NS_SEC_UTIL && $ attr ->getAttrName () === 'Id ' ) {
76- $ Id = $ attr ->getAttrValue ();
77+ $ Id = IDValue:: fromString ( $ attr ->getAttrValue ()-> getValue () );
7778 unset($ nsAttributes [$ i ]);
7879 break ;
7980 }
8081 }
8182
8283 return new static (
8384 StringValue::fromString ($ xml ->textContent ),
84- self ::getOptionalAttribute ($ xml , 'ValueType ' , AnyURIValue::class, null ),
8585 $ Id ,
86- self ::getOptionalAttribute ($ xml , 'EncodingType ' , AnyURIValue::class, null ),
8786 $ nsAttributes ,
87+ self ::getOptionalAttribute ($ xml , 'ValueType ' , AnyURIValue::class, null ),
88+ self ::getOptionalAttribute ($ xml , 'EncodingType ' , AnyURIValue::class, null ),
8889 );
8990 }
9091
0 commit comments