gnupg: There is no assurance this key belongs to the named user

66,121

I had the same issue after copying my key pair from one machine to another. The solution for me was the set the trust level of the keys:

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

You will be asked to select the trust level from the following:

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

I selected 5 since I created the key so of course I trust it ultimately :). It will ask you to confirm your decision:

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

After confirming, quit with:

gpg> quit

You should then be able to encrypt using that key.

Share:
66,121

Related videos on Youtube

Ivan Talalaev
Author by

Ivan Talalaev

talalaev.i.a(at)gmail.ru https://www.linkedin.com/in/ivan-talalaev-50a70794/

Updated on February 24, 2021

Comments

  • Ivan Talalaev
    Ivan Talalaev almost 2 years

    I'm trying to use interesting password management tool named Pass.

    I did the following:

    1. Installed gpg tool $ sudo dnf install gpg
    2. Generated a key using $ gpg --gen-key
    3. Typed $ pass init "foobar id of my gpg key" as stated here
    4. Got

    mkdir: created directory ‘/home/chichivica/.password-store/’ Password store initialized for [email protected]

    1. Tried to add a simple password

    $ pass insert foo Enter password for foo: Retype password for foo:

    1. And there is the problem

    gpg: A45A123C: There is no assurance this key belongs to the named user gpg: [stdin]: encryption failed: Unusable public key

    Could anyone give me some advice?

    • Jens Erat
      Jens Erat about 7 years
      What is gpg -K printing?
    • Ivan Talalaev
      Ivan Talalaev about 7 years
      @JensErat just this /home/chichivica/.gnupg/secring.gpg ----------------------------------- sec 2048R/96F0E0C0 2015-10-26 uid Ivan Talalaev (chichivica) <[email protected]> ssb 2048R/76A1D91D 2015-10-26
    • Jens Erat
      Jens Erat about 7 years
      Where in (6) is the ID A45A123C coming from? Your master key ID is another one.
    • Ivan Talalaev
      Ivan Talalaev about 7 years
      @JensErat So, it's a question. Actually I do not know. I couldn't find any occurrences of this string!
    • Jens Erat
      Jens Erat about 7 years
      Is it listed using gpg --list-keys A45A123C? What exactly did you specify in pass init? "foobar id" does not really explain what you have done.
    • Ivan Talalaev
      Ivan Talalaev about 7 years
      @JensErat 1. gpg --list-keys A45A123C result: gpg: error reading key: public key not found 2. As stated here I passed in pass init "Ivan Talalaev (chichivica) <[email protected]>". Also I tried pass init "[email protected]" with the same result.
    • Jens Erat
      Jens Erat about 7 years
      Try pass init 96F0E0C0.
    • Ivan Talalaev
      Ivan Talalaev about 7 years
      @JensErat I have already try that. Exactly the same result :(
    • Arman Ortega
      Arman Ortega over 5 years
      Hi @Ivan, I also encounter this problem today. Were you able to solve it, how did you do it? Thanks
    • Ivan Talalaev
      Ivan Talalaev over 5 years
      Hi @ArmanOrtega, The solution marked as answer helped me!
    • Arman Ortega
      Arman Ortega over 5 years
      @Ivan ok. i'll try it. Thanks.
    • ealfonso
      ealfonso over 4 years
      It appears that --list-keys may not list encryption subkey IDs, but gpg --list-keys --keyid-format long does
  • kumar
    kumar almost 4 years
    key_id is the mailid you have used
  • John Mee
    John Mee over 3 years
    gpg> quit to exit.
  • mike23
    mike23 over 3 years
    or simply gpg> q also exits.
  • Enlico
    Enlico over 2 years
    Lifesaving answer! Long live Jon Snow.
  • ñull
    ñull about 2 years
    Unfortunately it did not work for me. Still get the same message. I had a script that used a passwordless key to encrypt my duplicity backups. Looks like I have to accept unencrypted from now on. :(
  • Sam
    Sam almost 2 years
    i had to set the trust explicitly for the encryption ssb, i.e. select it first in the gpg prompt with key <SSB_ID> so that an asterisk appears next to it
  • alper
    alper over 1 year
    Would it be still working if I select 1 for trust level?
  • netskink
    netskink 11 months
    Thank you for this.