certificate.signXml(options)
Method Description |
Signs an input XML string using a certificate ID. Formatting, such as line breaks, is disabled. |
Returns |
|
Supported Script Types |
Server scripts For additional information, see SuiteScript 2.x Script Types. |
Governance |
10 units |
Module |
|
Since |
2019.1 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
Input XML string |
|
string |
required |
Certificate ID |
|
string |
required |
The hash algorithm. Set this property using the certificate.HashAlg enum. |
|
string |
required |
Root tag of XML section to sign. |
|
string |
optional |
Tag where the signature should be inserted. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/crypto/certificate Module Script Samples.
//Add additional code
...
var signedXml = certificate.signXml({
algorithm: certificate.HashAlg.SHA256,
certId: 'custcertificate1',
rootTag: 'infNFe',
xmlString: infNFe.getContents()
});
...
//Add additional code