You are here

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

Parameters

string $name:

DOMNode $node:

string $type:

Throws

Exception

File

includes/XMLSecurityKey.php, line 1898

Class

XMLSecEnc

Code

public function addReference($name, $node, $type) {
  if (!$node instanceof DOMNode) {
    throw new Exception('$node is not of type DOMNode');
  }
  $curencdoc = $this->encdoc;
  $this
    ->_resetTemplate();
  $encdoc = $this->encdoc;
  $this->encdoc = $curencdoc;
  $refuri = XMLSecurityDSig::generateGUID();
  $element = $encdoc->documentElement;
  $element
    ->setAttribute("Id", $refuri);
  $this->references[$name] = array(
    "node" => $node,
    "type" => $type,
    "encnode" => $encdoc,
    "refuri" => $refuri,
  );
}