53 if (!
$xml->hasAttribute(
'Algorithm')) {
54 throw new \Exception(
'Missing required attribute "Algorithm" in alg:SigningMethod element.');
56 $this->Algorithm =
$xml->getAttribute(
'Algorithm');
58 if (
$xml->hasAttribute(
'MinKeySize')) {
59 $this->MinKeySize = intval(
$xml->getAttribute(
'MinKeySize'));
62 if (
$xml->hasAttribute(
'MaxKeySize')) {
63 $this->MaxKeySize = intval(
$xml->getAttribute(
'MaxKeySize'));
76 assert(is_string($this->Algorithm));
77 assert(is_int($this->MinKeySize) || is_null($this->MinKeySize));
78 assert(is_int($this->MaxKeySize) || is_null($this->MaxKeySize));
80 $doc = $parent->ownerDocument;
81 $e = $doc->createElementNS(
Common::NS,
'alg:SigningMethod');
82 $parent->appendChild($e);
83 $e->setAttribute(
'Algorithm', $this->Algorithm);
85 if ($this->MinKeySize !== null) {
86 $e->setAttribute(
'MinKeySize', $this->MinKeySize);
89 if ($this->MaxKeySize !== null) {
90 $e->setAttribute(
'MaxKeySize', $this->MaxKeySize);
__construct(\DOMElement $xml=null)
Create/parse an alg:SigningMethod element.
toXML(\DOMElement $parent)
Convert this element to XML.