CreaSign

Create a Detached Signature

A detached signature is neither the enveloped nor the enveloping one. The data can be in a sibling document in the XML tree or it can be stored in an external file or other resource. To create a detached signature, follow these steps:

  1. Create a new CreaSignLite object.
  2. Call the CreateSignature method with SignatureFormat set to SignatureFormatDetached (3).
' 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, 3, "/Data/Name")

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

WScript.Echo "Result saved to: " & saveTo


Send comments on this topic.

(c) Crea 2002-2006