public function processSignature($refNode) { $objXMLSecDSig = new XMLSecurityDSig(); $objXMLSecDSig->idKeys[] = 'wswsu:Id'; $objXMLSecDSig->idNS['wswsu'] = self::WSUNS; $objXMLSecDSig->sigNode = $refNode; $objXMLSecDSig->canonicalizeSignedInfo(); $canonBody = $objXMLSecDSig->canonicalizeBody(); $retVal = $objXMLSecDSig->validateReference(); if (!$retVal) { throw new Exception("Validation Failed"); } $key = NULL; $objKey = $objXMLSecDSig->locateKey(); do { if (empty($objKey->key)) { $handler = fopen($this->certServerPath, "r"); $x509cert = fread($handler, 8192); fclose($handler); $objKey->loadKey($x509cert, FALSE, TRUE); break; throw new Exception("Error loading key to handle Signature"); } } while (0); if ($objXMLSecDSig->verify($objKey) && $objXMLSecDSig->compareDigest($canonBody)) { return TRUE; } else { return FALSE; } }