Discuss this help topic in SecureBlackbox Forum

XML: Add reference to data

To add a reference to the data itself, you need to put a string value, which uniquely identifies the referenced data, to TElXMLReference.URI property (usually it has custom format, but URL identifier is also possible), and then put the data itself to TElXMLReference.URIData property, which will be used for reference computation.

C#:


byte[] ByteArrayWithData = ...;

TElXMLReference Ref = new TElXMLReference();
Ref.URI = "data_name";
Ref.URIData = ByteArrayWithData;
Signer.References.Add(Ref); // add the reference to TElXMLSigner object
Delphi:

var ByteArrayWithData : ByteArray;
...
Ref := TElXMLReference.Create();
Ref.URI := 'data_name';
Ref.URIData := ByteArrayWithData;
Signer.References.Add(Ref); // add the reference to TElXMLSigner object

Note: If the element being signed encloses the signature itself, then you should use Enveloped Signature, XPath, or XPath Filter 2.0 transform to exclude the signature value from reference computation.

How To articles about XML signing (XMLDSig and XAdES)

Discuss this help topic in SecureBlackbox Forum