You are here

public function XMLSecurityDSig::addObject in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 7

Parameters

DOMElement|string $data:

null|string $mimetype:

null|string $encoding:

Return value

DOMElement

File

includes/XMLSecurityKey.php, line 1435

Class

XMLSecurityDSig

Code

public function addObject($data, $mimetype = null, $encoding = null) {
  $objNode = $this
    ->createNewSignNode('Object');
  $this->sigNode
    ->appendChild($objNode);
  if (!empty($mimetype)) {
    $objNode
      ->setAttribute('MimeType', $mimetype);
  }
  if (!empty($encoding)) {
    $objNode
      ->setAttribute('Encoding', $encoding);
  }
  if ($data instanceof DOMElement) {
    $newData = $this->sigNode->ownerDocument
      ->importNode($data, true);
  }
  else {
    $newData = $this->sigNode->ownerDocument
      ->createTextNode($data);
  }
  $objNode
    ->appendChild($newData);
  return $objNode;
}