mask()
mask() API 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 mask() method.
Syntax
public String[] mask (String[] values, int format, String startToken, boolean luhnCheck) throws TokenException
public String[] mask (String[] values, String tokenGeneratorClassName) throws TokenException
public String[] mask (String[] values, ITokenGenerator tokenGenerator) throws TokenException
Request Parameters
Parameters | Data Types | Descriptions |
---|---|---|
values | string[] | The data to be tokenized. Input data can be no longer than 256 characters. |
format | integer | One of the predefined token formats or a format created using createNewFormat(). For more information about the available formats, see Token Formats. |
startToken | string | The seed value of the generated tokens, if the format is SEQUENTIAL_TOKEN. Notes: 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 in the plaintext array. The default start token value is 0111111111...... • Value: If there is a 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 | 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. |
tokenGeneratorClassName | Allows user to specify the code that generates tokens using java classname. | |
tokenGenerator | Allows user to specify the code that generates tokens using instance of ITokenGenerator. |
The priority of the luhnCheck boolean in insert() and the luhnCheck integer in createNewFormat() vary, depending on their values, as can be seen in this image:
Returned values
Returned a token or an array of tokens, created for the input value(s).
Exception
Throws TokenException
if:
The format is invalid.
The value contains null.
The luhnCheck value is invalid.