You are here

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

Parameters

DOMDocument $element:

Return value

DOMNode|null

File

includes/XMLSecurityKey.php, line 2160

Class

XMLSecEnc

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