Discuss this help topic in SecureBlackbox Forum
XML: Add reference to element in signature
To add the reference, which that points to the element inside the signature, you would need to:
C#:
Signer.UpdateReferencesDigest();
...
// add the reference after UpdateReferencesDigest call, otherwise exception will be thrown
TElXMLReference Ref2 = new TElXMLReference();
Ref2.URI = "#KeyInfo1";
Signer.References.Add(Ref2);
...
Signer.GenerateSignature(); // or GenerateSignatureAsync() method, this method generates Signature structure that could be modified using Signer.Signature property
...
Signer.Signature.KeyInfo.ID = "KeyInfo1"; // set an Id for KeyInfo element
Delphi:
Signer.UpdateReferencesDigest();
...
// add the reference after UpdateReferencesDigest call, otherwise exception will be thrown
Ref2 := TElXMLReference.Create();
Ref2.URI := '#KeyInfo1';
Signer.References.Add(Ref2);
...
Signer.GenerateSignature(); // or GenerateSignatureAsync() method, this method generates Signature structure that could be modified using Signer.Signature property
...
Signer.Signature.KeyInfo.ID := 'KeyInfo1'; // set an Id for KeyInfo element