How to calculate a signature to a XML XAdES including SignedProperties?

357 Views Asked by At

I try to calculate a XaDeS XML signature for the SignedInfo element but nothing gives the good signature. I tried to sign the digest with and without <SignedInfo> tag, I replaced <tag/> by <tag></tag>, I signed DigestValue1 + DigestValue2 etc. but nothing gives the good signature.

The SignedInfo contains two digests, one for the document and another digest for SignedProperties.

Has anybody an idea what is the good input string for the signature ?

1

There are 1 best solutions below

0
On

The input for the signature generation is specified in XMLDSig (XAdES builds on XMLDSig): https://www.w3.org/TR/xmldsig-core1/#sec-CoreGeneration

It is the SignedInfo element canonicalized using the canonicalization algorithm contained in the CanonicalizationMethod child element of SignedInfo.

Then you need to apply the signature algorithm (hash+encryption) contained in the SignatureMethod child element of SignedInfo.