You are here

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

Parameters

DOMElement|string $data:

null|string $mimetype:

null|string $encoding:

Return value

DOMElement

File

src/XMLSecurityKey.php, line 1403

Class

XMLSecurityDSig

Namespace

Drupal\miniorange_saml

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;
}