Skip to main content
The CryptoHub-backed PKCS#11 module reads its settings from a single JSON file, cryptohub.json. This file tells the module which CryptoHub service to target, how to connect and authenticate, how to handle TLS, how to log, and how to apply key usage policy. This page describes the configuration file’s discovery order, variable substitution, and every field the module reads.
The endpoint download you generate during Installation ships a pre-filled cryptohub.json for your endpoint, already carrying the connection, authentication, and TLS settings for your instance. Start from that file. Use this page as the reference when you edit the file by hand or need to understand a specific field.
This page covers the CryptoHub-backed PKCS#11 module (libcryptohub-pkcs11.*), which reads cryptohub.json. It is separate from the legacy Futurex PKCS#11 module (fxpkcs11), which uses the XML-based fxpkcs11.cfg file. The two modules do not share configuration. For an introduction to the CryptoHub-backed module, see the Overview.

Configuration file location

The module locates its configuration file by checking the following sources in order and using the first one it finds:
  1. The path in the CHLIBS_CONFIG environment variable.
  2. cryptohub.json in the current working directory.
  3. ../config/cryptohub.json relative to the current working directory.
  4. A platform-specific static path.
On Windows, the module checks these static paths in order:
  • C:\Program Files\Futurex\cryptohub.json
  • C:\Program Files\Futurex\config\cryptohub.json
  • C:\Futurex\cryptohub.json
  • C:\Futurex\config\cryptohub.json
On POSIX systems, the module checks this static path:
  • /etc/cryptohub.json
The runtime configuration file must be named cryptohub.json unless you point to it explicitly with the CHLIBS_CONFIG environment variable. When you set CHLIBS_CONFIG, the file can have any name.

Variable substitution

You can use variable substitution in any string field. The module expands the following tokens when it reads the file: Futurex recommends that you keep secrets such as API keys and passwords out of the file itself and supply them through environment variables with ${env:...}.

Root fields

The configuration file has the following root fields:
  • logging — Log verbosity, destinations, and file rotation.
  • global — The CryptoHub service to target, key protection, request behavior, and object identity.
  • cryptohubs — An array of CryptoHub destinations for load balancing and failover.
  • proxy — An optional HTTP proxy for all CryptoHub requests.
  • authentication — Credentials the module presents to CryptoHub destinations.
  • cluster_authentication — Credentials for the backend balancing cluster.
  • pkcs11 — PKCS#11 module behavior and key usage policy.
A cng block also exists. It is read by the Windows CNG Key Storage Provider, which shares this same cryptohub.json file. See the CryptoHub CNG developer guide for the cng block.

Logging

The logging block controls log verbosity, destinations, and file rotation. The file.timezone value determines how the module renders log timestamps:

Global settings

The global block defines the CryptoHub service to target, key protection, request behavior, and how the module derives object identities. The key_protection value determines how CryptoHub protects the keys the module uses: The cert_id_mode value controls how the module derives CKA_ID for certificate and private-key objects:

CryptoHub destinations

The cryptohubs block is an array of CryptoHub destinations. The module uses the array for load balancing and failover across destinations. The role value determines when the module uses a destination: The tls sub-object configures transport security for the destination:

Proxy

Authentication

The authentication block defines the credentials the module presents to CryptoHub destinations. It applies globally to all destinations, and it is optional when you use client TLS or mutual TLS.

Cluster authentication

The cluster_authentication block defines the credentials for the backend balancing cluster. It is optional and uses the same shape as the authentication block. If you use the anchor HSM cluster, the module uses your authentication credentials by default. If you use a non-anchor HSM cluster, the module uses the system users by default.

PKCS#11 module settings

The pkcs11 block controls PKCS#11 module behavior and key usage policy. The default_usages sub-object sets the allowed usages when a template passes no usage flags: The forced_usages sub-object sets usages the module always applies, regardless of the template’s usage flags:

Key usage policy and precedence

The module resolves key usage from three sources, in the following order of precedence:
  1. forced_usages — Always applied, and evaluated before by_label and default_usages.
  2. by_label — Applied when a matching label is found and no forced usage is configured.
  3. default_usages — Applied when a template passes no usage flags.
Usage configuration applies only to symmetric keys (AES and DES) and asymmetric keys (RSA and ECC).

Example configuration

The following minimal configuration targets a single CryptoHub service, validates the server’s TLS certificate against a system CA bundle, authenticates with an API key supplied through an environment variable, and sets default key usages.
In this example, the api_key is read from the CHLIBS_API_KEY environment variable through ${env:...}. Futurex recommends that you supply secrets such as API keys and passwords through environment variables rather than hard-coding them in the file.