CreaSign

Create a Serial Signature of a CreaDoc Document

With a serial signature you can prove that one signature was created before another one. To create a serial signature, follow these steps:

  1. Load the XML document that already contains a signature.
  2. Create a new CreaDoc object and attach it to the document.
  3. Call the CreateSignatureSerial method and specify which of the existing signatures should be signed.
' The following certificate will be used for signing
signingCert="CERT_FIND_SUBJECT_STR=CREA_TESTUSER_2"

set doc=CreateObject("Msxml2.FreeThreadedDOMDocument.4.0")
doc.preserveWhiteSpace=true ' Important!
if not doc.load("files\signedDataAndVis.xml") then Err.Raise 8, "" , doc.parseError.reason

' Create a CreaDoc object and attach it to the document set cd = CreateObject("CreaSignClientIE.CreaDoc") set cd.XmlNode=doc.documentElement

' Add a serial (counter) signature to the existing one cd.CreateSignatureSerial cd.Signatures(0).id, signingCert, 0 ' Save the result to a file saveTo="files/signedSerial.xml" if WScript.Arguments.Count>0 then saveTo=WScript.Arguments(0) cd.XmlNode.ownerDocument.save saveTo

WScript.Echo "Result saved to: " & saveTo


Send comments on this topic.

(c) Crea 2002-2006