Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter TwoLanguage Overview (continued)

ScriptSign Function

Overview

The ScriptSign function takes a script file or resource file and adds a digital signature using the default code signing certificate for the system.

Syntax/Parameters

Syntax

int = ScriptSign ( string filename, [string permissions] );

Parameters

filename

A string containing a qualified filename. The script must have full read/write access to the file.

permissions‡

An optional string containing security permissions for the file. If omitted, the signed script can perform any function as allowed for the user on the machine executing the script.

Return Value

Returns an int as ERROR_NONE or a formatted error code on failure. The formatted error code has additional bits set for the area of failure. These are as follows:

  SDK Definition   Code/Bits   Description
  SCRIPT_SIGN_ALREADY_SIGNED   0x00100000   Error Opening Certificate Store
  SCRIPT_SIGN_CERTIFICATE_STORE   0x00200000   Error Opening Certificate Store
  SCRIPT_SIGN_CERTIFICATE_TYPE   0x00300000   Error No Appropriate Type
  SCRIPT_SIGN_SIGNING   0x00400000   Error Signing the Message (script)
  SCRIPT_SIGN_WRITING   0x00500000   Error Writing the Script File

 

Remarks

The ScriptSign function scans the certificate store for the computer and selects the first certificate that has the code signing attribute set. The signature is appended to the end of the script as a series of comments. To resign a script, the existing signature must be manually removed.

If a script is required to be signed in order to run, all included files must also be independently signed. To avoid tampering, many OEM applications that require digitally signed scripts will ungracefully fail when encountering a file with a bad certificate.

If the script has already been signed, the function will fail.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic