Download and Compile the Code
Clone the repository to your local machine.
git clone https://github.com/ThalesGroup/CipherTrust_Application_Protection.gitThe database directory has all the code for AWS Redshift. You should see the classes in your project.

CADP supports a bulk API which allows for CADP to batch requests before calling encrypt or decrypt. A separate class file for each datatype is available for testing with this API.
Note
There is a limit of 10,000 items to encrypt but it also depends on the size of the items as well. So, review the CADP documentation to make sure those thresholds are not exceeded. Typically, the point of diminishing returns is around 200.
Use the
ThalesAWSRedshiftCADPTesterto test the basic connection to CM to ensure your CM environment is configured correctly. You will need to modify the keyname to make sure it exists in CM and there are environment variables that must be set as well. If you plan on using UserSets, the user must also be in the Application Data Protection Client Group. See the section on Environment Variables for more details.If you have already installed CM then you will need to update the
CADP_for_JAVA.propertiesfile with all the necessary settings, such as IP/NAE Port, etc. TheCADP_for_JAVA.propertiesfile is located under the resource’s directory in the Java project for Eclipse.
Generate the Jar File to Upload to the CSP
To compile and generate the target jar file to be uploaded to AWS Lambda, select the project and choose “Run As” “maven install” to generate the target.
[INFO] Replacing C:\Users\t0185905\workspace\CADP-AWS-Redshift-UDF\target\CADP-AWS-Redshift-UDF-0.0.2-SNAPSHOT.jar with C:\Users\t0185905\workspace\CADP-AWS-Redshift-UDF\target\CADP-AWS-Redshift-UDF-0.0.2-SNAPSHOT-shaded.jar
[INFO]
[INFO] --- maven-install-plugin:3.0.1:install (default-install) @ CADP-AWS-Redshift-UDF ---
[INFO] Installing C:\Users\t0185905\workspace\CADP-AWS-Redshift-UDF\pom.xml to C:\Users\t0185905\.m2\repository\Thales\CADP-AWS-Redshift-UDF\0.0.2-SNAPSHOT\CADP-AWS-Redshift-UDF-0.0.2-SNAPSHOT.pom
[INFO] Installing C:\Users\t0185905\workspace\CADP-AWS-Redshift-UDF\target\CADP-AWS-Redshift-UDF-0.0.2-SNAPSHOT.jar to C:\Users\t0185905\.m2\repository\Thales\CADP-AWS-Redshift-UDF\0.0.2-SNAPSHOT\CADP-AWS-Redshift-UDF-0.0.2-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.191 s
[INFO] Finished at: 2024-05-15T15:59:06-04:00
[INFO] ------------------------------------------------------------------------
The code provided uses Google's userDefinedContext capability. This code accepts a mode and a datatype as a keyvalue pair.