How to create digitally signed Xml message using standard ISO20022 in java?

Viewed 222

How to create digitally signed Xml message using standard ISO20022 in java? xml message like this:

<MessagePayload>
    <AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.01">
        <CharSet>UTF-8</CharSet>
        <Sgntr></Sgntr>
    </AppHdr>
    <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.06">
        <FIToFICstmrCdtTrf>
            ...
        </FIToFICstmrCdtTrf>
    </Document>
</MessagePayload>

reference like this:

<Reference URI="#keyInfoId">
    <Transforms>
        <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    </Transforms>
    <DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
</Reference>
<Reference URI="">
    <Transforms>
        <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
        <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    </Transforms>
    <DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
</Reference>
<Reference>
    <Transforms>
        <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    </Transforms>
    <DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
</Reference>

i try the code , but the result is not correct. please help me!! otherwise, i do not know how to create the reference with no uri , it is not means but means .

0 Answers
Related