Skip to content

Commit

Permalink
Bugfix: do not pretify XML before encrypting it
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jul 30, 2024
1 parent 68198d9 commit a2ac09c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/XML/EncryptableElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ public function encrypt(EncryptionAlgorithmInterface $encryptor): EncryptedData
$encryptor->setBackend($this->getEncryptionBackend());
}

$xmlRepresentation = $this->toXML();

return new EncryptedData(
new CipherData(
new CipherValue(
base64_encode($encryptor->encrypt($this->__toString())),
base64_encode($encryptor->encrypt($xmlRepresentation->ownerDocument->saveXML($xmlRepresentation))),
),
),
null,
Expand Down

0 comments on commit a2ac09c

Please sign in to comment.