Discuss this help topic in SecureBlackbox Forum

XML: Set digest method for Signed Properties Reference

The SignedProperties element is XAdES-specific element, which contains a number of properties, that are collectively signed by the XML-DSig signature.

To change digest method for the auto-generated reference, that points to SignedProperties element, just set TElXAdESSigner.SignedPropertiesReferenceDigestMethod property to the needed value.

Another, older solution, is to modify the auto-generated reference itself. It is generated by TElXMLSigner.GenerateSignature() and TElXMLSigner.GenerateSignatureAsync() methods. The reference can be accessed using TElXMLSigner.Signature.SignedInfo.SigPropRef property.

C#:


ElXMLSigner.GenerateSignature();
...
ElXMLSigner.Signature.SignedInfo.SigPropRef.DigestMethod = SBXMLSec.__Global.xdmSHA256;
// also, we can set reference Id attribute in this way, if needed
ElXMLSigner.Signature.SignedInfo.SigPropRef.ID = "your_id";
Delphi:

ElXMLSigner.GenerateSignature();
...
ElXMLSigner.Signature.SignedInfo.SigPropRef.DigestMethod := xdmSHA256;
// also, we can set reference Id attribute in this way, if needed
ElXMLSigner.Signature.SignedInfo.SigPropRef.ID := 'your_id';

How To articles about XML signing (XMLDSig and XAdES)

Discuss this help topic in SecureBlackbox Forum