https.createSecretKey(options)
Method Description |
Creates and returns a crypto.SecretKey Object. This method can take a GUID or a secret. You can place the key in your secure string. SuiteScript decrypts the value (key) and sends it to the server. |
Returns |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required if |
A GUID used to generate a secret key. Use Form.addCredentialField(options) to generate a GUID. This parameter is not required if you use the The GUID can resolve to either data or metadata. |
2015.2 |
|
string |
required if |
The script ID of the secret used for authentication. You can store secrets at Setup > Company > API Secrets. For more information, see Secrets Management. This parameter is not required if you use the |
2021.1 |
|
optional |
Specifies the encoding for the Secret Key. |
2015.2 |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/https Module Script Samples.
// Add additional code
...
var secretKey = https.createSecretKey({
encoding: https.Encoding.HEX,
guid: '284CFB2D225B1D76FB94D150207E49DF'
});
...
// Add additional code