Verifier.verify(options)
|
Method Description |
Verifies a string against a provided signature using a specified certificate. You can create a verifier object using the certificate.createVerifier(options) method. |
|
Returns |
void |
|
Supported Script Types |
Server scripts For additional information, see SuiteScript 2.x Script Types. |
|
Governance |
None |
|
Module |
|
|
Parent Object |
|
|
Sibling Object Members |
|
|
Since |
2019.1 |
Parameters
The options parameter is a JavaScript object.
|
Parameter |
Type |
Required / Optional |
Description |
|---|---|---|---|
|
|
string |
required |
The signature to be verified. |
|
|
string |
optional |
The signature’s encoding in Base64 format. |
Errors
|
Error Code |
Thrown If |
|---|---|
|
|
Signature is not verified. This can occur if the certificate or hash algorithm is not correct in the Verifier object or the signature is not valid for the supplied string. |
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
...
// myVerifier will be certificate.Verifier object
var myVerifier = certificate.createVerifier({
certId: 'custcertificate1',
algorithm: certificate.HashAlg.SHA256
});
myVerifier.update('test');
myVerifier.verify(result);
...
//Add additional code