如何使用GnuPG的--locate-key选项?

如何使用GnuPG的--locate-key选项?

--locate-key您能否给出该选项的使用示例gpg(除了在本地密钥环中显示密钥之外)?

答案1

手册页相当清楚地解释了用法:

--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.

换句话说,--locate-keys可用于测试给定标识符将使用什么密钥。与 不同--list-keys,它只列出未撤销和未过期的密钥:所有这些都是 GnuPG 在加密消息时会考虑的密钥。将其视为与 一起使用时--list-keys的关键查找语义。--recipient--encrypt

这非常类似于“在本地密钥环中显示密钥”,但有一些额外的限制。

相关内容