Skip to main content
This section describes how to install and configure jPOS Template to work with the Futurex Excrypt HSM. Before starting this section, download jPOS Template from the GitHub repository.
1
Within a jPOS project, add a reference to the Excrypt JAR.
None
2
Run gradle installResources to add the following QBean configuration samples to the project:
None
3
Change the configuration values in 20_excrypt.xml as needed.

Excrypt Adapter

The ExcryptAdapter class encapsulates all the Excrypt command set implementation. It implements the SMAdapter interface so it can be configured and deployed as any other jPOS SMAdapter implementation. Example (20_excrypt.xml):
Xml

Configuration

PropertyDescription
hostExcrypt host (for example, hsm.example.com)
portExcrypt port (i.e. 6000)
pkcs12Path to the PKCS #12 file (i.e. cfg/certificate.p12)
passphrasePassphrase for the PKCS #12 file

Accessing the adapter

The Excrypt adapter instance can be pulled off the name registrar by doing the following:
Java
By doing the latter, the code produced will not have a direct dependency to the Excrypt implementation and will, potentially, work with any other underlying SMAdapter implementation (i.e. JCESecurityModule).

Environment provider

The Excrypt library provides a custom environment provider that helps secure configuration values.

Example

In cfg/default.yml:
YAML
When loading up the example.config value, the system will decrypt value on the fly using the HSM. The encrypted value is calculated using the ENCRYPT CLI command (see Validate and test) If you would like to make the configuration values more secure, you can store the values in cfg/default.yml:
YAML
Note that sensitive configuration values have been obfuscated using jPOS’ obf CLI command. This practice is recommended and will help avoid leaking configuration values to occasional viewers. For more information on the configuration sub-system and the obf environment provider, see the jPOS Programmer’s Guide, section 3.3.
Then you can modify the values in 20_excrypt.yml:
Xml