1. Home
  2. Troubleshooting
  3. Importing OpenPGP Public Key results in error “no public keys to import”

Importing OpenPGP Public Key results in error “no public keys to import”


   When attempting to import an OpenPGP public key from a file, the Diplomat MFT Client fails with the error message "File <x> has no public keys to import."   But when opening the OpenPGP public key in a text editor, it looks normal.


   The text file might be encoded in a format that includes extra bytes at the beginning of the file.  Specifically, it might contain a "Byte Order Mark" (or "BOM") which is used to describe the encoding.  Most of the time, though, text files can just be saved as ANSI or UTF-8 without any byte order marks, and things work just fine.
   In the case of importing OpenPGP keys, the BOM was causing the failure


  You need to remove the BOM from the beginning of the key file.  To remove the marker, use a Text Editor of your choice to open the file and save it without the BOM.  Once you follow the steps below to remove the BOM, you can go back to Diplomat MFT and import the key successfully.

   Open the file in Notepad and then choose "File > Save As…"  At the bottom of the Save As window, you will see an option for "Encoding," which is set to "UTF-8 with BOM".  Change this value to "UTF-8", and save the file.
   Open the file in Notepad++ and choose the "Encoding" menu option, then select "Encode in UTF-8" rather than what it had when you opened it (which is "Encode in UTF-8-BOM").  Once you have chosen UTF-8 without BOM, save that file.


Updated on December 3, 2019

Was this article helpful?

Related Articles