Appendix: Migrate a key from software storage to the Vectera Plus
The following appendix shows the necessary steps to migrate a certificate private key, currently stored in software, to a HSM.
You can use the following methods to export a private key from a Windows Certificate Store: Use the MMC Certificates Snap-In or PowerShell commands. Both involve exporting the private key as a PKCS #12 file.
Regardless of which method you choose to export the PKCS #12 file from Windows, you must use FXCLI to import the private key contained within the PKCS #12 file into the HSM.
Before exporting the PKCS #12, mark the private key of the certificate as exportable.
You can export the private key as a PKCS #12 file by using one of the following methods:
- Use the MMC Certificates Snap-In.
- Use Powershell commands.
Select the appropriate method and follow the steps:
In the MMC Certificates snap-in, right-click the certificate that you want to export and select All Tasks > Export to start the Certificate Export Wizard.
In the first dialog, select [ Next ] to continue.
Select the Yes, export the private key radio button, and select [ Next ].
Select the Personal Information Exchange - PKCS #12 (.PFX) radio button (selected by default), and select the Delete the private key if the export is successful option checkbox. Then, select [ Next ].
Select the Password checkbox and enter a password. This protects the private key in the PKCS #12 file. Select [ Next ].
Select [ Browse ], enter a name for the export file, select the save location, and select [ Next ].
Use either a .p12 or .pfx extension for the file.
Review the summary of the selected options and select [ Finish ].
A notification window pops up stating that the export was successful.
Run the FXCLI application.
Configure TLS certificates for communication between FXCLI and the HSM by using the tls commands.
Run tls help to access syntax documentation.
Run the following command to connect to the HSM:
Log in to the HSM with the default Admin1 and Admin2 identities by running the following command twice, entering the username and password when prompted:
Run the following command to import the PKCS #12 file, modifying the file path to match the actual location of the PKCS #12 file that you exported from Windows:
When prompted, enter the password of the PKCS #12 file.
The preceding command imports only the private key contained within the PKCS #12 file into the HSM. It does not import the certificate.
Confirm the key slot of the imported private key:
Because certutil needs you to set an external label so it can find the key, run the following command to assign a PKCS11 label to the key:
The PKCS11 label value should match the value that you set in the --label field while importing the PKCS #12 file.
Double-click the certificate in the MMC Certificates snap-in, go to the Details tab, and note down the listed serial number value.
Open Windows PowerShell or Command Prompt as an administrator.
Run the following command to associate the certificate with its corresponding private key stored on the HSM, substituting serial_number placeholder with the actual serial number value of the certificate:
If the command succeeds, the following message displays:
To confirm that the certificate is now associated with its corresponding private key on the HSM, double-click the certificate in the MMC Certificates snap-in.
You should see the following message: You have a private key that corresponds to this certificate.