protected function appendXmlPublicKey(\DOMDocument $keyDoc, $objectId)
	{
		// create the document structure if necessary
		if (is_null($this->doc))
		{
			$this->createXmlStructure();
		}
		
		// local the node to which the key will be appended
		$keyValue = $this->doc->getElementsByTagName($this->nodeNsPrefix . 'KeyValue')->item(0);
		if (is_null($keyValue))
		{
			throw new \UnexpectedValueException('Unabled to locate the KeyValue node');
		}
		
		// we have to add the proper namespace prefixes to all of the nodes in the public key DOM
		$publicKeyNode = $this->doc->createElement($this->nodeNsPrefix . $keyDoc->firstChild->nodeName);
		$keyValue->appendChild($publicKeyNode);
		
		foreach ($keyDoc->firstChild->childNodes as $node)
		{
			$newNode = $this->doc->createElement($this->nodeNsPrefix . $node->nodeName, $node->nodeValue);
			$publicKeyNode->appendChild($newNode);
		}
		
		// add the id attribute, if its provided
		if (is_string($objectId) && strlen($objectId))
		{
			$keyValue->parentNode->setAttribute('Id', $objectId);
		}
		
		return true;
	}
protected function appendXmlPublicKey(\DOMDocument $keyDoc, $objectId)
	{
		// create the document structure if necessary
		if (is_null($this->doc))
		{
			$this->createXmlStructure();
		}
		
		// local the node to which the key will be appended
		$keyValue = $this->doc->getElementsByTagName($this->nodeNsPrefix . 'KeyValue')->item(0);
		if (is_null($keyValue))
		{
			throw new \UnexpectedValueException('Unabled to locate the KeyValue node');
		}
		
		// we have to add the proper namespace prefixes to all of the nodes in the public key DOM
		$publicKeyNode = $this->doc->createElement($this->nodeNsPrefix . $keyDoc->firstChild->nodeName);
		$keyValue->appendChild($publicKeyNode);
		
		foreach ($keyDoc->firstChild->childNodes as $node)
		{
			$newNode = $this->doc->createElement($this->nodeNsPrefix . $node->nodeName, $node->nodeValue);
			$publicKeyNode->appendChild($newNode);
		}
		
		// add the id attribute, if its provided
		if (is_string($objectId) && strlen($objectId))
		{
			$keyValue->parentNode->setAttribute('Id', $objectId);
		}
		
		return true;
	}
protected function appendXmlPublicKey ( \ DOMDocument $ keyDoc , $ objectId ) { // create the document structure if necessary if ( is_null ( $ this -> doc ) ) { $ this -> createXmlStructure ( ) ; } // local the node to which the key will be appended $ keyValue = $ this -> doc -> getElementsByTagName ( $ this -> nodeNsPrefix . 'KeyValue' ) -> item ( 0 ) ; if ( is_null ( $ keyValue ) ) { throw new \ UnexpectedValueException ( 'Unabled to locate the KeyValue node' ) ; } // we have to add the proper namespace prefixes to all of the nodes in the public key DOM $ publicKeyNode = $ this -> doc -> createElement ( $ this -> nodeNsPrefix . $ keyDoc -> firstChild -> nodeName ) ; $ keyValue -> appendChild ( $ publicKeyNode ) ; foreach ( $ keyDoc -> firstChild -> childNodes as $ node ) { $ newNode = $ this -> doc -> createElement ( $ this -> nodeNsPrefix . $ node -> nodeName , $ node -> nodeValue ) ; $ publicKeyNode -> appendChild ( $ newNode ) ; } // add the id attribute, if its provided if ( is_string ( $ objectId ) && strlen ( $ objectId ) ) { $ keyValue -> parentNode -> setAttribute ( 'Id' , $ objectId ) ; } return true ; }
Appends the public XML key to the DOM document.

@param	\DOMDocument				$keyDoc		The DOM document containing the public key information
@param	string						$objectId	ID attribute of the key
@throws	\UnexpectedValueException				If the XML tree is not intact
@return	bool									True if the key was successfully appended, false otherwise
Appends the public XML key to the DOM document .