I am creating enveloping xml digital signature in Java with this output structure:
<Signature>
<SignedInfo>
<CanonicalizationMethod />
<SignatureMethod />
<Reference>
<DigestMethod />
<DigestValue />
</Reference>
</SignedInfo>
<SignatureValue />
<KeyInfo />
<Object />
</Signature>
Signature digest value calculated from: <Object xmlns="http://www.w3.org/2000/09/xmldsig#" Id="object-1">
vs.
Document output after signature.sign call: <Object Id="object-1">
Inside the signature process the xmlns=”http://www.w3.org/2000/09/xmldsig#” part is added even though the node attributes doesn’t contain it, only “Id” is present there. This difference makes the signature invalid.
Is it possible to disable adding the xmlns part during the signature?
If not what is the solution to avoid the difference?