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

MARCH 19, 2021

If you're getting this message when encrypting files with a GnuPG—the GNU Pretty Good Privacy (PGP) package—you can mark your key as trusted (if that's the case). This often happens when you copy a trusted key from one machine to another.

Here's what I was getting before 'trusting' my own key.

gpg: <KEY_ID>: There is no assurance this key belongs to the named user
It is NOT certain that the key belongs to the person named
in the user ID.  If you *really* know what you are doing,
you may answer the next question with yes.

Use this key anyway? (y/N) y

Every time, I'd have to answer y to complete the encryption process.

I learned how to skip this step from this StackOverflow post.

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

Then you set the degree to which you trust the specified key.

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 as this is a key I created for myself.

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

Confirm, then quit.

gpg › quit

Now you can use your GPG key without confirm every operation.