Detection of sign-only vs. sign-and-encrypt keys

Stoyan Dimitrov stoyan at
Tue Jun 22 20:53:49 CEST 2004

when you type:
gpg --list-keys
look in the input after the type of the key (pub|sup) is the length of 
the key folowed by a single letter (for example '1024g') this letter 
tells you what is the what kind exactly is the key.
read this:

Atom 'Smasher' wrote:

> On Tue, 22 Jun 2004, Marcus Frings wrote:
>>> could anyone please point me to the right section in the man page
>>> (which I'm obviously missing) how I can find out with a single gpg
>>> command line option if a key is just a sign-only key or a "normal"
>>> sign-and-encrypt key?
> =============================
> i'm not sure if there's a command to tell you that, as such.
> one way to do it is this:
>   $ echo test | gpg --trust-model always -er 0xD9F57808 2> /dev/null > 
> /dev/null ; echo $?
> if it says "0" the key can be used for encryption. anything else means 
> the key can't be used for encryption... maybe because there's no 
> encryption key, maybe because it's expired, revoked, not found ...
>     ...atom
>  _________________________________________
>  PGP key -
>  762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
>  -------------------------------------------------
>     To become vegetarian is to step into the stream
>     which leads to nirvana.
>         -- Buddha

Gnupg-users mailing list
Gnupg-users at

Best Regards,
Stoyan Dimitrov

More information about the Gnupg-users mailing list