[Gpg4win-users-en] Can Anyone Tell Me How to Distinguish Between Keys in a Key Pair After Generation?

Juan Miguel Navarro Martínez juanmi.3000 at gmail.com
Wed Jul 8 20:00:13 CEST 2015


If they are in the keyring: gpg -k|--list-keys for public keys and gpg
-K|--list-secret-keys for secret keys.

If you exported the keys not armored, you can either use gpg <key
file> and it should say either sec and ssb (for secret master key and
subkeys respectively) or pub and sub (for public master key and
subkeys respectively. Like this:

C:\Users\Juanmi>gpg2 public.key
pub  4096R/0x88E2947F9BC6B3CF 2014-11-17 [expires: 2016-11-16]
      Key fingerprint = 5A91 90D4 CF27 9D52 D62A  BC58 88E2 947F 9BC6 B3CF
[...]
sub  2048R/0x42DF3EE44F24807B 2014-11-18 [expires: 2015-11-18]

C:\Users\Juanmi>gpg2 secret.key
sec  4096R/0x88E2947F9BC6B3CF 2014-11-17
      Key fingerprint = 5A91 90D4 CF27 9D52 D62A  BC58 88E2 947F 9BC6 B3CF
[...]
ssb  4096R/0xF48F3C472370A536 2014-11-17
ssb  2048R/0x42DF3EE44F24807B 2014-11-18

Another option is to use:

    (For Mac/Linux) gpg --list-packets [keyfile] | grep secret
    (For Windows) gpg --list-packets [keyfile] | findstr secret

or:
    (For Mac/Linux) gpg --list-packets [keyfile] | grep public
    (For Windows) gpg --list-packets [keyfile] | findstr public

To see if that key file is a public key or a secret key.

PS: You are somehow replying in threads instead of creating new threads.

El 08/07/2015 a las 19:07, L escribió:
> Can anyone tell me how to distinguish between keys in a key pair
> after generation (using command line, in the case)? I understand
> that ascii versions of binary keys have to be forced as a seperate
> operation using the ascii armor command, but initial key generation
> deposits two keys and a revocation cert in a new folder in Gpg, the
> former two indistinguishable upon inspection. How do I tell which
> is private and which public? Have tried checking online, without
> success. Thanks for any info.
> 
>>> Gpg4win-users-en at wald.intevation.org
>>> 
>> https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/gpg4win-users-en
>>
>>
>>
>>
>>
>> 
_______________________________________________
>> Gpg4win-users-en mailing list 
>> Gpg4win-users-en at wald.intevation.org 
>> https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/gpg4win-users-en
>
>> 
> 
> 
> 
> _______________________________________________ Gpg4win-users-en
> mailing list Gpg4win-users-en at wald.intevation.org 
> https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/gpg4win-users-en
>
> 
-- 
Juan Miguel Navarro Martínez

GPG Keyfingerprint:
5A91 90D4 CF27 9D52 D62A
BC58 88E2 947F 9BC6 B3CF

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.wald.intevation.org/pipermail/gpg4win-users-en/attachments/20150708/5960b562/attachment.sig>


More information about the Gpg4win-users-en mailing list