N/crypto/certificate Module Features in SuiteScript
The N/crypto/certificate module in SuiteScript offers XML signing and verification, enhancing data security through digital signatures.
The N/crypto/certificate module is essential for SuiteScript developers focused on securely signing XML data. This module provides methods to create digital signatures and verify them, thereby ensuring data integrity during transactions.
What Are the Key Features of the N/crypto/certificate Module?
The N/crypto/certificate module includes the following core members:
Objects
| Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
certificate.SignedXml | Object | Server scripts | Encapsulates an XML string that has been digitally signed. |
certificate.Signer | Object | Server scripts | Encapsulates a created signature (signer) for plain strings. |
certificate.Verifier | Object | Server scripts | Encapsulates a created verifier for verifying plain string signatures. |
Methods
| Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
certificate.createSigner(options) | certificate.Signer | Server scripts | Creates a certificate.Signer object for signing plain strings. |
certificate.createVerifier(options) | certificate.Verifier | Server scripts | Creates a certificate.Verifier object for verifying signatures of plain strings. |
certificate.signXml(options) | certificate.SignedXml | Server scripts | Signs the input XML string using the Certificate ID, returning a signed XML object. |
certificate.verifyXmlSignature(options) | void | Server scripts | Verifies the signature in the SignedXml file. |
Enums
| Name | Type | Supported Script Types | Description |
|---|---|---|---|
certificate.HashAlg | enum | Server scripts | Holds string values for hash algorithm types, used in signing and verifying methods. |
How to Use the N/crypto/certificate Module
To use the module for signing and verifying XML signatures, follow the syntax shown below:
1// Establishing a signedXml object2var signedXml = certificate.signXml({3 algorithm: certificate.HashAlg.SHA256,4 certId: 'custcertificate1',5 rootTag: 'infNFe',6 xmlString: infNFe.getContents()7});8 9// Verifying the XML signature10certificate.verifyXmlSignature({11 signedXml: signedXml,12 rootTag: 'infNFe'13});Important Notes
- The signing methods disable formatting, which means any line breaks in the XML will not be included in the signature.
- This module is only available for use in server scripts, emphasizing its security and operational integrity.
Who This Affects
- Developers: Utilizing the N/crypto/certificate module for secure XML processing.
- Administrators: Implementing secure transaction processes through SuiteScript.
Key Takeaways
- The N/crypto/certificate module facilitates secure XML signing and verification.
- It includes essential methods for creating signers and verifiers.
- Effective for server-side scripts, enhancing data security through digital signatures.
Frequently Asked Questions (4)
Can the N/crypto/certificate module be used in client scripts?
What algorithms are supported by the N/crypto/certificate module for signing?
How does the signXml method handle XML formatting?
What objects does the N/crypto/certificate module provide for signature creation and verification?
Was this article helpful?
More in Integration
- Natural Language Queries in NetSuite AI
MCP Standard Tools SuiteApp enables AI-driven data tasks in NetSuite, aligned with role permissions.
- Square Connector Integration in NetSuite 2026.1
Discover the Square Connector for seamless integration with NetSuite 2026.1, synchronizing transactions, orders, and inventory effortlessly.
- SuiteTalk Web Services Updates for NetSuite Integrations
SuiteTalk Web Services adds new Item Supply Plan support, enhancing integrations for efficient data management.
- SuiteTalk Web Services Enhancements in NetSuite
Explore the latest enhancements to SuiteTalk Web Services, improving integration and API functionalities in NetSuite.
Advertising
Reach Integration Professionals
Put your product in front of NetSuite experts who work with Integration every day.
Sponsor This Category