createTokenFormat()
createTokenFormat() creates a new token format which can be used with the insertToken method.
Request URL
http://localhost:8080/tmrest/SafeNetTokenManager/createTokenFormat
Method
POST
Request Parameters
Parameters | Descriptions |
---|---|
naeUser | A Key Manager user with access to the AES and HMAC keys. |
naePassword | The Key Manager user’s password. |
dbUser (optional) | A database user with access to the token table. |
dbPassword (optional) | The database user’s password. |
leadPositions (optional) | Number of positions to preserve (if any) on the left side of the value. |
trailPositions (optional) | Number of positions to preserve (if any) on the right side of the value. |
dbHost (optional) | The database host name. |
dbPort (optional) | The database port. |
dbName (optional) | The database name. |
leadMask (optional) | A fixed number of digits to mask the leading positions. For example, if the leadMask is set to 7777, the first four digits of the token will be 7’s. When the leadMask is set, the leadPositions value is ignored. For example, for input value 1234 5678 9012 3456, setting leadMask to 7777 and leadPosition to 6 results in 7777 8031 4902 1531 and not 7777 5631 4902 1531. Note: leadPositions + trailPositions or leadMask + trailPositions cannot be larger than the token length, set in the tokenLength parameter or the Token Vault’s token column. If this rule is ignored, an exception is thrown. |
luhnCheck (optional) | Indicates if the token should fail the check (-1), pass the check (1), or does not matter (0). |
tokenLength (optional) | The length of the token, if it is different from the input data. tokenLength cannot be larger than the Token Vault’s token column. |
Note
The dbHost, dbPort, and dbName parameters are supported for MySQL database only.
Returned Values
An integer value which represents the new token format, the value will be greater than 100.
Example
{
"naeUser":"rajesh",
"naePassword":"xxxxxxxx",
"dbUser":"sa",
"dbPassword":"xxxxxxxx",
"leadPositions":"3",
"trailPositions":"5",
"luhnCheck":1,
"tokenLength":20
}
Example with Database Properties
{
"naeUser":"rajesh",
"naePassword":"xxxxxxxx",
"dbUser":"sa",
"dbPassword":"xxxxxxxx",
"leadPositions":"3",
"trailPositions":"5",
"dbHost":"10.164.14.111",
"dbPort":"3306",
"dbName":"test",
"luhnCheck":1,
"tokenLength":20
}
Result
{
format: 101
}