1

Can you please give a example of usage of the option --locate-key of gpg (other than displaying a key in a local keyring)?

2

The manual page explains the usage rather clearly:

--locate-keys
    Locate the keys given as arguments.  This command  basically  uses  the  same
    algorithm  as  used when locating keys for encryption or signing and may thus
    be used to see what keys gpg might use.  In particular  external  methods  as
    defined  by  --auto-key-locate may be used to locate a key.  Only public keys
    are listed.

With other words, --locate-keys can be used to test what key would be used for a given identifier. Unlike --list-keys, it only lists non-revoked and unexpired keys: all those are keys that GnuPG would consider for example when encrypting messages. Consider it as --list-keys with key lookup semantics of --recipient when used with --encrypt.

This pretty much resembles "displaying a key in a local keyring", but with some additional restrictions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.