You are here

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

Parameters

string $name:

DOMNode $node:

string $type:

Throws

Exception

File

src/XMLSecurityKey.php, line 1866

Class

XMLSecEnc

Namespace

Drupal\miniorange_saml

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