Return plaintext for token
detokenize()
This API returns the plaintext corresponding to the input token. User should have decrypt permission on the key to perform detokenization.
URL
https://localhost:8443/tmrestVaultless/SafeNetVaultlessTokenization/detokenize
URL for Batch
https://localhost:8443/tmrestVaultless/SafeNetVaultlessTokenization/detokenizeBatch
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
,clearTextSensitive
andformat
, their default values are used.For
clearTextSensitive
andnonIdempotentTokens
parameters, if any value other thantrue
orfalse
is specified, it is considered asfalse
.It is recommended to use the default value of AlgoSpec by setting
“version”:1
in the JSON payload to ensure higher security in tokenization/detokenization process.
Returned Values
String or String[] - plaintext(s) corresponding to the token(s).
Throws
TokenExceptions in case any parameter is invalid.
Examples
Detokenization
Option 1
Request
{
"naeUser":"user",
"naePassword":"xxxxxxxx",
"token":"2373-0717-3541-2400-9",
"format":"TOKEN_ALL",
"keyName" :"vless_try"
}
Response
{
"value": "1000-0000-0023-4400-9"
}
Option 2
Request
{
"naeUser":"grp_user1",
"naePassword":"xxxxxxxx",
"token":"8299997805",
"format":"1",
"groupID":1,
"keyName" :"tm_vless_try",
"clearTextSensitive":false,
"version":1
}
Response
{
"value": "9971200625"
}
detokenizeBatch
Option 1
Request
{
"naeUser":"user",
"naePassword":"xxxxxxxx",
"tokens":["2333333333333333","222222222222233","444444444444433"],
"format":"TOKEN_ALL",
"keyName" :"vless_try"
}
Response
{
values: [3]
0: "2586314385333322"
1: "4302578582222225"
2: "6627979014444895"
}
Option 2
Request
{
"naeUser":"grp_user1",
"naePassword":"xxxxxxxx",
"tokens":["8299997805","9971200625"],
"format":"1",
"groupID":1,
"keyName" :"tm_vless_try",
"clearTextSensitive":false,
"version":1
}
Response
{
"values": [
"9971200625",
"0318603683"
]
}
By default, the REST services session caching feature is enabled. To disable the caching feature, add the parameter RestServicesSessionCaching=false
in the SafeNetVaultlessTokenization.properties
file. Restart the web server, if any changes are made to the properties file.