Download and compile the code
Clone the repository to your local machine.
git clone https://github.com/ThalesGroup/CipherTrust_Application_Protection.git
The database directory has all the code for snowflake. The AWS Lambda examples should have the following class files in your project. Google Functions will have a similar number of class files.
CADP supports bulk API which allows CADP to batch requests before calling for 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. So, it is recommended to review the CADP documentation to ensure these thresholds are not exceeded.
Use the AWSLambdaTester to test basic connection to CM to ensure your CM environment is configured correctly. You need to modify the keyname to make sure it exists in CM and there are environment variables for userid/pwd. If you have already installed CM then you need to update the
CADP_for_JAVA.properties
file with all the necessary settings such as IP/NAE Port, and so on. TheCADP_for_JAVA.properties
file is located under the resources directory of 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 select "Run As" "maven install" to generate the target.
[INFO] Installing C:\Users\t0185905\workspace\CADP-SNOW-AWS-TokenizeChar813\pom.xml to C:\Users\t0185905\.m2\repository\Thales\CADP-SNOW-AWS-TokenizeChar\0.0.1-SNAPSHOT\CADP-SNOW-AWS-TokenizeChar-0.0.1-SNAPSHOT.pom
[INFO] Installing C:\Users\t0185905\workspace\CADP-SNOW-AWS-TokenizeChar813\target\CADP-SNOW-AWS-TokenizeChar-0.0.1-SNAPSHOT.jar to C:\Users\t0185905\.m2\repository\Thales\CADP-SNOW-AWS-TokenizeChar\0.0.1-SNAPSHOT\CADP-SNOW-AWS-TokenizeChar-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.096 s
[INFO] Finished at: 2024-02-06T09:23:21-05:00
This process remains the same for GCP Cloud Functions or Azure Functions. The code provided has a separate class for each datatype. This code can easily be modified to accept variables from the API Gateway header or as an environment variable to reduce the number of class files or customize it to perform any algorithm supported by CADP.