This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
spip-saml/inc/simplesamlphp/lib/SAML2/XML/ds/KeyName.php

46 lines
773 B
PHP

<?php
/**
* Class representing a ds:KeyName element.
*
* @package simpleSAMLphp
* @version $Id$
*/
class SAML2_XML_ds_KeyName {
/**
* The key name.
*
* @var string
*/
public $name;
/**
* Initialize a KeyName element.
*
* @param DOMElement|NULL $xml The XML element we should load.
*/
public function __construct(DOMElement $xml = NULL) {
if ($xml === NULL) {
return;
}
$this->name = $xml->textContent;
}
/**
* Convert this KeyName element to XML.
*
* @param DOMElement $parent The element we should append this KeyName element to.
*/
public function toXML(DOMElement $parent) {
assert('is_string($this->name)');
return SAML2_Utils::addString($parent, XMLSecurityDSig::XMLDSIGNS, 'ds:KeyName', $this->name);
}
}