The Scripting.Signer object enables an author to sign a script with a digital signature and a recipient to verify the signature's authenticity and trustworthiness.
The Scripting.Signer object requires a valid certificate.
The following JScript code shows the Scripting.Signer object digitally signing a script.
<job> <runtime> <named name="file" helpstring="the file to sign" required="true" type="string"/> <named name="cert" helpstring="the name of the signing certificate" required="true" type="string"/> <named name="store" helpstring="the name of the certificate store" required="false" type="string"/> </runtime> <script language="JScript"> var Signer, File, Cert, Store = "my"; if (!(WScript.Arguments.Named.Exists("cert") && WScript.Arguments.Named.Exists("file"))) { WScript.Arguments.ShowUsage(); WScript.Quit(); } Signer = new ActiveXObject("Scripting.Signer"); File = WScript.Arguments.Named("file"); Cert = WScript.Arguments.Named("cert"); if (WScript.Arguments.Named.Exists("store")) { Store = WScript.Arguments.Named("store"); } Signer.SignFile(File, Cert, Store); </script> </job>
Signing a Script | Sign Method | SignFile Method | Verify Method | VerifyFile Method