HOW TO: Use a Public/Private Keyserver with PGP Command Line

book

Article ID: 180119

calendar_today

Updated On:

Products

PGP Command Line

Issue/Introduction

 

Resolution


This article describes how to search and send your public key to a public/private keyserver with PGP Command Line. This applies to PGP Command Line 8.x/9.x users running on Windows NT4/2000/XP Linux, and Unix platforms.


To post a key to a keyserver you will need to have information about the key in order to identify it, which will be referred to in this document as (input). You can use the key ID (i.e. 0x12345678), the user ID (i.e. "Joe User"), or a portion of the user ID, (i.e. Joe). You will also need to identify the address of the keyserver, which will be referred to in this document at (ks).

 

Note: If you wish, you may specify a default keyserver within the command line configuration file. If a default keyserver is specified, the keyserver will not need to be typed in each time you wish to search, or upload to, the keyserver.


 

Display Your Keys 

To display your keys from the command prompt, enter:

 

pgp --list-keys


This will display all the keys on your keyring.

 

Upload A Key To Keyserver 

To upload a key to a keyserver:

 

  1. Open a command shell or DOS prompt.
  2. On the command line, enter:

    pgp --keyserver-send (input) --keyserver (ks)
    


    Note: Any information that contains spaces must be contained inside quotes.
  3. Press "Enter".

PGP responds by posting the public key(s) to the specified keyserver.

Example 1 The following example will show you how to upload a key to the public keyserver using your key ID.

 

  • From the command line, enter:

    pgp --keyserver-send 0x12345678 --keyserver ldap://keyserver.pgp.com
    

     
  • Press "Enter".


Example 2 The following example will show you how to upload a key to a private keyserver using your user ID.

 

  • From the command line, enter:

    pgp --keyserver-send "Joe User" --keyserver ldap://keyserver.acmecorp.net
    

     
  • Press "Enter".


Example 3 The following example will show you how to upload a key to the public keyserver using a portion of your user ID. NOTE: When using a portion of the user ID, any key which matches the string will be uploaded. For example, the string joe could match and upload several keys (i.e. joey, joel, billy j).

 

  • From the command line, enter:

    pgp --keyserver-send Joe --keyserver ldap://keyserver.pgp.com
    

     
  • Press "Enter".


When the Key has been successfully uploaded, you will see the following: 0x12345678:keyserver sent {0:key uploaded to ldap://keyserver.pgp.com}

 

Search Keyserver 

Now that you have uploaded your key, it may be worthwhile to check to be certain it is on the public keyserver. You may also use the instructions below to search for other user's public keys and import them to your local keyring. You can locate a public key on a private (internal) keyserver or public (external) keyserver; the procedure is the same in both cases. To find a key on a keyserver you will need to have information about the key in order to identify it, which will be referred to again as (input). You can search by the key ID, user ID, or a portion of the user ID, as described earlier in this document. You will also need to identify the address of the keyserver, which will again be referred to as (ks). NOTE: When using a portion of the user ID, your search may result in finding multiple keys; therefore, it is important the you match the correct key ID with the owner of the key. Search For The Key To search a keyserver for a key, do the following:

 

  1. Open a command shell or DOS prompt.
  2. From the command line, enter:

    pgp --keyserver-search (input) --keyserver (ks)
    

    As always, any information that contains spaces must be contained inside quotes.
  3. Press "Enter".

PGP responds by listing the key or keys that match the search criteria you specified in the following format: Alg-----Type-----Size/Type------Flags-----Key ID----------User ID RSA----pub------2048/1024-----[-----]-----0X12345678---Joe User {[email protected]} Example 1 The following example will show you how to search for a key on the public keyserver using the key ID.

 

  • From the command line, enter:

    pgp --keyserver-search 0x12345678 --keyserver ldap://keyserver.pgp.com
    

     
  • Press "Enter".



Example 2 The following example will show you how to search for a key on a private keyserver using the user ID.

 

  • From the command line, enter:

    pgp --keyserver-search "Joe User" --keyserver ldap://keyserver.acmecorp.net
    

     
  • Press "Enter".



Example 3 The following example will show you how to search for a key on a public keyserver using a portion of the user ID.

 

  • From the command line, enter:

    pgp --keyserver-search Joe --keyserver ldap://keyserver.pgp.com
    

     
  • Press "Enter".