Converting an Incompatible PKCS#12 Format File to a Compatible PKCS#12

This article discusses how to convert an existing incompatible PKCS#12 format-encrypted private key/public certificate file to a compatible PKCS#12 format file. (To generate a PKCS#12 private key and public certificate file that is suitable for use with HTTPS, FTPS, and the administrative port for Secure FTP Server-FIPS, refer to Generating a PKCS#12 Private Key and Public Certificate.)

General Information

Each of the above combinations uses RSA key exchange; therefore, RSA based key/certificates must be used.

Procedure

These instructions assume you have downloaded and installed the Windows binary distribution of OpenSSL. Refer to Using OpenSSL for the general instructions

The private key you want to convert must already be an RSA private key and be between 1024 and 4096 bits in length, inclusive. It is only possible to convert the storage format for the private key. Changing the type of key and its length is not possible and requires generation of a new private key.

  1. Extract the original private key and public certificate from the incompatible PKCS#12 format file into a traditional encrypted PEM format

  2. C:\Openssl\bin\openssl.exe pkcs12 -in <PKCS#12 Filename> -out <Encrypted PEM Filename>

    Where:

    For example:

    >C:\Openssl\bin\openssl.exe pkcs12 -in my_pkcs12.pfx -out my_encrypted_pem.pem

  3. Generate a compatible PKCS#12 file

  4. >C:\Openssl\bin\openssl.exe pkcs12 -keypbe PBE-SHA1-3DES -certpbe PBE-SHA1-3DES -export -in <Encrypted PEM Filename> -out <PKCS#12 Filename> -name "<Display Name>"

    Where:

    For example:

    >C:\Openssl\bin\openssl.exe pkcs12 -keypbe PBE-SHA1-3DES -certpbe PBE-SHA1-3DES -export -in my_encrypted_pem.pem -out my_new_pkcs12.pfx -name "my-name"

  5. (Optional) Delete unneeded files. At this point, you can delete the temporary unencrypted PEM file.

The resulting PKCS#12 format file may now be used within Secure FTP Server - FIPS.