Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How to list recipients of a public key - GPG

Posted on 2011-10-14
Medium Priority
Last Modified: 2013-11-15
Can someone tell me how to display the valid recipients of a public key using GPG?

I am currently running this command :

gpg --list-keys

The problem is that it seems to work on one machine, but not on the machine I need it to work on.  I want to see the email address, but it is not being displayed.
Question by:jbaird123
  • 3
  • 2
LVL 33

Expert Comment

ID: 36971403
"gpg --list-keys" would list out the keys known in that host's database.       Just because 1 machine can list the keys correctly, doesn't mean that the 2nd machine has come across the same public keys yet.  

You would need to search the gpg key directory to add them or add them any other way before they would be listed using that command.

With the GnuPG system comes a file that acts as some kind of database. In this file all data regarding keys with the information that comes with the keys is stored (everything until the Ownertrust values: for more information on that read Key signing). With

    gpg --list-keys

all present keys will be displayed

Author Comment

ID: 36979364
MikeKane :

The keys i need are being listed, but the recipient is not being displayed.  I don't know how to figure out the recipient associated with the key.  

LVL 33

Expert Comment

ID: 36988732
How about this:
gpg --list-keys --with-fingerprint --with-colons --fixed-list-mode

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 36988868

It looks like I may not have asked the correct question.  After further investigation, it looks like the recipient is being displayed, but not the email address.  Example:

pub   1024D/E0104178 2011-08-09
uid                  John Smith (Test Key - DSA / Elgamal) <johnsmith@gmail.com>
sub   1024g/DDB8A046 2011-08-09

In the example above, the --list-keys command outputs both the recipient name (John Smith) and the email address "johnsmith@gmail.com".

The problem is that when I run this same command on the "other" machine, I will get the name "John Smith", but no email address.  I am really interested in getting the email but cannot figure out how to di it.

I ran your code above and it does not list the email address either.  It does show the name though.

Please advise.

LVL 65

Accepted Solution

btan earned 2000 total points
ID: 37080524
Try out --edit -key and adduid, can have multiple email and have one set as primary

Author Closing Comment

ID: 37087850
This seems to work.

Featured Post

Evaluating UTMs? Here's what you need to know!

Evaluating a UTM appliance and vendor can prove to be an overwhelming exercise.  How can you make sure that you're getting the security that your organization needs without breaking the bank? Check out our UTM Buyer's Guide for more information on what you should be looking for!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial, we’re going to learn how to convert Youtube to mp3 for Free. We'll show you how easy it is to make an mp3 from your video clips so that you can enjoy them offline.
There are literally thousands of Exchange recovery applications out there. So how do you end up picking one that’s ideal for your business & purpose? By carefully scouting the product’s features, the benefits it offers you, & reading ample reviews f…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question