You are not logged in.

#1 2012-03-20 01:12:26

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

[solved]gpg: listing keys in keyfile before import

Alice runs

gpg --export -a -o pub.asc

to export her public keys to pub.asc.

How can Bob list the keys in pub.asc without importing them?


So far the best solution that I've found is

gpg --list-only --import pub.asc

but that seems kludgy because it's still running through the entire import process. Is there any way to inspect the keyfile directly (and maybe extract a subset of keys from it to another file)?

Last edited by Xyne (2012-03-20 04:10:14)


My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone

Offline

#2 2012-03-20 01:22:32

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: [solved]gpg: listing keys in keyfile before import

Do you have an example file available for testing/playing with?

Offline

#3 2012-03-20 01:33:24

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved]gpg: listing keys in keyfile before import

/dev/zero wrote:

Do you have an example file available for testing/playing with?

http://xyne.archlinux.ca/public_key.asc ?

Offline

#4 2012-03-20 01:50:07

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: [solved]gpg: listing keys in keyfile before import

Xyne, surely you sftwed first? wink This came up pretty quickly:

gpg --with-fingerprint public_key.asc

and so did this:

pgpdump

Offline

#5 2012-03-20 04:09:57

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [solved]gpg: listing keys in keyfile before import

Thanks.

What search terms did you use? I tried several variations of:
gpg list keys in key file (and keyfile)
gpg list before import
gpg inspect key file
gpg examine key file
gpg show me the keyfile's secrets
gpg just list the *%$#%^ keys already
...

Nowhere in the man page do I see anything that indicates that "--with-fingerprint" would accept a file argument.

       --fingerprint
              List all keys (or the specified ones) along with  their  finger‐
              prints.  This  is  the  same  output as --list-keys but with the
              additional output of a line with the fingerprint.  May  also  be
              combined  with  --list-sigs or --check-sigs.  If this command is
              given twice, the fingerprints of all secondary keys  are  listed
              too.
...
       --with-fingerprint
              Same as the command --fingerprint but changes only the format of
              the output and may be used together with another command.

...
EXAMPLES
       gpg --list-keys user_ID
              show keys


       gpg --fingerprint user_ID
              show fingerprint

I had tried "gpg --list-keys <file>" but that doesn't work, so I had no reason to think that --with-fingerprint  would work, as it is really just a modified version of "--list-keys".

Last edited by Xyne (2012-03-20 04:10:53)


My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone

Offline

#6 2012-03-20 05:42:01

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: [solved]gpg: listing keys in keyfile before import

Xyne wrote:

What search terms did you use?

Me Googling wrote:

gpg list keys detail "without importing"

Which took me here. The answer is two or three messages into the thread smile.

Offline

#7 2012-03-20 08:30:51

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [solved]gpg: listing keys in keyfile before import

Thanks.

It appears my search-fu is shamefully weak.


My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB