CreaSign

Add a Timestamp to a Signature

A timestamp provides protection against repudiation. It is obtained by sending the digest value of the given data to the Time-Stamp Authority (TSA). The
returned time-stamp is signed data that contains the digest value, the identity of the TSA, and the time of stamping. This proves that the given data existed before the time of stamping.

To add a timestamp to a signature, follow these steps:

  1. Load the XML document.
  2. Create a new XmlSignature object and attach it to the signature node that needs to be timestamped.
  3. Call the CreateSignatureTimeStamp method.

CreaSign supports several different timestamp authorities. See the CreateSignatureTimeStamp method for details. The following example uses an internal provider, which creates a timestamp with the specified certificate.

' The following certificate will be used for timestamping
signingCert="CERT_FIND_SUBJECT_STR=CREA_TESTTIMESTAMPSERVER_1"

set doc=CreateObject("Msxml2.FreeThreadedDOMDocument.4.0")
doc.preserveWhiteSpace=true ' Important!
doc.load "files/SignedEnveloping.xml"

' Create an xml signature object and attach it to the xml document
Set cs = CreateObject("CreaSignClientIE.XmlSignature")
cs.XmlNode = doc.documentElement

' Add the timestamp. Use the built-in test provider cs.CreateSignatureTimeStamp "timestamp_test", signingCert, "" ' Save the result to a file saveTo="files/signedTimestamp.xml" if WScript.Arguments.Count>0 then saveTo=WScript.Arguments(0) doc.save saveTo

WScript.Echo "Result saved to: " & saveTo


Send comments on this topic.

(c) CREA 2002-2007 www.creasign.si