Before exporting the PKCS #12, mark the private key of the certificate as exportable.
Export the private key
You can export the private key from the Windows Certificate Store as a PKCS #12 file by using one of the following methods:- Use the MMC Certificates Snap-In.
- Use PowerShell commands.
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.
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.Run the following command to determine the Thumbprint of the certificate or private key you want to export:
Powershell
The My directory in the file path represents the Personal certificate store.
Run the following command to save a password string into the $mypwd variable. This is the password for the PKCS #12 file.
Powershell
Use the following command to export the PKCS #12 file, substituting Thumbprint with the actual thumbprint value of the certificate that you want to export in the
-Path flag.:Powershell
PowerShell does not provide an option in the Export-PfxCertificate command to delete the private key after successfully exporting the PKCS #12 file. To delete the private key, you must use the Remove-Item PowerShell command. This command also deletes the certificate, so you must reimport the certificate afterward.First, run the following commands to export the certificate so that you can reimport it:Then run the following command to delete the certificate and its private key:
Powershell
Powershell
Import the PKCS #12 file
Perform the following steps to import the PKCS #12 file into the Vectera Plus using FXCLI:Configure TLS certificates for communication between FXCLI and the HSM by using the tls commands.
Run tls help to access syntax documentation.
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:
FXCLI
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.
FXCLI
The preceding command imports only the private key contained within the PKCS #12 file into the HSM. It does not import the certificate.
Reassociate the certificate
Perform the following steps to reassociate the certificate stored in Windows with the private key stored on the HSM:Double-click the certificate in the MMC Certificates snap-in, go to the Details tab, and note down the listed serial number value.
Run the following command to associate the certificate with its corresponding private key stored on the HSM, substituting the serial_number placeholder with the actual serial number value of the certificate:
Powershell
If the command succeeds, the following message displays:
Powershell

