N/crypto Module
Use N/crypto module to perform hashing, hash-based message authentication (hmac), and symmetrical encryption functions.
When the N/crypto module is used, SuiteScript also loads N/encode Module.
In This Help Topic
N/crypto Module Members
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Object |
Object |
Server scripts |
Encapsulates a cipher. |
|
Object |
Server scripts |
Encapsulates a cipher payload. |
||
Object |
Server scripts |
Encapsulates a decipher. |
||
Object |
Server scripts |
Encapsulates a hash. |
||
Object |
Server scripts |
Encapsulates an hmac. |
||
Object |
Server scripts |
Encapsulates a secret key handle. |
||
Method |
boolean |
Server scripts |
Checks whether a password in a record corresponds to the password entered by the user. |
|
Object |
Server scripts |
Creates and returns a new crypto.Cipher Object. |
||
Object |
Server scripts |
Creates and returns a new crypto.Decipher object. |
||
Object |
Server scripts |
Creates and returns a new crypto.Hash Object. |
||
Object |
Server scripts |
Creates and returns a new crypto.Hmac Object. |
||
Object |
Server scripts |
Creates and returns a new crypto.SecretKey Object. |
||
Enum |
string (read-only) |
Server scripts |
Holds the string values for supported encryption algorithms. Use this enum to set the |
|
string (read-only) |
Server scripts |
Holds the string values for supported hashing algorithms. Use this enum to set the |
||
string (read-only) |
Server scripts |
Holds the string values for supported cipher padding. Use this enum to set the |
Cipher Object Members
The following members are called on crypto.Cipher.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
void |
Server scripts |
Updates the clear data with the specified encoding. |
|
Object |
Server scripts |
Returns the cipher data. |
CipherPayload Object Members
The following members are called on crypto.CipherPayload.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Property |
string |
Server scripts |
The result of the ciphering process. |
|
number |
Server scripts |
An initialization vector. |
Decipher Object Members
The following members are called on crypto.Decipher.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
string |
Server scripts |
Returns the clear data. |
|
void |
Server scripts |
Updates decipher data with the specified encoding. |
Hash Object Members
The following members are called on crypto.Hash.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
string |
Server scripts |
Calculates the digest of the data to be hashed. |
|
void |
Server scripts |
Updates the clear data with the encoding specified. |
Hmac Object Members
The following members are called on crypto.Hmac.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
string |
Server scripts |
Gets the computed digest. |
|
void |
Server scripts |
Updates the clear data with the encoding specified. |
SecretKey Object Members
The following members are called on crypto.SecretKey.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Property |
string |
Server scripts |
The GUID associated with the secret key. |
|
string |
Server scripts |
The encoding used for the clear text value of the secret key. |
||
SecretKey.password |
string |
Server scripts |
The script ID of an API secret stored at Setup > Company > API Secrets. |