This section provides instructions on testing OpenSSL Engine and some sample commands.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.
Test your conguration
Perform the following tasks to test the OpenSSL Engine:- Set the FXPKCS11 environment variables.
- Create a key pair on the CryptoHub by using pkcs11-tool.
Set environment variables
In a terminal, run the following commands to set the required FXPKCS11 environment variables:Text
Create a key pair
Perform the following steps to create a key pair on the CryptoHub by using pkcs11-tool: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:The command created one private RSA 2048 key with asymmetric sign and verify usage and one public RSA 2048 key with verify usage. The test OpenSSL commands in the next section use these keys.
None
OpenSSL example commands
This section provides several OpenSSL example commands, most of which use the keys created on the CryptoHub in the previous section. You must specify the PKCS11 OpenSSL engine in the commands that use keys created in CryptoHub.The purpose of this section is not to provide an exhaustive list of OpenSSL commands for the PKCS11 OpenSSL Engine but to give a few examples of use cases and confirm that everything is configured correctly. See the OpenSSL documentation for the full list of compatible commands.
Example: Output the public key
Perform the following step to output the public key from the CryptoHub:Example: Encrypt and decrypt data
Perform the following steps to encrypt data with the public key and decrypt it with the CryptoHub-stored private key:In a terminal, run the following command to generate a file called
clear_data containing random ASCII data:Text
Encrypt the
clear_data file by using the public key retrieved from CryptoHub and output the results to a file called encrypted_data.Text
Decrypt the
encrypted_data file by using the CryptoHub-stored private key and output the results to a file called clear_data2.Text
Example: Sign a data file
Perform the following steps to sign a data file using the CryptoHub-stored private key and verify the signature using the public key:Sign the
clear_data file by using the CryptoHub-stored private key and output the signature to a file called clear_data.sig.Text
Example: Create a CA
Run the following command to create a Self-Signed Root Certificate Authority (CA) certificate with the CryptoHub-stored private key:Text
After you enter all fields, it outputs the result to a file called
ssl-ca-cert.pem.Example: Generate a CSR
Run the following command to generate a Certificate Signing Request (CSR) with the CryptoHub-stored private key:Text
After you enter all fields, the CSR outputs to a file called
ssl-client-cert-req.pem.Example: Sign a CSR
Run the following command to sign a CSR by using the CryptoHub-stored private key:Text
The signed certificate outputs to a file called
signed-client-cert.pem.
