CreaSign

Create an Enveloped Signature

In an enveloped signature, the signed or to-be-signed data is an XML document and contains the <ds:Signature> element as its child element. To create an enveloped signature, follow these steps:

  1. Create a new CreaSignLite object.
  2. Call the CreateSignature method with SignatureFormat set to SignatureFormatEnveloped (2).
' Create CreaSign Lite
Set csLite=CreateObject("CreaSignClientIE.CreaSignLite")  
'With CreaSign Lite use: CreaSignLite.CreaSignLite

' The following certificate will be used for signing
signingCert="CERT_FIND_SUBJECT_STR=CREA_TESTUSER_1"

' Load a sample xml from file
set doc=CreateObject("CreaSignClientIE.Data")
doc.load "files\d1.xml"

Set resultData = csLite.CreateSignature(signingCert, doc, 2,"")

' Save the result to a file
saveTo="files\d1Enveloped.xml"
resultData.save saveTo

WScript.Echo "Result saved to: " & saveTo


Send comments on this topic.

(c) Crea 2002-2006