In an enveloping signature, the <ds:Signature> element contains signed or to-be-signed data as a child of the <ds:Object> element. To create an enveloping signature, follow these steps:
' The following certificate will be used for signing
signingCert="CERT_FIND_SUBJECT_STR=CREA_TESTUSER_1"
' Create an xml signature object
Set cs = CreateObject("CreaSignClientIE.XmlSignature")
' Add an object with some data
cs.AddObject "myObject","This text will be signed"
' Add reference to the object
cs.AddReference "","#myObject", ""
' Create a signature
cs.CreateSignature signingCert,0
' Save the result to a file
saveTo="files/signedEnveloping.xml"
if WScript.Arguments.Count>0 then saveTo=WScript.Arguments(0)
cs.XmlNode.ownerDocument.save saveTo
WScript.Echo "Result saved to: " & saveTo
(c) CREA 2002-2007 www.creasign.si