Modules
SuiteScript 2.0
{keyControl}.createKey({file: {file},password: {string},scriptId: {string},description: {string},restrictions: {number[] or string[]},name: ${7:string}})
N/keyControl Module
keyControl.createKey()
Method Description:
Creates a key record on the Private Keys page using a file from the File Cabinet.
Returns:
keyControl.Key
Supported Script Types:
Server scripts
For additional information, see SuiteScript 2.0 Script Types.
Governance:
10 units
Module:
N/keyControl Module
Since:
2019.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=keyControl.createKey(options)
Example:
// Code Example 1
// Add additional code
//...
require(['N/keyControl','N/file'],function(keyControl,file){
var key = keyControl.createKey();
key.file = file.load(422);
//id of file containing private key (id_ecdsa or id_rsa)
key.name = "SFTP key";
key.save();
})
//...
// Add addtional code
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_1557417459.html