Hi, in apache log i can find the following error messages:
[php7:warn] PHP Warning: DOMXPath::query(): Node From Wrong Document in ...
PHP Fatal error: Uncaught Error: Call to a member function item() on boolean in XMLSecurityDSig.php:306
My Code is:
require 'xmlseclib/XMLSecurityKey.php';
require 'xmlseclib/XMLSecurityDSig.php';
require 'xmlseclib/XMLSecEnc.php';
require 'xmlseclib/Utils/XPath.php';
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecurityKey;
use RobRichards\XMLSecLibs\XMLSecEnc;
use RobRichards\XMLSecLibs\Utils;
$doc = new DOMDocument();
$doc->loadXML($postcontent);
Hi, in apache log i can find the following error messages: [php7:warn] PHP Warning: DOMXPath::query(): Node From Wrong Document in ... PHP Fatal error: Uncaught Error: Call to a member function item() on boolean in XMLSecurityDSig.php:306
My Code is: require 'xmlseclib/XMLSecurityKey.php'; require 'xmlseclib/XMLSecurityDSig.php'; require 'xmlseclib/XMLSecEnc.php'; require 'xmlseclib/Utils/XPath.php';
use RobRichards\XMLSecLibs\XMLSecurityDSig; use RobRichards\XMLSecLibs\XMLSecurityKey; use RobRichards\XMLSecLibs\XMLSecEnc; use RobRichards\XMLSecLibs\Utils; $doc = new DOMDocument(); $doc->loadXML($postcontent);
$objXMLSecDSig = new XMLSecurityDSig(); $objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N); $objDSig = $objXMLSecDSig->locateSignature($doc); $objXMLSecDSig->canonicalizeSignedInfo(); $objKey = $objXMLSecDSig->locateKey(); $objKeyInfo = XMLSecEnc::staticLocateKeyInfo($objKey, $objDSig);
And so on, it seems to break at the Function "setCanonicalMethod"
The relevant parts of the xml File are: ... <ds:Signature` xmlns:ds="http://www.w3.org/2000/09/xmldsig#">