gpg:警告:不使用‘...’作为默认密钥:没有密钥

gpg:警告:不使用‘...’作为默认密钥:没有密钥

我最近将我的密钥导出到 Windows 服务器,但现在它不允许我加密任何东西。

当我运行时gpg --list-secret-keys,它显示:

sec   rsa2048 2019-06-21 [SC] [expires: 2023-06-25]
      C86XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX6A3
uid           [ultimate] [email protected]
ssb   rsa2048 2019-06-21 [E] [expires: 2023-06-25]

它也在公钥环中gpg --list-keys

pub   rsa2048 2019-06-21 [SC] [expires: 2023-06-25]
      C86XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX6A3
uid           [ultimate] [email protected]
sub   rsa2048 2019-06-21 [E] [expires: 2023-06-25]

但是当我尝试加密文件时出现此错误:

gpg: Warning: not using 'C86XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX6A3' as default key: No secret key
gpg: all values passed to '--default-key' ignored
gpg: no default secret key: No secret key
gpg: 20211215.0101.pgp: sign+encrypt failed: No secret key

这是我要执行的命令:

gpg --yes --recipient 998XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX918 --output $fileName --sign -encrypt $fileName.pgp

相关内容