InsertBatch()
Encrypts an array of plaintext values, create tokens, and insert them into the token vault.
Syntax
public String[] InsertBatch (String naeUser, String naePassword, String dbUser, String dbPswd, String tableName, String[] values, Integer format, Boolean luhnCheck)
Request Parameters
Parameters | Data Types | Descriptions |
---|---|---|
naeUser | String | The Key Manager user with access to the AES and HMAC keys. |
naePassword | String | The Key Manager user’s password. |
dbUser | String | The database user with access to the token table. |
dbPswd | String | The database user’s password. |
tableName | String | The token table. The name must be in CAPITAL LETTERS. |
values | String array | Array of data to be tokenized. The resulting tokens can each be 20 characters long or less. |
format | Int | One of the predefined token formats or a format created using CreateNewTokenFormat() . You can use the constant if your application imports com.safenet.token.TokenService . Otherwise, be sure to use the correct integer. |
luhnCheck | Boolean | Indicates if the value must pass a luhnCheck (true) or if there is no requirement (false). Token formats created using the createNewFormat() method may have one of the following three luhnCheck rules:1. must fail test 2. no requirement 3. must pass test The priority of the luhnCheck boolean in insert() and the luhnCheck integer in createNewFormat() vary depending on their values. |
Returned Value
Returned Value | Description |
---|---|
String[] | The tokens. |
Note
When using repeated calls to InsertBatch
to create a large amount of tokens on a Microsoft Windows system, more than 8000 values for example, you may experience a connection failure if the operating system runs out of available sockets.
You can avoid this error by creating registry entries for MaxUserPort
(to increase the number of ports available) and TcpTimedWaitDelay
(to specify the number of seconds that elapse before a socket is released and can be reused). These are both DWORD values.
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters
. Add MaxUserPort
and set it to 32678
. Add TcpTimedWaitDelay
and set it to 30
.