Discuss this help topic in SecureBlackbox Forum

XML: Add reference to whole document

To add a reference to a whole document you need to set empty string value to TElXMLReference.URI property, which means that a whole document is referenced, and then set TElXMLReference.URINode property to reference the document element (TElXMLDocument.DocumentElement property).

You also need to add enveloped signature transform or XPath transform or XPath Filter 2.0 transform to exclude the signature.

C#:


TElXMLReference Ref = new TElXMLReference();
Ref.URI = "";
Ref.URINode = XMLDocument.DocumentElement;
Ref.TransformChain.AddEnvelopedSignatureTransform();
Signer.References.Add(Ref); // add the reference to TElXMLSigner object
Delphi:

Ref := TElXMLReference.Create();
Ref.URI := '';
Ref.URINode := XMLDocument.DocumentElement;
Ref.TransformChain.AddEnvelopedSignatureTransform();
Signer.References.Add(Ref); // add the reference to TElXMLSigner object

How To articles about XML signing (XMLDSig and XAdES)

Discuss this help topic in SecureBlackbox Forum