Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter SixteenApplication (continued)

PutEncryptedSetting Function

Overview

The PutEncryptedSetting function writes or replaces a single line item as an encrypted string to a Windows-style INI file.

Syntax/Parameters

Syntax

int = PutEncryptedSetting ( [string fnTarget], string section, string entry,
                         string data | long data, string key );

Parameters

fnTarget

An optional string defining the target file containing the settings. If the parameter is omitted (i.e., there are only two string parameters provided to the function), the target name will be the name of the script plus an ini script. For example, if the script name is “Production Interface.ls”, the target will default to “Production Interface.ini”. If the string is supplied but is empty, the default application workstation settings file is used for the target. If a filename is provided without a path, the file is referenced from the application data folder (%appdata%).

section

A string specifying the section (also known as the application name) in which the entries are grouped. This name is contained within brackets inside the target file. Every entry must belong to a section.

entry

A string specifying the entry name (also known as the key name) identifying the data. The entry identifies the line item within the section. For example, the line entry within a section, ‘My Key=Some Data”, the ‘My Data’ field is the entry or key name and ‘Some Data’ is the data associated with the key.

data

A string or an integer (up to 64 bits) to write as the entry. The value cannot be larger that 64KB after encryption and encoding. If the data exceeds this size, an ERROR_OVERFLOW will be returned.

key

A string or char array to use as the encryption key. If used as a string, the key size is determined by the first zero terminating byte. For a character array, the size of the character array is used as the key size. A key that is not exactly 128, 192, 256 bits (16, 24 and 32 bytes respectively) will be zero padding to the appropriate number of bits. A key exceeding 256 bits will be truncated. The parameter must be specified setting it to an empty string will use the Legato default key. [See Legato Keys and Code Signing]

Return Value

An int value containing a formatted error code. ERROR_NONE for no error or an error code.

Remarks

If the target is located in the user’s roaming data area, it will be private to that user and possibly available on other workstations the user logged into (provided roaming profiles are enabled).

The process must have privileges to write to the specified target location.

Related Function

Platform Support

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

Legato IDE, Legato Basic