Create token for the plaintext
tokenize()
This API tokenizes a plaintext value, and returns the token. User should have encrypt permission on the key to perform tokenization.
URL
https://localhost:8443/tmrestVaultless/SafeNetVaultlessTokenization/tokenize
URL for Batch
https://localhost:8443/tmrestVaultless/SafeNetVaultlessTokenization/tokenizeBatch
Method
POST
Parameters
The following parameters are required for tokenization of a plain text. Parameters are further classified into three main categories:
Common Parameters
| Parameter | Description |
|---|---|
| naeUser | Key manager's user with access to the key. |
| naePassword | Key manager's user password. |
| KeyName | Key to initialize the token service vaultless. |
| value(s) | plaintext(s) to be tokenized. |
TokenSpec Parameters
Allows users to set the parameters based on which the plaintext is tokenized/detokenized.
| Parameters | Description |
|---|---|
| groupID | Sets the group ID (long) for the plaintext to be tokenized. |
| luhnCheck | Determines whether the luhn digit of the token generated should pass or fail the luhnCheck. |
| nonIdempotentTokens | Determines if the same or different tokens are generated for the same input plaintext. |
| clearTextSensitive | Determines if the digits in the clear-text position of the input plaintext is used to generate the token. |
| format | Allows user to set the structure of the token generated. |
AlgoSpec Parameter
Provides the input for the algorithm used in tokenization/detokenization process.
| Parameter | Description |
|---|---|
| version | The possible values are 0 and 1. It is set to 1 to have higher security in tokenization/detokenization process. The default value is set to 1. |
| Unicode | This parameter is used to tokenize and detokenize the Unicode input characters. |
Important Notes
If no values are specified for
groupID,luhnCheck,nonIdempotentTokens,clearTextSensitiveandformat, their default values are used.For
clearTextSensitiveandnonIdempotentTokensparameters, if any value other thantrueorfalseis specified, it is considered asfalse.It is recommended to use the default value of AlgoSpec by setting
“version”:1in the JSON payload to ensure higher security in tokenization/detokenization process.
Returned Values
String or String[] - token(s) created for the input value(s).
Throws
TokenExceptions in case any parameter is invalid.
Examples
Tokenization
Option 1
Request
{
"naeUser":"user",
"naePassword":"xxxxxxxx",
"value":"1000-0000-0023-4400-9",
"format":"TOKEN_ALL",
"keyName" :"vless_try"
}
Response
{
"token": "2373-0717-3541-2400-9"
}
Option 2
Request
{
"naeUser":"grp_user1",
"naePassword":"xxxxxxxx",
"value":"9971200625",
"format":"1",
"groupID":1,
"keyName" :"tm_vless_try",
"clearTextSensitive":false,
"version":1
}
Response
{
"token": "8299997805"
}
Batch Tokenization
Option 1
Request
{
"naeUser":"user",
"naePassword":"xxxxxxxx",
"values":["2333333333333333","222222222222233","444444444444433"],
"format":"TOKEN_ALL",
"keyName" :"vless_try"
}
Response
{
tokens: [3]
0: "2586314385333322"
1: "4302578582222225"
2: "6627979014444895"
}
Option 2
Request
{
"naeUser":"grp_user1",
"naePassword":"xxxxxxxx",
"values":["8299997805","9971200625"],
"format":"1",
"groupID":1,
"keyName" :"tm_vless_try",
"clearTextSensitive":false,
"version":1
}
Response
{
"tokens": [
"5564142810",
"8299997805"
]
}
Tokenization of Unicode Characters
Option 1
Request
{
"naeUser":"user",
"naePassword":"xxxxxxxx",
"value":"ぁあぢぁあぢ",
"format":"1",
"groupID":1,
"keyName" :"tm_vless_try",
"clearTextSensitive":false,
"version":1,
"unicode":"HIRAGANA"
}
Response
{
"token": "だじしづほぶ"
}
Batch Tokenization of Unicode Characters
Request
{
"naeUser":"grp_user1",
"naePassword":"xxxxxxxx",
"values":[" ぁあぢぁあぢ"," ぁああぢ"],
"format":"1",
"groupID":1,
"keyName" :"tm_vless_try",
"clearTextSensitive":false,
"version":1,
"unicode":"HIRAGANA"
}
Response
{
"tokens": [
" だじしづほぶ",
" ゜ ゑんも"
]
}