N/certificateControl Module for SuiteScript: Manage Digital
The N/certificateControl module offers versatile methods for managing digital certificates in SuiteScript, including creation 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
- 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