createMaskingFormat()
createMaskingFormat() API creates a new masking format which is used in get() methods to mask the plaintext values.
Syntax
public int createMaskingFormat(int showFirst, int showLast, String maskChar) throws TokenException
Request Parameters
Parameters | Data Types | Descriptions |
---|---|---|
showFirst | integer | the number of characters to be displayed at the beginning of the value. |
showLast | integer | the number of characters to be displayed at the end of the value. |
maskChar | string | a single character (except blank space) that will be used as masking character for the remaining characters of the value. The default masking character is X. |
Returned Value
Returns integer as the new masking format ID. This value is greater than 100.
Exception
Throws TokenException
if the following parameters are invalid:
showFirst
showLast
maskChar
Example
createMaskingFormat(3, 2, "#")
The plaintext value 1234567890
is masked as 123#####90
. In this method, the first parameter allows showing first three values, the second parameter allows showing the last two values, and the third parameter masked remaining value with #.