Bulk protect
Use the /v1/protectbulk
API to protect bulk data. This API uses the POST
method.
Prerequisites
CRDP must be up and running. Refer to the Quick Start section for details.
CipherTrust Manager must be up and running. Refer to CipherTrust Manager Deployment for details.
Protection policy must be created. Refer to Managing Protection Policy for details.
The key used in the protection policy must be added to the Application Data Protection Clients Group with Use, Read, Encrypt, Decrypt, and Export permissions.
Request URL
curl -X POST -H "Content-Type: application/json" \-d '{"protection_policy_name": "<protection_policy>","data_array": ["<sample data1>", "<sample data 2>"]}'\<ip>:<port>/v1/protectbulk
curl -X POST -H "Content-Type: application/json" \--header 'Authorization: Bearer JWT' \-d '{"protection_policy_name": "<protection_policy>","data_array": ["<sample data1>", "<sample data 2>"]}'\<ip>:<port>/v1/protectbulk
Here, ip
is the IP of the host machine where CRDP container is deployed and <port>
is the port of CRDP container.
Request Parameters
Request Parameter | Description |
---|---|
protection_policy_name | Protection policy to be used during the protect operation. |
data_array | An array of data to be protected. |
Response Parameters
Response Parameter | Description |
---|---|
status | Overall status of the bulk protect operations. |
total_count | Total count of data to be protected. |
success_count | Total count of successful operations. |
error_count | Total count of failed operations. |
protected_data_array | Contains the array of protected data. |
Examples for ProtectBulk
Request
{
"protection_policy_name": "testpp-internal-versioned",
"data_array": [
"1234562jhljhjl39480234",
"ksjhfkjadsfi588566jadsf",
"123123k123jkhjkhjk12k3jk"
]
}
Response
{
"status": "Success",
"total_count": 3,
"success_count": 3,
"error_count": 0,
"protected_data_array": [
{
"protected_data": "10010001234562wpqfcchi39480234"
},
{
"protected_data": "10010001vtckobifvngs588566cjdyu"
},
{
"protected_data": "10010001123123l123pkmnsrae12b3ie"
}
]
}
This example uses internal versioned policy (testpp-internal-versioned
) to protect data. In response, version header bytes+ ciphertexts are returned in the protected_data_array
field. The protection policy is configured to protect only lower alphabets, the numbers and special characters are preserved as it is.
Request
{
"protection_policy_name": "testpp-external-versioned",
"data_array": [
"1234562jhljhjl39480234",
"ksjhfkjadsfi588566jadsf",
"123123k123jkhjkhjk12k3jk"
]
}
Response
{
"status": "Success",
"total_count": 3,
"success_count": 3,
"error_count": 0,
"protected_data_array": [
{
"protected_data": "234562wpqfcchi39480234",
"external_version": "10010001"
},
{
"protected_data": "vtckobifvngs588566cjdyu",
"external_version": "10010001"
},
{
"protected_data": "123123l123pkmnsrae12b3ie",
"external_version": "10010001"
}
]
}
This example uses external versioned policy (testpp-external-versioned
) to protect data. In response, ciphertexts are returned in the protected_data_array
field. The external_version
field holds the version bytes. The protection policy is configured to protect only lower alphabets, the numbers and special characters are preserved as it is.
Request
{
"protection_policy_name": "testpp-disabled-versioned",
"data_array": [
"1234562jhljhjl39480234",
"ksjhfkjadsfi588566jadsf",
"123123k123jkhjkhjk12k3jk"
]
}
Response
{
"status": "Success",
"total_count": 3,
"success_count": 3,
"error_count": 0,
"protected_data_array": [
{
"protected_data": "1234562sdyhgcchi39480234"
},
{
"protected_data": "jvtckodifvngw588566cjdyu"
},
{
"protected_data": "1123123l123pkmnsrae12b3ie"
}
]
}
This example uses disabled policy (testpp-disabled-versioned
) to protect data. In response, only ciphertexts are returned in the protected_data_array
field. The protection policy is configured to protect only lower alphabets, the numbers and special characters are preserved as it is.