> ## 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.

# Edit the Futurex PKCS #11 configuration file

> Instructions for editing the fxpkcs11.cfg file to configure KMES connection details.

The Futurex PKCS #11 library uses the Futurex PKCS #11 configuration file, `fxpkcs11.cfg`, to connect to the KMES Series 3. It enables you to modify certain configurations and set connection details. This section covers the `<KMS>` portion of the **FXPKCS11** configuration file, where you configure the connection details.

> [!NOTE]
>
> By default, the FXPKCS11 library looks for the configuration file in `C:\Program Files\Futurex\fxpkcs11\fxpkcs11.cfg` for Windows and `/etc/fxpkcs11.cfg` for Linux. Alternatively, you can set the FXPKCS11\_CFG environment variable to the location of the `fxpkcs11.cfg` file.

Open the `fxpkcs11.cfg` file in a text editor as an administrator and edit it accordingly.

```none expandable lines wrap title="None" theme={null}
<KMS>
    # Which PKCS11 slot
    <SLOT>                  0                       </SLOT>
    <LABEL>                 Futurex                 </LABEL>

    # Login username
    <CRYPTO-OPR>            [identity_name]         </CRYPTO-OPR>

    # Key group name 
    <KEYGROUP-NAME>          keygroup1              </KEYGROUP-NAME>
    
    # Asymmetric key group name
    <ASYM-KEYGROUP-NAME>     asymkeygroup1          </ASYM-KEYGROUP-NAME>
    
    # Connection information
    <ADDRESS>               [kmes_ip_address]        </ADDRESS>
    <PROD-PORT>             9100                    </PROD-PORT>
    <PROD-TLS-ENABLED>      YES                     </PROD-TLS-ENABLED>
    <PROD-TLS-ANONYMOUS>    NO                      </PROD-TLS-ANONYMOUS>
#    <PROD-TLS-CA>           /home/user/tls/root.pem        </PROD-TLS-CA>
#    <PROD-TLS-CA>           /home/user/tls/sub1.pem     </PROD-TLS-CA>
#    <PROD-TLS-CA>           /home/user/tls/sub2.pem     </PROD-TLS-CA>
    <PROD-TLS-KEY>          /home/user/tls/PKI.p12       </PROD-TLS-KEY>
    <PROD-TLS-KEY-PASS>     safest                  </PROD-TLS-KEY-PASS>

    # YES = This is communicating through a Guardian
    <FX-LOAD-BALANCE>       NO                      </FX-LOAD-BALANCE>
</KMS>
```

<table>
  <thead>
    <tr>
      <th>***Field***</th>
      <th>***Description***</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`<SLOT>`</td>
      <td>Leave it set to the default value of **0**.</td>
    </tr>

    <tr>
      <td>`<LABEL>`</td>
      <td>Leave it set to the default value of **Futurex**.</td>
    </tr>

    <tr>
      <td>`<CRYPTO-OPR>`</td>
      <td>Specify the name of the** identity** created for the application partition.</td>
    </tr>

    <tr>
      <td>`<ADDRESS>`</td>
      <td>Specify the **IP address** of the HSM to which the PKCS #11 library should connect.</td>
    </tr>

    <tr>
      <td>`<PROD-PORT>`</td>
      <td>Set the port number of the HSM to which the **FXPKCS11** library should connect.</td>
    </tr>

    <tr>
      <td>`<PROD-TLS-ENABLED>`</td>
      <td>Set the field to **YES**. </td>
    </tr>

    <tr>
      <td>`<PROD-TLS-ANONYMOUS>`</td>
      <td>Defines whether the** FXPKCS11** library authenticates to the server.</td>
    </tr>

    <tr>
      <td>`<PROD-TLS-KEY>`</td>
      <td>Set the location of the client private key. We support the following formats for the TLS private key:<ul><li> **PKCS #1** clear private keys</li><li>**PKCS #8** encrypted private keys</li><li>a **PKCS #12** file that contains the private key and certificates encrypted under a password.</li></ul>\[!NOTE] Because the `<PROD-TLS-KEY>` field in this example defines a PKCS #12 file, you do not need to define the signed client cert with the `<PROD-TLS-CERT>` tag, nor the CA certificates with one or more instances of the `<PROD-TLS-CA>` tag.\\</td>
    </tr>

    <tr>
      <td>`<PROD-TLS-KEY-PASS>`</td>
      <td>Set the password of the PKCS #12 file, if necessary.</td>
    </tr>

    <tr>
      <td>`<FX-LOAD-BALANCE>`</td>
      <td>If you use a Guardian to manage HSM devices in a cluster, set this field to **YES**. \
      If you don't use a Guardian, set it to **NO**</td>
    </tr>
  </tbody>
</table>

After you finish editing the `fxpkcs11.cfg` file, run the `PKCS11Manager` file to test the connection against the KMES, and check the `fxpkcs11.log` for errors and information. For more information, see the Futurex PKCS #11 technical reference found on the Futurex Portal.

## Special defines required for the CyberArk TPF Integration

For the CyberArk TPF integration, add the following defines to the `<CONFIG>` section of the **FXPKCS11** configuration file:

```none expandable lines wrap title="None" theme={null}
# Override all key usage requests with specific values
<FORCED-SYMMETRIC-USAGE>   ENCRYPT | DECRYPT   </FORCED-SYMMETRIC-USAGE>
<FORCED-ASYMMETRIC-USAGE>  SIGN | VERIFY       </FORCED-ASYMMETRIC-USAGE>
	
# Specific for Venafi integration
<VENAFI-COMPAT>             YES                  </VENAFI-COMPAT>
<VENAFI-CONNECT-PING>       NO                  </VENAFI-CONNECT-PING>

# Which commands in the GPKW family are used?
<WRAP-PRESERVE-USAGE>       NO                 </WRAP-PRESERVE-USAGE>

# Generate keys with login requirement even if the application does not explicitly mark them as "private"
<KEY-REQUIRE-LOGIN>         NO                 </KEY-REQUIRE-LOGIN>
```
