Import Keyfile

GnuPG allows you to import all recognizable keyfile into its keyrings. These files include secret keyfile, public keyfile, signature keyfile, revocation certificate, etc. This section guides you on how to import these files into your local GnuPG.

Using the Import Command

Importing the target file is as simple as using the --import argument. For secret keyfile that is protected with a passphrase, GPG will prompt for passphrase authentications. The command pattern is:

$ gpg --import /path/to/keyfile

Some examples are:

  • gpg --import /path/to/secret-keyfile.asc
  • gpg --import /path/to/public-keyfile.asc
  • gpg --import /path/to/secret-keyfile.gpg
  • gpg --import /path/to/public-keyfile.gpg
  • gpg --import /path/to/revoke-certificate.asc

Managing Your Trust

Depending on what files you're importing, the next thing to do is to manage trust for the imported data. This is very true for secret and public keys that you had just imported. To do that it is outside of this section, please visit the following link based on the keyfile you had just imported.

That's all about importing keyfile in GnuPG.