ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Import PGP Key into PGP Command Line

book

Article ID: 153678

calendar_today

Updated On:

Products

PGP Command Line

Issue/Introduction


To encrypt data to a specific person, you need to encrypt it with their public key. Prior to encrypting to the public key, the key must be imported to your keyring first. To get a public key onto your keyring, you must either find the public key on a keyserver or receive the public key file from the recipient and then import it onto your keyring.

Resolution


To import a key to your keyring, you use the --import variable. The file containing the key(s) to be imported should be in the current directory, or you must specify the fully qualified path to the file containing the keys. Note that both private and public keys will be imported, if they exist in the file. If a key being imported already exists in the local keyring, the keys are merged.

Usage:

pgp --import <keyname.asc> [options]

The following options are available with the --import variable.

  • --import-format specifies the import format for the current operation. See --import-format for more information.
  • --manual-import-keys changes the behavior of PGP Command Line when keys are found during import operations. The default is all.
  • --manual-import-key-pairs changes the behavior of PGP Command Line when key pairs are found during an import operation.
  • --passphrase is the passphrase of the key being imported.
  • --new-passphrase is the new passphrase of the bundle key being imported.
  • --local-user is the key ID of an existing bundle key.
  • --local mode runs the operation in local mode.
Example

pgp --import "Bob Smith.asc"