77use DOMElement ;
88use SimpleSAML \XML \Assert \Assert ;
99use SimpleSAML \XML \Exception \SchemaViolationException ;
10+ use SimpleSAML \XML \Type \IDValue ;
11+
12+ use function strval ;
1013
1114/**
1215 * Abstract class representing a dsig11:ECKeyValueType
@@ -19,17 +22,16 @@ abstract class AbstractECKeyValueType extends AbstractDsig11Element
1922 * Initialize a FieldIDType element.
2023 *
2124 * @param \SimpleSAML\XMLSecurity\XML\dsig11\PublicKey $publicKey
22- * @param string |null $id
25+ * @param \SimpleSAML\XML\Type\IDValue |null $id
2326 * @param \SimpleSAML\XMLSecurity\XML\dsig11\ECParameters|null $ecParameters
2427 * @param \SimpleSAML\XMLSecurity\XML\dsig11\NamedCurve|null $namedCurve
2528 */
2629 public function __construct (
2730 protected PublicKey $ publicKey ,
28- protected ?string $ id = null ,
31+ protected ?IDValue $ id = null ,
2932 protected ?ECParameters $ ecParameters = null ,
3033 protected ?NamedCurve $ namedCurve = null ,
3134 ) {
32- Assert::validNCName ($ id , SchemaViolationException::class);
3335 Assert::oneOf (
3436 null ,
3537 [$ ecParameters , $ namedCurve ],
@@ -75,9 +77,9 @@ public function getPublicKey(): PublicKey
7577 /**
7678 * Collect the value of the id-property
7779 *
78- * @return string |null
80+ * @return \SimpleSAML\XML\Type\IDValue |null
7981 */
80- public function getId (): ?string
82+ public function getId (): ?IDValue
8183 {
8284 return $ this ->id ;
8385 }
@@ -94,7 +96,7 @@ public function toXML(?DOMElement $parent = null): DOMElement
9496 $ e = $ this ->instantiateParentElement ($ parent );
9597
9698 if ($ this ->getId () !== null ) {
97- $ e ->setAttribute ('Id ' , $ this ->getId ());
99+ $ e ->setAttribute ('Id ' , strval ( $ this ->getId () ));
98100 }
99101
100102 $ this ->getECParameters ()?->toXML($ e );
0 commit comments