diff --git a/src/XMLSecurityDSig.php b/src/XMLSecurityDSig.php index 16713ab..5f9aa5b 100644 --- a/src/XMLSecurityDSig.php +++ b/src/XMLSecurityDSig.php @@ -853,6 +853,7 @@ public function sign($objKey, $appendToNode = null) $sMethod = $nodeset->item(0); $sMethod->setAttribute('Algorithm', $objKey->type); $data = $this->canonicalizeData($sInfo, $this->canonicalMethod); + $data = preg_replace("/>\s+<", $data); // remove whitespaces between elements $sigValue = base64_encode($this->signData($objKey, $data)); $sigValueNode = $this->createNewSignNode('SignatureValue', $sigValue); if ($infoSibling = $sInfo->nextSibling) {