Java SDK

The Deep Security Java SDK consists of the Java client library and source (JAR files), and several dependency JAR files. The client library enables you to use Java to interact with the API. If you would rather use the API directly via tools such as Postman and curl, you do not need the SDK.

Get set up to use the Java SDK

The Deep Security API supports Java 1.8 and later versions, such as Oracle Java SE 8 and above.

Download and install the JDK and Deep Security Java SDK

Make sure that you download the SDK that is compatible with your Deep Security Manager.

  1. Install version 1.8 (or later) of the Java Development Kit.
  2. Download the SDK ZIP file and unzip it.

    Download SDK

Trend Micro Deep Security SDKs are distributed under the Apache 2.0 license.

Install a Java IDE

You can use any Java IDE to develop for the Deep Security API. If you need to install one, we recommend using Eclipse. It is free, well-supported, and has a comprehensive feature set.

Windows and Linux

Download and follow the installation instructions for Eclipse.

If you prefer to use video help to set up your Eclipse development environment, the following videos step you through the process of setting up the Eclipse IDE with the Java SDK:

Add the SDK to a Java project in Eclipse

Follow the procedure below to create an Eclipse project that can run the code examples in the Automation Center guides.

  1. Open Eclipse.
  2. Click File > New Java Project, and click Next. Type a name for the project, such as 'Run Deep Security Code Examples', and click Finish.
  3. On the New module-info.java window, click Don't Create.
  4. Right-click the project folder and click Properties.
  5. Click Java Build Path, click the Libraries tab, click Classpath on the build path tree, and then click the External JARs button.
  6. Go to the folder containing the extracted SDK, select the deepsecurity-12.x.xxx.jar file and click Open.
  7. Similarly, add all of the files in the lib sub folder from the SDK.
  8. Click Apply and Close.
  9. Under the project in the Package Explorer, right-click the 'src' folder and click New > Package.
  10. Type a package name (for example, com.trendmicro.deepsecurity.docs) and click Finish.

Add the SDK to your classpath in other IDEs

If you have already setup Eclipse as your IDE in the procedure above, you can skip the following steps.
  1. Add the deepsecurity-12.x.xxx.jar file to the classpath or build path of your Java project.
  2. Add the JAR files in the lib folder to the classpath or build path of your Java project.

Import self-signed certificates

Java prevents clients from making secure connections to untrusted servers. If the Deep Security Manager in your development environment uses the default self-signed certificate for establishing secure HTTP connections, you need to import the certificate to a local truststore. If you do not import the certificate, you cannot connect to the server.

The path of the default truststore of the JDK's JRE is JAVA_HOME/jre/lib/security/cacerts, and the default password is changeit. You can use a different truststore if you like.

  1. Open the Deep Security Manager console in your web browser.
  2. Use the browser to download the site's certificate (see your browser documentation)
    • Chrome: Developer Tools > Security Tab > View Certificate > Details tab > Copy To File.
    • FireFox: Click the lock icon next to the URL > Secure Connection > More Information > View Certificate > Details > Export
    • Safari: Click the lock icon next to the URL > Drag the certificate icon to your desktop.
  3. Use keytool to import the certificate into your truststore (replace the alias and path placeholders with actual values): keytool -import -v -trustcacerts -alias <alias> -file <path to certificate file> -keystore <path to truststore>
  4. If you are not using the default truststore of the JRE, run your programs using the following JVM option (replace the path with the actual value): -Djavax.net.ssl.trustStore=<path to truststore>

Next Steps

  • To get familiar with how to use the SDK with the Deep Security API, see the Send Your First Request Using the API guide.
  • If you are already familiar with using an API or have specific tasks that you want to use the SDK for, see Run the Code Examples to get started with the task-based examples in other Automation Center guides.

You can add the code examples from any of the other Automation Center guides to the project you created above.