Signer Object Members for SuiteScript in NetSuite
The Signer object in SuiteScript allows for string signing and signature management. This guide covers its methods and usage.
The Signer object is vital for secure communications in SuiteScript, allowing developers to sign strings securely. This feature supports server scripts and is particularly useful in situations requiring digital signatures.
What is the Signer Object?
The Signer object encapsulates a created signature for plain strings and is returned by the certificate.createSigner(options) method. It is a key component of the N/crypto/certificate module.
Signer Object Members
The Signer object includes two main methods that are used for signing operations:
| Member Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
Signer.sign(options) | void | Server scripts | Signs the string and returns the generated signature. |
Signer.update(options) | void | Server scripts | Updates the input string that is to be signed, allowing encoded strings. |
Using the Signer Object
Here's how you can utilize the Signer object in your SuiteScript:
1// Example usage of the Signer object2var mySigner = certificate.createSigner({3 certId: 'custcertificate1',4 algorithm: certificate.HashAlg.SHA5125});6 7mySigner.update("test"); // Update the string to be signed8var result = mySigner.sign({9 outputEncoding: encode.Encoding.BASE_64_URL_SAFE,10 useRawFormatForECDSA: true11});Method Details
- Signer.sign(options): This method is crucial for signing a string and can format the result in various ways, including Base64 encoding.
- Signer.update(options): Use this method to modify the input string that will be signed. This method supports plain and encoded strings.
Who This Affects
This article is beneficial for developers who work with:
- Server Scripts
- Security Implementations
- Digital Signature Management
Key Takeaways
- The Signer object is integral for string signing in SuiteScript.
- Two primary methods exist for signing and updating strings.
- It supports server scripts and various encoding options.
Frequently Asked Questions (4)
What modules do I need to include to use the Signer object in SuiteScript?
Can the Signer object be used in client-side scripts?
What encoding options are available when signing a string using the Signer object?
Is it possible to modify the input string after initially setting it in the Signer object?
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.
