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 and detokenization of dates. |
dateFormatScheme | Represents a possible set of date formats. The supported date format schemes are:
|
dateFormat | The arrangements of date, month, and year are in a java format that aligns with the dateFormatScheme. For example, the dateFormat of dd-MM-yyyy hh:mm:ss (03-Jun-2024 21:00:30) after tokenization has no impact on the time and the time remains unaltered, that is, 21:00:30 .• The dateformat must align with the dateFormatScheme to avoid any errors during tokenization or detokenization. The week year format YYYY and YY are not supported. It may lead to incorrect tokenization or detokenization. |
data | Data (Date) on which tokenization/detokenization is to be performed. |
startYear | The value of start year must be greater than 999 for yyyy dateFormat. The value of start year lies in the range from 00-100 for yy dateFormat. Optional, if preserve parameter is set to Year_Month or Year . |
endYear | Maximum value of end year is 9999 in yyyy dateFormat. Maximum value of end year is 100 in yy dateFormat. Optional, if preserve parameter is set to Year_Month or Year . |
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. |
preserve | Retains the specific part of data that remains unaltered after tokenization. The valid values are: — NONE (Default) — MONTH — YEAR — YEAR_MONTH For example, if the date to tokenize is 15-05-2024 and preserve is set to YEAR , then output can be 27-10-2024, where the year (2024) remains unaltered. |
certAlias | Client certificate alias for making SSL connections (optional). |
certPassword | Password for the provided certificate alias (optional). |
Note
The startYear
and endYear
is mandatory if the preserve
type is NONE
Tokenization Sample REST call for cxf
tokenization request
{
"Date2Request": {
"userName": "admin",
"password": "Thales.1",
"keyName": "tedx",
"dateFormatScheme": "MMYY",
"dateFormat": "yy-MM",
"startYear": "01",
"endYear": "96",
"transformationMode": "tokenize",
"data": "23-11",
"tweakData": "12345678",
"preserve": "MONTH",
"certAlias": "",
"certPass": ""
}
}
tokenization response
{
"DateOperationResponse": {
"tokenizedDate": "25-11"
}
}
Detokenization Sample REST call for cxf
detokenization request
{
"Date2Request": {
"userName": "admin",
"password": "Pass@1234",
"keyName": "test_key1",
"dateFormatScheme": "DDMMYYYY",
"dateFormat": "yyyy-MM-dd",
"transformationMode": "detokenize",
"tweakData": "",
"data": "2024-07-04",
"startYear": "1950",
"endYear": "2050"
}
}
detokenization response
{
"DateOperationResponse": {
"data": "2024-11-04"
}
}
Tokenization SOAP Sample
<prot:Date2Request>
<!--Optional:-->
<userName>admin</userName>
<!--Optional:-->
<password>Pass@1234</password>
<keyName>tedx</keyName>
<!--Optional:-->
<dateFormatScheme>DDMMYYYY</dateFormatScheme>
<dateFormat>yyyy-MM-dd</dateFormat>
<transformationMode>tokenize</transformationMode>
<data>2024-11-04</data>
<startYear>1950</startYear>
<endYear>2050</endYear>
<!--Optional:-->
<tweakData>1234567890987654321234567</tweakData>
<!--Optional:-->
<preserve>NONE</preserve>
<!--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>
<!--Optional:-->
<dateFormatScheme>DDMMYYYY</dateFormatScheme>
<dateFormat>yyyy-MM-dd</dateFormat>
<keyName>test_key1</keyName>
<transformationMode>detokenize</transformationMode>
<data>2024-07-04</data>
<startYear>1950</startYear>
<endYear>2050</endYear>
<!--Optional:-->
<tweakData>1234567890987654321234567</tweakData>
<!--Optional:-->
<preserve>NONE</preserve>
<!--Optional:-->
<certAlias></certAlias>
<!--Optional:-->
<certPassword></certPassword>
</prot:Date2Request>
Note
To maintain backward compatibility with CADP for JAVA 8.16.0, dateFormatScheme is optional for below date formats:
MM/dd/yyyy
yyyy-MM-dd
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.