mask()
mask() generates new tokens without storing any data in the Token Vault. There is no CT-V API that can retrieve the original values from the tokens created using this method.
Syntax
public string[] mask(string[] values, int format, string startToken, bool luhnCheck)
Request Parameters
Parameters | Data Types | Descriptions |
---|---|---|
values | string[] | Data to be tokenized. Input data can be no longer than 256 characters. |
format | integer | One of the following token formats or a format created using createNewFormat(). |
startToken | string | The seed value of the generated tokens if the format is SEQUENTIAL_TOKEN. There are two possible values for the startToken parameter: • Null: If null is assigned to startToken parameter, then the length of the token(s) generated is same as that of the length of the first value of the plaintext array. The default start token value is 0111111111...... • Value: If there is any specific value assigned to startToken parameter, it becomes the first token of the generated output. The rest of the tokens are sequentially generated. |
luhnCheck | boolean | Indicates if the value must pass a Luhn check (true) or if there is no requirement (false). Token formats created using the createNewFormat() method may have one of three luhnCheck rules. The rules are must fail test, no requirement, and must pass test. |
Available formats are listed below. You must prepend “TokenService.” to the format name, as shown below.
TokenService.RANDOM_TOKEN
TokenService.RANDOM_ALPHANUMERIC_TOKEN
TokenService.ALPHANUMERIC_TOKEN
TokenService.SEQUENTIAL_TOKEN
TokenService.LAST_FOUR_TOKEN
TokenService.FIRST_SIX_TOKEN
TokenService.FIRST_TWO_LAST_FOUR_TOKEN
TokenService.FIRST_SIX_LAST_FOUR_TOKEN
TokenService.FIXED_NINETEEN_TOKEN
TokenService.FIXED_TWENTY_LAST_FOUR_TOKEN
TokenService.EMAIL_ADDRESS_TOKEN
TokenService.DATE_MMDDYYYY_TOKEN
TokenService.DATE_DDMMYYYY_TOKEN
TokenService.DATE_YYYYMMDD_TOKEN
TokenService.FIRST_SIX_LAST_FOUR_FAIL_LUHN_TOKEN
TokenService.FIXED_FIRST_TWO_LAST_FOUR_FAIL_LUHN_TOKEN
TokenService.SHA2_256_BASE16_TOKEN
TokenService.SHA2_384_BASE16_TOKEN
TokenService.SHA2_512_BASE16_TOKEN
TokenService.SHA2_256_ BASE64_TOKEN
TokenService.SHA2_384_ BASE64_TOKEN
TokenService.SHA2_512_ BASE64_TOKEN
For more information about these formats, see Token Formats.
The priority of the luhnCheck boolean in insert() and the luhnCheck integer in createNewFormat() vary depending on their values, as shown in the following figure:
Returned Values
String or string array of token(s) created for the input value(s).
Exception
Passes an exception if:
The format is invalid.
The value is null.
The luhnCheck value is invalid.