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.

·4 min read·View Oracle Docs

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 TypeNameReturn Type / Value TypeSupported Script TypesDescription
ObjectcertificateControl.CertificateobjectServer scriptsEncapsulates a digital certificate record.
MethodcertificateControl.findCertificates(options)objectServer scriptsRetrieves metadata about certificate(s).
MethodcertificateControl.findUsages(options)object[]Server scriptsProvides an audit trail of certificate usage with timestamps.
MethodcertificateControl.createCertificate(options)certificateControl.CertificateServer scriptsCreates a certificate record using a file from the File Cabinet.
MethodcertificateControl.deleteCertificate(options)stringServer scriptsDeletes a specified certificate record.
MethodcertificateControl.loadCertificate(options)certificateControl.CertificateServer scriptsLoads a certificate record for manipulation.
MethodcertificateControl.lock(options)stringServer scriptsLocks a certificate record so that edits are prohibited.
MethodcertificateControl.unlock(options)stringServer scriptsUnlocks a previously locked certificate record.
EnumcertificateControl.OperationenumServer scriptsContains operation values for searching certificates.
EnumcertificateControl.OperatorenumServer scriptsDefines search operators for filtering certificates.
EnumcertificateControl.TypeenumServer scriptsDenotes 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 TypeNameReturn Type / Value TypeSupported Script TypesDescription
MethodCertificate.save()object containing the script ID of the new certificate recordServer scriptsSaves a certificate record.
PropertyCertificate.descriptionstringServer scriptsDescribes the certificate record.
PropertyCertificate.fileFile Object Members objectServer scriptsProperties of the uploaded file for the certificate.
PropertyCertificate.namestringServer scriptsThe name associated with the certificate record.
PropertyCertificate.monthReminderbooleanServer scriptsControls expiration reminders associated with the certificate record.
PropertyCertificate.notificationsnumber[]Server scriptsInternal IDs for employees copied on notifications related to the certificate.
PropertyCertificate.passwordstring (write-only)Server scriptsPassword for the digital certificate, can be generated for secure access.
PropertyCertificate.restrictionsnumber[]Server scriptsInternal IDs of employees restricted access to this certificate.
PropertyCertificate.scriptIdstringServer scriptsUnique ID for the certificate record.
PropertyCertificate.subsidiariesnumber[]Server scriptsInternal IDs of subsidiaries linked to the certificate.
PropertyCertificate.threeMonthsReminderbooleanServer scriptsIndicates a three-month expiration reminder setting for the certificate.
PropertyCertificate.weekReminderbooleanServer scriptsIndicates 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:

suitescript
1// Add additional code
2...
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 code

Who 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.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

What permissions are required to use methods in the N/certificateControl module?
The article does not specify the exact permissions required. It likely depends on the specific SuiteScript environment and role permissions set up in your NetSuite account.
How do I create a digital certificate using the N/certificateControl module?
You can create a certificate by using the certificateControl.createCertificate method, which creates a certificate record from a file in the File Cabinet.
Can I lock a digital certificate to prevent changes, and how?
Yes, you can lock a digital certificate using the certificateControl.lock method, which prohibits edits to the certificate record.
Does the N/certificateControl module support the management of certificate expiration reminders?
Yes, the module allows setting expiration reminders through properties such as monthReminder, threeMonthsReminder, and weekReminder in the certificateControl.Certificate object.
Source: N/certificateControl Module Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Integration

View all Integration articles →