CreaSign

Create a PKCS7 Signature

To create a signature in the PKCS#7 format, follow these steps:

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

' Save the result to a file
saveTo="files\d1PKCS7.p7b"
resultData.save saveTo

WScript.Echo "Result saved to: " & saveTo


Send comments on this topic.

(c) Crea 2002-2006