I am Trying to genereate my XML signature. When Running the below examlple https://docs.oracle.com/en/java/javase/17/security/java-xml-digital-signature-api-overview-and-tutorial.html#GUID-1152D2A5-ECBB-4727-9B0F-1941E4171108
And getting teh below response. Inside signature is getting which is expected and not shown in the example. Need assistance to resolve that.
<?xml version="1.0" encoding="UTF-8" standalone="no"?><BusinessMessage>
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.01"/>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.003.001.07" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:camt.003.001.07 camt.003.001.07.xsd">
<GetAcct>
<MsgHdr>
<MsgId>MTN000004</MsgId>
<CreDtTm>2021-04-22T15:41:29+02:00</CreDtTm>
</MsgHdr>
<AcctQryDef>
<AcctCrit>
<NewCrit>
<SchCrit>
<AcctId>
<EQ>
<Othr>
<Id>250788123456</Id>
</Othr>
</EQ>
</AcctId>
<AcctOwnr>
<CtctDtls>
<MobNb>250788123456</MobNb>
</CtctDtls>
</AcctOwnr>
</SchCrit>
</NewCrit>
</AcctCrit>
</AcctQryDef>
</GetAcct>
</Document>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/><SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><DigestValue>i41j0dS1uwC8ggex3M3YYND05g3OipfKT+kiByLo2gY=</DigestValue></Reference></SignedInfo><SignatureValue>KBBupI04c6OyfqrJVzNtEnyYHsm8i9ZLa7gPFIuvj+gruFls0GWHikzowFTJNqPfPkML7n/sv4dF
1QyAE9RRrvdNMEVoR5WYIsg0J61QgNtx/5Lis30qVEPVo66GOpXoysu6cZ9MnnpiclXzzuk/ZIsH
2tZSvlPqN/rC/W4xOet8UO4dCvoj/tcwr6ukJOh3ArDS2q/AMdzgiyNExaDXx3vGl/wecVgAe/3U
oyG5MWTGOMMFAlk2aGq+Vm/9faePs0st7LvSXT9ySWtz3XHCl1DYmT20bBTw97tJxJeP6+g5q+iE
1FlJxc5rtsyDOxEpA3cfXXsgLNW/3I1Gpp+2dg==</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>okTuIE0BJYsd2aX9mw+CyGZt/JwxoaE2RGonnz32biHT8C3rTPNOFz6JPaPxHnZVOvKGxZNAWveM
u6o+BI5NHTAon+7hOHeYp2WoBp+nDwMTjGWkb6K8NUwYw+pBNJnqqyLzUTVvuZDg2VRsflbLhITF
wAKTTnfARBskdKpmY1s6/Unm12cFBiBVHVxPvnR6mwMSZfkU9LY/1Kx11XKyXxPqzzezDwiX6aqr
Wag2ouOFyLaXBvdUxPQkTSOvOJWmdH/E5tItf7+NbTUehaHLYkfCR5YLcAstD6zUfM5YuEKK3DLo
LdhiID9EDBCs6nkpp4GgOkquvgD+l8dGKe3eFQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue></KeyInfo></Signature></BusinessMessage>
Expected output-
<?xml version="1.0" encoding="UTF-8" standalone="no"?><BusinessMessage>
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.01"/>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.003.001.07" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:camt.003.001.07 camt.003.001.07.xsd">
<GetAcct>
<MsgHdr>
<MsgId>MTN000004</MsgId>
<CreDtTm>2021-04-22T15:41:29+02:00</CreDtTm>
</MsgHdr>
<AcctQryDef>
<AcctCrit>
<NewCrit>
<SchCrit>
<AcctId>
<EQ>
<Othr>
<Id>250788123456</Id>
</Othr>
</EQ>
</AcctId>
<AcctOwnr>
<CtctDtls>
<MobNb>250788123456</MobNb>
</CtctDtls>
</AcctOwnr>
</SchCrit>
</NewCrit>
</AcctCrit>
</AcctQryDef>
</GetAcct>
</Document>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/><SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><DigestValue>i41j0dS1uwC8ggex3M3YYND05g3OipfKT+kiByLo2gY=</DigestValue></Reference></SignedInfo><SignatureValue>KBBupI04c6OyfqrJVzNtEnyYHsm8i9ZLa7gPFIuvj+gruFls0GWHikzowFTJNqPfPkML7n/sv4dF
1QyAE9RRrvdNMEVoR5WYIsg0J61QgNtx/5Lis30qVEPVo66GOpXoysu6cZ9MnnpiclXzzuk/ZIsH
2tZSvlPqN/rC/W4xOet8UO4dCvoj/tcwr6ukJOh3ArDS2q/AMdzgiyNExaDXx3vGl/wecVgAe/3U
oyG5MWTGOMMFAlk2aGq+Vm/9faePs0st7LvSXT9ySWtz3XHCl1DYmT20bBTw97tJxJeP6+g5q+iE
1FlJxc5rtsyDOxEpA3cfXXsgLNW/3I1Gpp+2dg==</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>okTuIE0BJYsd2aX9mw+CyGZt/JwxoaE2RGonnz32biHT8C3rTPNOFz6JPaPxHnZVOvKGxZNAWveM
u6o+BI5NHTAon+7hOHeYp2WoBp+nDwMTjGWkb6K8NUwYw+pBNJnqqyLzUTVvuZDg2VRsflbLhITF
wAKTTnfARBskdKpmY1s6/Unm12cFBiBVHVxPvnR6mwMSZfkU9LY/1Kx11XKyXxPqzzezDwiX6aqr
Wag2ouOFyLaXBvdUxPQkTSOvOJWmdH/E5tItf7+NbTUehaHLYkfCR5YLcAstD6zUfM5YuEKK3DLo
LdhiID9EDBCs6nkpp4GgOkquvgD+l8dGKe3eFQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue></KeyInfo></Signature></BusinessMessage>
Tried to run the below in Java 11 -