All Products
Search
Document Center

Install the JCE Provider

Last Updated: Apr 08, 2021

This topic describes how to install the JCE Provider.

Prerequisites

Before you start using JCE Provider, make sure the following requirements are met:

  • The HSM must be in an initialized state and have a Crypto User (CU). For information about how to initialize HSM, see Quick start.

  • JDK version 1.8

Procedure

  1. Run the following commands to download and install the JCE Provider.

    OS

    Commands

    CentOS8

    Download the following RPM package: hsm-client-jce-v2.03.15.10-1.el8.x86_64.rpm

    sudo rpm -ivh ./hsm-client-jce-v2.03.15.10-1.el8.x86_64.rpm

  2. After you install JCE Provider, check that you can find the following JCE Provider files:

    • /opt/hsm/java/caviumjca-1.0.0-jar-with-dependencies.jar

    • /opt/hsm/java/hamcrest-core-1.3.jar

    • /opt/hsm/java/junit-4.12.jar

    • /opt/hsm/java/hsm-test-1.0.0.jar

    • /opt/hsm/lib/libcaviumjca.so

Validate the installation

  1. Run the following commands to set the necessary environment variables. Replace user name and password with the credentials of a cryptouser (CU).

    export LD_LIBRARY_PATH=/opt/hsm/lib
    export HSM_PARTITION=PARTITION_1
    export HSM_USER=user name
    export HSM_PASSWORD=password
    
  2. Run the following command to run the basic functionality test. If successful, the command's output should be similar to the one that follows.

    java -classpath "/opt/hsm/java/*" org.junit.runner.JUnitCore TestBasicFunctionality

    If the operation is successful, the response is similar to the following:

    JUnit version 4.12
    .2021-03-12 13:56:40,527 DEBUG [main] TestBasicFunctionality (TestBasicFunctionality.java:33) - Adding provider.
    2021-03-12 13:56:40,721 DEBUG [main] TestBasicFunctionality (TestBasicFunctionality.java:42) - Logging in.
    2021-03-12 13:56:40,721 INFO  [main] cfm2.LoginManager (LoginManager.java:244) - Looking for credentials in HsmCredentials.properties
    2021-03-12 13:56:40,722 INFO  [main] cfm2.LoginManager (LoginManager.java:262) - Looking for credentials in System.properties
    2021-03-12 13:56:40,722 INFO  [main] cfm2.LoginManager (LoginManager.java:270) - Looking for credentials in System.env
    2021-03-12 13:56:40,750 DEBUG [main] TestBasicFunctionality (TestBasicFunctionality.java:54) - Generating AES Key with key size 256.
    2021-03-12 13:56:40,765 DEBUG [main] TestBasicFunctionality (TestBasicFunctionality.java:63) - Encrypting with AES Key.
    2021-03-12 13:56:40,813 DEBUG [main] TestBasicFunctionality (TestBasicFunctionality.java:84) - Deleting AES Key.
    2021-03-12 13:56:40,816 DEBUG [main] TestBasicFunctionality (TestBasicFunctionality.java:92) - Logging out.
    
    Time: 0.328
    
    OK (1 test)