N/keyControl Module

Use the N/keyControl module to use SSH keys and access key storage. You can also access keys in the UI at Setup > Company > Preferences > Keys.

By using the SSH keys, you can manage files and directories by using the SSH file transfer (SFTP) protocol. For more information, see SSH Keys for SFTP. For more information about SFTP, see N/sftp Module.

                                   

In This Help Topic

N/keyControl Module Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Object

keyControl.Key

Object

Server scripts

Represents the key object.

Method

keyControl.findKeys(options)

Object

Server scripts

Searches and returns a list of keys based on criteria set. If no options are set for criteria, the full list of keys stored in NetSuite is returned.

keyControl.createKey(options)

keyControl.Key

Server scripts

Creates a key.

keyControl.deleteKey(options)

Object

Server scripts

Marks the key as deleted in database. The history is retained.

keyControl.loadKey(options)

keyControl.Key

Server scripts

Loads a key.

keyControl.lock(options)

string

Server scripts

Locks a key so that it cannot be edited in the UI.

keyControl.unlock(options)

string

Server scripts

Unlocks a key that has been locked by keyControl.lock(options).

Enum

keyControl.Operator

enum

Server scripts

Holds the values for the key operators of keyControl.findKeys(options).

Key Object Members

The following members are called on the keyControl.Key object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Key.file

file.File

Server scripts

File object of the key.

Key.password

string

Server scripts

Password of the key (write-only).

You can create a GUID using Form.addSecretKeyField(options). This property also accepts the script ID of an API secret stored at Setup > Company > API Secrets.

Key.scriptId

string

Server scripts

Script ID of the key. NetSuite prepends this ID with custkey.

Key.name

string

Server scripts

Name of the key.

Key.description

string

Server scripts

Description of the key.

Key.restrictions

string

Server scripts

The internal IDs of the employees selected in the Restrict to Employees field of the key record.

Method

Key.save()

Object

Server scripts

Saves the key.

General Notices