gnupg:无法保证此密钥属于指定用户

时间:2015-10-27 06:16:22

标签: encryption passwords public-key-encryption gnupg

我正在尝试使用名为Pass的有趣密码管理tool

我做了以下事情:

  1. 已安装的gpg工具$ sudo dnf install gpg
  2. 使用$ gpg --gen-key
  3. 生成密钥
  4. 按照here
  5. 键入$ pass init "foobar id of my gpg key"
  6. GOT
  7. mkdir: created directory ‘/home/chichivica/.password-store/’ Password store initialized for foobar@email.com

    1. 试图添加一个简单的密码
    2. $ pass insert foo Enter password for foo: Retype password for foo:

      1. 有问题
      2. gpg: A45A123C: There is no assurance this key belongs to the named user gpg: [stdin]: encryption failed: Unusable public key

        有人能给我一些建议吗? 也许是我误解的事情? 提前谢谢。

1 个答案:

答案 0 :(得分:164)

将密钥对从一台计算机复制到另一台计算机后,我遇到了同样的问题。我的解决方案是设置密钥的信任级别:

gpg --edit-key <KEY_ID>
gpg> trust

您将被要求从以下选择信任级别:

1 = I don't know or won't say
2 = I do NOT trust
3 = I trust marginally
4 = I trust fully
5 = I trust ultimately
m = back to the main menu

我选择了5,因为我创建了密钥,所以当然我最终相信它:)。它会要求您确认您的决定:

Your decision? 5
Do you really want to set this key to ultimate trust? (y/N) y

确认后,您应该能够使用该密钥加密。