--keyringを使用してgpgを介して公開鍵をエクスポートすることはできません。

--keyringを使用してgpgを介して公開鍵をエクスポートすることはできません。

この--keyringオプションを使用すると、以下を使用して公開鍵をエクスポートできませんgpg

$ gpg -vv --armor --keyring pubring.gpg --export
gpg: writing to stdout
gpg: WARNING: nothing exported

ただし、次のような場合に機能します--homedir

$ gpg --armor --homedir . --export 
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.14 (GNU/Linux)
...

その理由は何ですか?解決策はありますか?

ベストアンサー1

gpgのマニュアルページから:

--keyring file
             Add file to the current list of  keyrings.   If  file  begins
             with  a  tilde  and  a slash, these are replaced by the $HOME
             directory. If the filename does not contain a  slash,  it  is
             assumed  to  be  in  the  GnuPG home directory ("~/.gnupg" if
             --homedir or $GNUPGHOME is not used).

指定されたファイル名にはスラッシュが必要です(--keyringその他のオプションも含まれます)。それ以外の場合、gpg は GnuPG ホームディレクトリでスラッシュを探します。--secret-keyring--trustdb-name

以下を使用したいと思います:

gpg -vv --armor --keyring ./pubring.gpg --export

おすすめ記事