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

N/crypto/certificate Module

Since

2019.1

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.certId

string

optional

The script ID for the digital certificate.

options.rootTag

string

required

Signed root XML tag.

options.signedXml

string

required

Signed XML

Syntax

Important:

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 

            

Related Topics

General Notices