ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
DigestMethod.php
Go to the documentation of this file.
1 <?php
2 
3 namespace SAML2\XML\alg;
4 
13 {
19  public $Algorithm;
20 
21 
29  public function __construct(\DOMElement $xml = null)
30  {
31  if ($xml === null) {
32  return;
33  }
34 
35  if (!$xml->hasAttribute('Algorithm')) {
36  throw new \Exception('Missing required attribute "Algorithm" in alg:DigestMethod element.');
37  }
38  $this->Algorithm = $xml->getAttribute('Algorithm');
39  }
40 
41 
48  public function toXML(\DOMElement $parent)
49  {
50  assert(is_string($this->Algorithm));
51 
52  $doc = $parent->ownerDocument;
53  $e = $doc->createElementNS(Common::NS, 'alg:DigestMethod');
54  $parent->appendChild($e);
55  $e->setAttribute('Algorithm', $this->Algorithm);
56 
57  return $e;
58  }
59 }
toXML(\DOMElement $parent)
Convert this element to XML.
__construct(\DOMElement $xml=null)
Create/parse an alg:DigestMethod element.