> ## Documentation Index
> Fetch the complete documentation index at: https://docs.futurex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure FxPKCS11 as a pkcs11-provider in OpenSSL

> Configure FxPKCS11 as an OpenSSL pkcs11-provider for HSM-backed cryptographic operations.

This section explains how to configure the **Futurex PKCS #11 library (FxPKCS11)** to serve as a **pkcs11-provider** in OpenSSL.

## Edit the OpenSSL configuration file

Perform the following steps to edit the OpenSSL configuration file:

<Steps>
  <Step>
    Confirm the location of the `pkcs11.so` file on your system by running the following command in a terminal as **root**:

    ```shell expandable lines wrap title="Shell" theme={null}
    find / -name "pkcs11.so"
    ```
  </Step>

  <Step>
    Run the following command to determine the location of the OpenSSL configuration file for the logged-in user:

    ```shell expandable lines wrap title="Shell" theme={null}
    openssl version -d
    ```
  </Step>

  <Step>
    Open a text editor to edit the `openssl.cnf` file identified in the previous command. If you prefer, you can edit the global OpenSSL configuration file, `/etc/ssl/openssl.cnf`.
  </Step>

  <Step>
    Locate these lines:

    ```none expandable lines wrap title="None" theme={null}
    [openssl_init]
    providers = provider_sect

    # List of providers to load
    [provider_sect]
    default = default_sect

    [default_sect]
    # activate = 1
    ```
  </Step>

  <Step>
    Define the location of the `pkcs11.so` and `libfxpkcs11.so` files on your system, similar to what you see below (the actual paths might differ).

    ```none expandable lines wrap title="None" theme={null}
    [openssl_init]
    providers = provider_sect

    # List of providers to load
    [provider_sect]
    default = default_sect
    base = base_sect
    pkcs11 = pkcs11_sect

    [default_sect]
    activate = 1

    [base_sect]
    activate = 1

    [pkcs11_sect]
    module = /usr/lib/x86_64-linux-gnu/ossl-modules/pkcs11.so
    pkcs11-module-path = /usr/local/lib/fxpkcs11/libfxpkcs11.so
    activate = 1
    ```
  </Step>
</Steps>
