Key Object Members of keyControl Module in SuiteScript
The keyControl module provides essential key object member properties and methods for SuiteScript key management.
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
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
- Enhancements to SuiteScript User Role Context Clarification
SuiteScript updates clarify the user and role contexts for script executions, improving deployment understanding and management.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category