CreaSign

Encrypt a XML File using XML-ENC standard

To encrypt a XML file using XML-ENC standard (http://www.w3.org/TR/xmlenc-core), follow these steps:

  1. Create a new CreaSign object.
  2. Load the XML document.
  3. Call the Encrypt method.
' Create CreaSignClientIE
Set cs=CreateObject("CreaSignClientIE.CreaSign") 

' The following certificate will be used for encryption
encryptCert="CERT_FIND_SUBJECT_STR=CREA_TESTUSER_1"

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

Set resultData = cs.Encrypt(encryptCert, doc, "XML_3DES-RSA")

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

WScript.Echo "Encrypted file saved to: " & saveTo


Send comments on this topic.

(c) Crea 2002-2006