Freigeben über


Scripting.Signer Object 

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.

Remarks

The Scripting.Signer object requires a valid certificate.

Example

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>

Methods

Sign Method | SignFile Method | Verify Method | VerifyFile Method

See Also

Concepts

Signing a Script