Skip to Content
Linux Security Cookbook
book

Linux Security Cookbook

by Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes
June 2003
Intermediate to advanced
336 pages
8h 54m
English
O'Reilly Media, Inc.
Content preview from Linux Security Cookbook

7.7. Listing Your Keyring

Problem

You want to view the keys on your keyring.

Solution

To list your secret keys:

$ gpg --list-secret-keys

To list your public keys:

$ gpg --list-public-keys

Discussion

Here’s a sample listing of a key on a keyring:

pub  1024D/83FA91C6 2000-07-21 Shawn Smith <smith@example.com>

It lists the following information:

  • Whether the key is secret (sec) or public (pub).[2]

  • The number of bits in the key (1024)

  • The encryption algorithm (D means DSA)

  • The key ID (83FA91C6)

  • The key creation date (2000-07-21)

  • The user ID (Shawn Smith <smith@example.com>)

See Also

gpg(1).

[2] Actually, the key types are secret master signing key (sec), secret subordinate key (ssb), public master signing key (pub), and public subordinate key (sub). Subordinate keys are beyond the scope of this book and you might never need them. Just remember “sec” for secret and “pub” for public.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Command Line

Mastering Linux Command Line

Coding Gears | Train Your Brain

Publisher Resources

ISBN: 0596003919Errata Page