N/certificateControl Module Overview for SuiteScript Developers
The N/certificateControl module provides methods to manage digital certificates in SuiteScript, facilitating certificate creation, loading, and deletion.
The N/certificateControl module is a crucial component for managing digital certificates in SuiteScript environments. It offers various methods and properties that simplify the recording and tracking of certificate data, which is essential for secure digital transactions.
What Can You Do with the N/certificateControl Module?
The module contains members you can use within server scripts to handle certificate records efficiently. Here’s an overview of its key elements:
Main Members and Their Functions
| Member Type | Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| Object | certificateControl.Certificate | object | Server scripts | Encapsulates a digital certificate record. |
| Method | certificateControl.findCertificates(options) | object | Server scripts | Retrieves metadata about certificate(s). |
| Method | certificateControl.findUsages(options) | object[] | Server scripts | Provides an audit trail of certificate usage with timestamps. |
| Method | certificateControl.createCertificate(options) | certificateControl.Certificate | Server scripts | Creates a certificate record using a file from the File Cabinet. |
| Method | certificateControl.deleteCertificate(options) | string | Server scripts | Deletes a specified certificate record. |
| Method | certificateControl.loadCertificate(options) | certificateControl.Certificate | Server scripts | Loads a certificate record for manipulation. |
| Method | certificateControl.lock(options) | string | Server scripts | Locks a certificate record so that edits are prohibited. |
| Method | certificateControl.unlock(options) | string | Server scripts | Unlocks a previously locked certificate record. |
| Enum | certificateControl.Operation | enum | Server scripts | Contains operation values for searching certificates. |
| Enum | certificateControl.Operator | enum | Server scripts | Defines search operators for filtering certificates. |
| Enum | certificateControl.Type | enum | Server scripts | Denotes certificate file types for searches. |
Certificate Object Members
When working with the certificateControl.Certificate object, you have access to several critical methods and properties:
| Member Type | Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| Method | Certificate.save() | object containing the script ID of the new certificate record | Server scripts | Saves a certificate record. |
| Property | Certificate.description | string | Server scripts | Describes the certificate record. |
| Property | Certificate.file | File Object Members object | Server scripts | Properties of the uploaded file for the certificate. |
| Property | Certificate.name | string | Server scripts | The name associated with the certificate record. |
| Property | Certificate.monthReminder | boolean | Server scripts | Controls expiration reminders associated with the certificate record. |
| Property | Certificate.notifications | number[] | Server scripts | Internal IDs for employees copied on notifications related to the certificate. |
| Property | Certificate.password | string (write-only) | Server scripts | Password for the digital certificate, can be generated for secure access. |
| Property | Certificate.restrictions | number[] | Server scripts | Internal IDs of employees restricted access to this certificate. |
| Property | Certificate.scriptId | string | Server scripts | Unique ID for the certificate record. |
| Property | Certificate.subsidiaries | number[] | Server scripts | Internal IDs of subsidiaries linked to the certificate. |
| Property | Certificate.threeMonthsReminder | boolean | Server scripts | Indicates a three-month expiration reminder setting for the certificate. |
| Property | Certificate.weekReminder | boolean | Server scripts | Indicates a one-week expiration reminder setting for the certificate. |
Syntax Example
The following is a basic example of how to load a certificate and make updates:
1// Add additional code2...3var loadedCertificate = certificateControl.loadCertificate({4 scriptId: 'custcertificate_testid'5});6fileObj = file.load({7 id: 'SuiteScripts/ecdsa.p12'8});9loadedCertificate.file = fileObj;10loadedCertificate.password = '022b490ad4334c7e86a8304f937ec68f';11loadedCertificate.save();12certificateControl.deleteCertificate({13 scriptId: 'custcertificate_testid'14});15...16// Add additional codeWho This Affects
- Developers: Particularly those implementing security features or handling certificate management in SuiteScript.
- Administrators: Responsible for overseeing the deployment of digital certificates and ensuring compliance with security protocols.
Key Takeaways
- The N/certificateControl module is essential for managing digital certificates in SuiteScript.
- Key functionalities include creating, deleting, locking, and loading certificates.
- Understanding the available properties is crucial for effective certificate management.
Frequently Asked Questions (4)
What permissions are required to use methods in the N/certificateControl module?
How do I create a digital certificate using the N/certificateControl module?
Can I lock a digital certificate to prevent changes, and how?
Does the N/certificateControl module support the management of certificate expiration reminders?
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.
