gpgバッチ:空の暗号化ファイルを作成しました。

gpgバッチ:空の暗号化ファイルを作成しました。

gpgキーを生成するには、次のコマンドを使用しています。

#!/bin/bash

cat > /tmp/gpg.txt << EOF
%echo Generating a basic OpenPGP key
Key-Type: DSA
Key-Length: 1024
Subkey-Type: ELG-E
Subkey-Length: 1024
Name-Real: test
Name-Comment: test
Name-Email: [email protected]
Expire-Date: 0
Passphrase: test
%pubring test.pub
%secring test.sec
%commit
%echo done
EOF

gpg2 --armor --batch --gen-key /tmp/gpg.txt
rm -f /tmp/gpg.txt

部分的に動作します。test.pub生成のみと空test.secです。

どんなアイデアがありますか?

ベストアンサー1

さて、それで解決策を見つけました。表紙によるとGnuPGドキュメント、これ

%secring test.sec

今は廃止されました:

%secring filename

    This option is a no-op for GnuPG 2.1 and later.

    See the previous subsection “Ephemeral home directories”.

これは、ここで説明されているように、秘密鍵の保存方法を変更したためです。その他のドキュメントページ

おすすめ記事