Date2Request
This API performs tokenization and detokenization of dates.
URL
<http/https>://<host-name>:<Port>/protectappws/services/rest/date2
Input Parameters
Parameters | Description |
---|---|
userName | User name (optional). |
password | Password associated with the user (optional). |
keyName | Name of the key to be used for tokenization/detokenization of dates. |
dateFormat | The format in which the date to be tokenized/detokenized is specified. This parameter should be specified in Java supported date format. The allowed formats are: — MM/dd/yyyy — yyyy-MM-dd |
data | Data (Date) on which tokenization/detokenization is to be performed. |
startYear | The value of start year in yyyy format; must be greater than 999. |
endYear | The value of end year in yyyy format. |
transformationMode | Transformation mode. Supported modes are: tokenize and detokenize. |
tweakData | Optional, if provided, the length of tweak data should be ≤ 256 characters. The default value is empty string. |
certAlias | Client certificate alias for making SSL connections (optional). |
certPassword | Password for the provided certificate alias (optional). |
Note
The value of startYear
, endYear
, tweakData
, and keyName
once initialized for Date2 algorithm should not be altered; if these values are changed, the Date2 algorithm will not work and throw an error. To change any of these values, restart your application.
Tokenization Sample REST call for cxf
tokenization request
{
"Date2Request": {
"userName": "admin",
"password": "Pass@1234",
"dateFormat": "yyyy-MM-dd",
"keyName": "test_key1",
"transformationMode": "tokenize",
"tweakData": "",
"data": "2024-11-04",
"startYear": "2024",
"endYear": "2025"
}
}
tokenization response
{
"DateOperationResponse": {
"tokenizedDate": "2024-07-04"
}
}
Detokenization Sample REST call for cxf
detokenization request
{
"Date2Request": {
"userName": "admin",
"password": "Pass@1234",
"dateFormat": "yyyy-MM-dd",
"keyName": "test_key1",
"transformationMode": "detokenize",
"tweakData": "",
"data": "2024-07-04",
"startYear": "2024",
"endYear": "2025"
}
}
detokenization response
{
"DateOperationResponse": {
"data": "2024-11-04"
}
}
Tokenization SOAP Sample
<prot:Date2Request>
<!--Optional:-->
<userName>admin</userName>
<!--Optional:-->
<password>Pass@1234</password>
<dateFormat>yyyy-MM-dd</dateFormat>
<keyName>test_key1</keyName>
<transformationMode>tokenize</transformationMode>
<data>2024-11-04</data>
<startYear>2024</startYear>
<endYear>2025</endYear>
<!--Optional:-->
<tweakData>wowowooww</tweakData>
<!--Optional:-->
<certAlias>?</certAlias>
<!--Optional:-->
<certPassword>?</certPassword>
</prot:Date2Request>
Tokenization Output
Tokenized date that is 2024-07-04.
<ns2:DateOperationResponse xmlns:ns2="http://dsws.org/protectappws/">2024-07-04</ns2:DateOperationResponse>
Detokenization SOAP Sample
<prot:Date2Request>
<!--Optional:-->
<userName>admin</userName>
<!--Optional:-->
<password>Pass@1234</password>
<dateFormat>yyyy-MM-dd</dateFormat>
<keyName>test_key1</keyName>
<transformationMode>detokenize</transformationMode>
<data>2024-07-04</data>
<startYear>2024</startYear>
<endYear>2025</endYear>
<!--Optional:-->
<tweakData>wowowooww</tweakData>
<!--Optional:-->
<certAlias>?</certAlias>
<!--Optional:-->
<certPassword>?</certPassword>
</prot:Date2Request>
Detokenization Output
Detokenized date that is 2024-11-04.
<ns2:DateOperationResponse xmlns:ns2="http://dsws.org/protectappws/">2024-11-04</ns2:DateOperationResponse>
Reference
The specifications for the Date2 algorithm are listed here.