You are here

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

Parameters

DOMDocument $element:

Return value

DOMNode|null

File

src/XMLSecurityKey.php, line 2128

Class

XMLSecEnc

Namespace

Drupal\miniorange_saml

Code

public function locateEncryptedData($element) {
  if ($element instanceof DOMDocument) {
    $doc = $element;
  }
  else {
    $doc = $element->ownerDocument;
  }
  if ($doc) {
    $xpath = new DOMXPath($doc);
    $query = "//*[local-name()='EncryptedData' and namespace-uri()='" . self::XMLENCNS . "']";
    $nodeset = $xpath
      ->query($query);
    return $nodeset
      ->item(0);
  }
  return null;
}