54 if (
$xml->hasAttribute(
'use')) {
55 $this->use =
$xml->getAttribute(
'use');
59 if (count($keyInfo) > 1) {
60 throw new \Exception(
'More than one ds:KeyInfo in the KeyDescriptor.');
61 } elseif (empty($keyInfo)) {
62 throw new \Exception(
'No ds:KeyInfo in the KeyDescriptor.');
67 $this->EncryptionMethod[] =
new Chunk($em);
79 assert(is_null($this->use) || is_string($this->use));
81 assert(is_array($this->EncryptionMethod));
83 $doc = $parent->ownerDocument;
86 $parent->appendChild($e);
88 if (isset($this->use)) {
89 $e->setAttribute(
'use', $this->use);
92 $this->KeyInfo->toXML($e);
94 foreach ($this->EncryptionMethod as $em) {
const NS_MD
The namespace for the SAML 2 metadata.
static xpQuery(\DOMNode $node, $query)
Do an XPath query on an XML node.
__construct(\DOMElement $xml=null)
Initialize an KeyDescriptor.
toXML(\DOMElement $parent)
Convert this KeyDescriptor to XML.