certificate.verifyXmlSignature(options)
Method Description |
Verifies a signature. |
Returns |
void |
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 |
optional |
The script ID for the digital certificate. |
|
string |
required |
Signed root XML tag. |
|
string |
required |
Signed XML |
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 mySigner = certificate.createSigner({
certId: 'custcertificate1',
algorithm: certificate.HashAlg.SHA256
});
var signedXml = certificate.signXml({
algorithm: certificate.HashAlg.SHA256,
certId: 'custcertificate1',
rootTag: 'infNFe',
xmlString: infNFe.getContents()
});
var signed_AsString = signedXml.asString()
certificate.verifyXmlSignature({
certId: 'custcertificate1',
rootTag: 'infNFe',
signedXml: signed_AsString
});
...
//Add additional code