Perform the following tasks to test OpenSSL engine: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.
- Set FXPKCS11 environment variables.
- Explore some OpenSSL Engine examples.
Set FXPKCS11 environment variables
In a terminal, run the following sequence of commands to set the required FXPKCS11 environment variables:Shell
Create a key pair
Perform the following steps to create a key pair on the Vectera Plus by using pkcs11-tool:In a terminal, run the following command to use pkcs11-tool to create a new key pair on the Vectera Plus:
Shell
Enter the password of the identity configured in the
fxpkcs11.cfg file when prompted for the User PIN.If the command succeeds, the keys display in the output, as shown in the following example:The command creates the following keys, which the next section uses in the test OpenSSL commands:
Shell
- A private RSA 2048 key with asymmetric sign and verify usage
- A public RSA 2048 key with verify usage.
OpenSSL example commands
Most of the following OpenSSL example commands use the keys created on the Vectera Plus in the previous section. All the commands that use the keys created on the HSM specify the PKCS11 OpenSSL engine. This section does not provide an exhaustive list of OpenSSL commands that you can run by using the PKCS11 OpenSSL Engine. Instead, it provides a few examples of use cases and confirms that you configured everything correctly. Refer to the OpenSSL documentation (www.openssl.org/docs/) for the full list of compatible commands.Example 1: Output the public key
In a terminal, run the following command to output the public key from the HSM:Shell
If the command succeeds, you should see output similar to the following example:
Shell
Example 2: Encrypt and decrypt data
Perform the following steps to encrypt data with the public key and decrypt with the HSM stored private key:In a terminal, run the following command to generate a file,
clear_data, containing random ASCII data:Shell
Encrypt the
clear_data file by using the public key retrieved from the HSM and output the results to a file, encrypted_data.Shell
Decrypt the
encrypted_data file by using the HSM stored private key and output the results to a file, clear_ data2.Shell
Example 3: Sign a file and verify the signature
Perform the following step to sign a data file using the HSM stored private key and verify the signature by using the public key:Sign the
clear_data file by using the HSM stored private key and output the signature to a file, clear_data.sig.Shell
Example 4: Create a self-signed Root CA
Perform the following steps to create a self-signed Root CA:Example 5: Generate a CSR
Perform the following steps to generate a CSR:Example 6: Sign a CSR
Execute the following command to sign a CSR by using the HSM-stored private key:Shell
The command outputs the signed certificate to the
signed-client-cert.pem file.
