diff --git a/src/XML/SignedElementTrait.php b/src/XML/SignedElementTrait.php index d9fc68dc..7572399e 100644 --- a/src/XML/SignedElementTrait.php +++ b/src/XML/SignedElementTrait.php @@ -74,6 +74,11 @@ public function getSignature(): ?Signature */ protected function setSignature(Signature $signature): void { + /** + * By disabling formatting on signed objects, we prevent issues with invalid signatures later on + * at the cost of some whitespace taking up useless bytes in the outputted document. + */ + $this->formatOutput = false; $this->signature = $signature; }