crypto.createHmac(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Creates a new crypto.Hmac object.

Returns

A crypto.Hmac object.

Supported Script Types

Server scripts

For additional information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/crypto Module

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.algorithm

string

required

The hash algorithm. Use the crypto.HashAlg enum to set the value.

2015.2

options.key

object

required

The crypto.SecretKey object.

2015.2

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 Module Script Samples.

          //Add additional code 
...
var hmacObj = crypto.createHmac({
    algorithm: HashAlg.SHA256,
    key: sKey
});
...
//Add additional code 

        

Related Topics

N/crypto Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices