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.

  1. Start in one of two places:

    • In the main window, click the Import button in the toolbar, or open Keys > Import Key.
    • In the KeyPair Management window, click the Import Key button in the toolbar, or open Key > Import Key.
  2. Choose where the key comes from. The choices are explained below.

Choose File, then pick a public or private key file. The file can be text with any extension.

This choice is in the main window only.

  1. Paste the key into a text editor tab.
  2. Open Keys > Import Key (or click the Import toolbar button) and choose Editor. GpgFrontend imports the key from the text in that tab.

Copy the key’s text to your clipboard, then choose Clipboard.

This choice is in the KeyPair Management window only. Choose Key Package to import keys from a protected backup file. See KeyPackage.

A key server is a website that stores public keys. Choose Key Server, search for the person, and double-click a result to import that key. This method imports public keys only. For the full steps, see Key Server Operations.

Key Server comes from the KeyServerSync module, which comes with GpgFrontend. If that module is turned off, Key Server is not in the menu. See Module Controller.

Drag a key file onto the Key ToolBox. If GpgFrontend asks whether to import the key, click OK.

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).

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

  1. In the main window, click Manage Keys. The KeyPair Management window opens.
  2. Right-click the key, open Export and choose Export Public Key….
  3. Pick where to save the file.

This menu item is new in v2.2.2.

To paste the key somewhere instead of saving a file, open Copy in the same right-click menu and choose Copy Public Key Block. See Manage Your Keys.

Right-click a key in the Key ToolBox and choose Append Public Key to Editor. This adds the public key to the end of the text in the editor. You can copy it from there.

  1. Open the key’s Key Details window and go to the Operations tab. See Key Pair Details.

  2. Click Export Public Key.

  3. Pick where to save the file.

To export the public keys of several key pairs together:

  1. In the KeyPair Management window, tick the box beside each key.
  2. Open Key > Export Key and choose Export To Clipboard. The Export Key button in the toolbar has the same menu.

The public keys are now on your clipboard. Paste them into any app or file.

If you tick no key, Export To Clipboard uses the rows you selected instead.

SSH is a common way to log in to another computer. Export As OpenSSH saves one key in the format an SSH server expects, so you can log in with your OpenPGP key. You need a key that can do Authentication (it has A in its usage).

In the KeyPair Management window, right-click the key, open Export and choose Export As OpenSSH. It is also under Key > Export Key.

GnuPG only This needs the GnuPG engine. With rPGP the item is hidden.

The quickest way is to right-click the key in the KeyPair Management window, open Export and choose Export Private Key…. This menu item is new in v2.2.2.

You can also export from the key’s Key Details window:

  1. Go to the Operations tab.

  2. Click Export Private Key and pick one of the two choices below.

  3. Choose where to save the file.

An exported private key file also holds the matching public key. A private key is of no use without it.

The Export Private Key button offers two choices:

Export Full Secret Key

Includes all key data, plus the user IDs and their signatures.

Export Shortest Secret Key

Includes only the key data, without the extra user ID signatures.

Exporting keys one at a time is fine for sharing, but it is 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:

  1. In the KeyPair Management window, open Operations > Bulk and choose Back Up All Private Keys…. This puts every private key in the key database into one protected file, called a KeyPackage.
  2. The same three-step window opens as for any KeyPackage, with all private keys already included.