Discuss this help topic in SecureBlackbox Forum

XML: Add manifest to signature

To add Manifest into the signature we need to create a custom TElXMLObject first, then create TElXMLManifest object and add it to the TElXMLObject.DataList property of the object. Then we can add custom references to the manifest.

The code sample below adds an object with a signed Manifest via a reference:

C#:


Signer.UpdateReferencesDigest();
...
// create the reference to the Manifest
Ref = new TElXMLReference();
Ref.DigestMethod = SBXMLSec.Unit.xdmSHA1;
Ref.URI = "#ManifestId";
Signer.References.Add(Ref);
...
Signer.GenerateSignature();
...
// add new object
Obj = new TElXMLObject();
Signer.Signature.Objects.Add(Obj);

// create manifest and add it to the object
Manifest = new TElXMLManifest();
Manifest.ID = "ManifestId";
Obj.DataList.Add(Manifest);

// add reference to the Manifest
Ref = new TElXMLReference();
Ref.URI = "ObjId1";
Ref.URINode = ObjNode;
// calculate digest value based on URINode/URIData/URIStream property
// or set DigestValue directly
Ref.UpdateDigestValue(); 
Manifest.Add(Ref);

How To articles about XML signing (XMLDSig and XAdES)

Discuss this help topic in SecureBlackbox Forum