Key Object Members of keyControl in SuiteScript
The keyControl module in SuiteScript provides essential member properties and methods for managing keys within NetSuite scripts.
The keyControl module in SuiteScript provides developers with mechanisms to create and manage keys programmatically. This article outlines the key object members available and their specific descriptions, return types, and supported script types.
What Are Key Object Members?
Key object members are properties and methods associated with the keyControl.Key object in SuiteScript. These members allow you to interact with keys used within NetSuite servers.
Key Object Members Overview
The following table summarizes the key object members, their types, and descriptions:
| Member Name | Type | Description | Supported Script Types |
|---|---|---|---|
Key.file | file.File | Represents the file object of the key. | Server scripts |
Key.password | string | Contains the password for the key (write-only). | Server scripts |
Key.scriptId | string | Script ID of the key, prefixed with custkey. | Server scripts |
Key.name | string | Name of the key. | Server scripts |
Key.description | string | Description associated with the key. | Server scripts |
Key.restrictions | string | Internal IDs of the employees restricted to this key. | Server scripts |
Methods
The method available for this object is:
Key.save(): This method is used to save the key. Its return type is an object.
Example Usage
To create and modify a key using the keyControl module, you might use the following code snippet:
1// Add additional code2...3var key = keyControl.createKey();4key.file = file.load(422); // ID of the file containing the private key (id_ecdsa or id_rsa)5...6// Add additional codeConclusion
The keyControl module plays a crucial role in securely managing keys within SuiteScripts. By familiarizing yourself with the key object members, you can effectively utilize keys to enhance your integration scripts.
Key Takeaways
- The
keyControl.Keyobject allows for management of keys in SuiteScript. - Key members include file, password, script ID, and restrictions.
- The
Key.save()method is crucial for saving changes to the key.
Frequently Asked Questions (4)
What script types are supported by the keyControl module in SuiteScript?
Can the password for a key in the keyControl module be read programmatically?
What information does the Key.restrictions property provide?
How do you save changes to a key using the keyControl module?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
