All Products
Search
Document Center

Cloud Hardware Security Module (HSM):Install the JCE provider

Last Updated:Dec 05, 2023

This topic describes how to install the Java Cryptographic Extension (JCE) provider.

Prerequisites

Procedure

  1. Download and install the JCE provider.

    Operating system

    Description

    CentOS 8

    1. Download the installation package of the JCE provider.

    2. Run the following command to install the JCE provider:

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

  2. Check whether the JCE provider is installed.

    If all the following files can be found, the JCE provider is installed:

    • /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/java/log4j-api-2.17.0.jar

    • /opt/hsm/java/log4j-core-2.17.0.jar

    • /opt/hsm/lib/libcaviumjca.so

Verify the installation

  1. Configure environment variables in applications as a crypto user (CU).

    Note

    Replace user name and password with the username and password of the CU.

    export LD_LIBRARY_PATH=/opt/hsm/lib
    export HSM_PARTITION=PARTITION_1
    export HSM_USER=user name
    export HSM_PASSWORD=password
  2. Verify the basic features of the JCE provider.

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

    Expected output:

    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)