Quick Start
This section describes how to get CADP for Java up and running in less than 10 minutes. CADP for Java can also be deployed using an in-built installer, refer to Alternative Deployment Method for details.
Prerequisites
Any of the supported Java versions must be installed.
(Optional) If using Java version lower than 10, download the encryption policy files for unlimited strength ciphers (
US_export_policy.jar
andlocal_policy.jar
) and install in theJRE_HOME/lib/security
directory.
Note
While the CADP_for_JAVA
JAR is available on the Maven repository, the SafeNetVaultlessTokenization
JAR (required for tokenization) is not hosted there. To use tokenization functionality, install the required library using the built-in installer packaged with CADP for Java.
Deployment steps
Add CADP for Java (from Maven repository) in your application or add the following dependency in the pom.xml
file of your project. This step is common for both centrally managed and traditional APIs.
<dependency>
<groupId>io.github.thalescpl-io.cadp</groupId>
<artifactId>CADP_for_JAVA</artifactId>
<version>8.18.1.000</version>
</dependency>
For further deployment steps, click the desired tab.
Import the following packages. These packages are required to perform cryptographic operations:
import com.centralmanagement.CipherTextData; import com.centralmanagement.CentralManagementProvider; import com.centralmanagement.RegisterClientParameters; import com.centralmanagement.policy.CryptoManager;
Define CADP for Java Application and generate the registration token on the CipherTrust Manager. Refer to Application Data Protection for details.
Register the CADP for Java client on the CipherTrust Manager by passing the following arguments as shown in the below code snippet.
Argument Description keyManagerHost IP address or host name of the key manager. registrationToken Token required to register CADP for Java client on CipherTrust Manager. Registration sample
//Create a RegisterClientParameters object by passing the key manager's IP address and the registration token. RegisterClientParameters registerClientParams = new RegisterClientParameters.Builder(keyManagerHost,registrationToken.toCharArray()).build(); //Create a CentralManagementProvider object by passing RegisterClientParameters object. CentralManagementProvider centralManagementProvider = new CentralManagementProvider(registerClientParams); //Register the client centralManagementProvider.addProvider();
Registration example
RegisterClientParameters registerClientParams = new RegisterClientParameters.Builder("10.xx.xx.xx","b6lYLQfViOmbU4fxBl9gbS6UTJCPqjNh57GV9LQKYSOHdwmuPkYtOZ6ZYFFdQJSa".toCharArray()).build(); CentralManagementProvider centralManagementProvider = new CentralManagementProvider(registerClientParams); centralManagementProvider.addProvider();
After registration, the following logs are displayed.
Sample log
01-20-2025 15:33:31.980 [main] INFO ingrian.internal.config.Config - invoke0: configureProperties: ***************************** 01-20-2025 15:33:31.983 [main] INFO ingrian.internal.config.Config - invoke0: configureProperties: *Starting CADP-JCE Provider* 01-20-2025 15:33:31.983 [main] INFO ingrian.internal.config.Config - invoke0: configureProperties: *****************************
The message
Starting CADP-JCE Provider
in the log indicates that the CADP for Java is up and running and ready to serve requests.Explore the client registration sample (
CADPClientRegistrationSample.java
) available on Github.
Next Topics
Import the following Ingrian packages. These packages are required to perform cryptographic operations.
import com.ingrian.security.nae.*; import java.security.*; import javax.crypto.*;
Download and copy the CADP_for_JAVA.properties file. These properties determine how the CADP for Java Provider communicates with the Key Manager. Refer to Configuration Parameters for details.
Note
You should download the
CADP_for_JAVA.properties
file specific to the CADP for Java version.Add the path of
CADP_for_JAVA.properties
file in the system variable using either of the following options.System.setProperty("com.ingrian.security.nae.CADP_for_JAVA_Properties_Conf_Filename", "Property_File_Path");
System.setProperty("com.ingrian.security.nae.IngrianNAE_Properties_Conf_Filename", "Property_File_Path");
Place the properties file in the location where CADP for Java is deployed.
Explore CADP for Java samples available on Github.