0

I just begain studying how GPG works on Linux(Ubuntu20.04) and can't get my head around as why my subkey keeps getting a warning when encypting a file using the GPG command. I have also tried signing the key but a message shows that the key is already signed by the private key.

Sorry for the Japanese in the output. I made a simple translation after the "/".

As shown below, when I try encrypting the file "testfile.txt" the subkey fingerprint "AB4234D3B1CAF7120" is getting a warning.

Any help is appreciated. Thank you!

user999@penguin:~/.ssh$ gpg --encrypt --armor --recipient user123@test.com testfile.txt
gpg: AB4234D3B1CAF7120: この鍵が本当に本人のものである、という兆候が、ありません/there is no sign of authenticity that the key belongs to the user.

sub  rsa2048/AB4234D3B1CAF7120 2022-04-26 Username1 <user123@test.com
 主鍵フィンガープリント/Primary key fingerprint: 0D35 75AA F0FF 4E5E D41E  1A5C 5E03 21FC F3BB 8430
      副鍵フィンガープリント/Subkey fingerprint: 0563 C84E D52C F75F BB16  99F7 AB42 34D3 B1CA F7120

この鍵は、このユーザIDをなのる本人のものかどうか確信できません。/cannot ensure the key belogns to the user id
今から行うことを本当に理解していない場合には、次の質問にはnoと答えてください。/select NO if you do not trust the key

それでもこの鍵を使いますか? (y/N) N
gpg: testfile.txt: encryption failed: 使用できない公開鍵です
user999@penguin:~/.ssh$
user999@penguin:~/.ssh$
user999@penguin:~/.ssh$ gpg --list-keys --keyid-format LONG
/home/user123/.gnupg/pubring.kbx
--------------------------------
pub   rsa2048/5E0321FCF3BB8430 2022-04-26 [SC]
      0D3575AAF0FF4E5ED41E1A5C5E0321FCF3BB8430
uid                 [  unknown  ] Username1 <user123@test.com>
sub   rsa2048/AB4234D3B1CAF7120 2022-04-26 [E]```
1
  • 2
    You haven't marked the key as trusted, signed it nor trust a key that has signed it. Apr 27 at 15:40

1 Answer 1

0

It seems that you have imported the keys into current gpg instance and haven't updated trust of the key. You can use

gpg --edit-key user123@test.com gpg> trust gpg> save

to set trust of your imported key to ultimate trust. Please keep in mind that you should give this trust level only in special cases and your own key is one of them.

Basic PGP principal as for this is key signing in meaning of you meeting with other people verifying their identity and signing their keys as you have verified their identity. With setting partial trust to these people you will trust other people they met and verified If certain conditions are met as for example two separate chains of trust. This create web of trust which then allows you to trust keyes of people you want to talk to because they were verified by someone who has direct chain to you. The error you are getting means that gpg doesn't have any of these chains and it is warning you that you might not be talking to the person who is mentioned in the uid.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.