Skip to content

Import & Export Key Pair

GpgFrontend gives you several ways to import keys (bring them in) and export keys (save or share them). You’ll usually do this for two reasons: to share your public key with someone, or to back up your own keys. This page covers each method.

You can import a public or private key in a few ways. Find them on the toolbar, or open the action menu in the key management section for more options.

Choose a public or private key file to import. The file can be text with any extension.

Paste the contents of a key into a blank editor page. GpgFrontend recognizes the key and imports it for you.

Copy a key’s contents to your system clipboard, then choose this option to import it.

Search a key server and import public keys from it. Enter the email or ID you are looking for, pick a key server, and click search. GpgFrontend shows the matching public keys. You can import several at once, or double-click one row to import just that key. This method imports public keys only.

For the full steps, see Key Server Operations.

Drag a key file straight onto the Key Toolbox, then follow the prompts to import it.

Exporting saves a key so you can back it up or share it. GpgFrontend always exports in ASCII text, so the file works across different computers.

You can export your public key (safe to share) or your private key (keep this secret). The export options work much like the import ones.

Your public key is safe to give to anyone. There are a few ways to export it.

Right-click the key in the Manage Keys window and choose Export Public Key…. Pick where to save it, and you are done. New in v2.2.2.

If you only want to paste it somewhere rather than save a file, use Copy Public Key Block in the same menu. See Manage Your Keys.

Right-click a key in the Key Toolbox and choose Append Select Key(s) to Editor. This adds the public key to the end of the editor page, where you can copy it wherever you need.

Use the key pair’s Operations tab to save the public key to a file, as shown below. Pick a folder for the file first.

To export the public keys of several key pairs together, select them in the key management view and click Export to Clipboard. This copies the data to your clipboard, ready to paste into any app or file.

Export As OpenSSH saves a single key in the format an SSH server expects, so you can use an OpenPGP key to log in to a machine. You need a key that can do Authentication (the A flag).

The quickest way is to right-click the key in the Manage Keys window and choose Export Private Key…. New in v2.2.2.

You can also find private key options on the detail page of a key that holds a private part (the primary key or a subkey). Pick a destination, and GpgFrontend exports the private key there.

Exporting a private key also includes the matching public key, because a private key is meaningless on its own. So the two are bundled together in the export.

You can export your private key in two ways:

  1. Full export: includes all key data, plus the user IDs and their signatures.
  2. Minimal export: includes only the key data, without the extra user ID signatures.

Exporting keys one at a time is fine for sharing, but a poor way to make a backup. It is too easy to miss one.

Since v2.2.2 you can save them all in one go. In the Manage Keys window, open the Bulk menu and choose Back Up All Private Keys…. That writes every private key in the keyring into a single protected file.