Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't check signature: public key not found

I try to decrypt file using following command:

gpg --output file.txt --decrypt file.pgp 

File is decrypted successfully but i get an error:

"gpg: Can't check signature: public key not found"

Any idea, why I get this error?

like image 636
codelikeprogrammerwoman Avatar asked Aug 01 '14 07:08

codelikeprogrammerwoman


People also ask

Can't check signature No public key ignore?

You get that error because you don't have the public key of the person who signed the message. gpg should have given you a message containing the ID of the key that was used to sign it. Obtain the public key from the person who encrypted the file and import it into your keyring ( gpg2 --import key.

Can you verify signature with public key?

A PKI digital signature is like a certificate of authenticity. In this way, a public key signature is a way for you to sign something so that others can verify: You, as the legitimate person or organization representative, actually signed the email, file, or software, and.

How do I find the public key id?

To find your GPG key ID, look in the ID column next to the newly created key. In most cases, if you are asked for the key ID, you should prepend 0x to the last 8 characters of the key ID, as in 0x6789ABCD .


2 Answers

You get that error because you don't have the public key of the person who signed the message.

gpg should have given you a message containing the ID of the key that was used to sign it. Obtain the public key from the person who encrypted the file and import it into your keyring (gpg2 --import key.asc); you should be able to verify the signature after that.

If the sender submitted its public key to a keyserver (for instance, https://pgp.mit.edu/), then you may be able to import the key directly from the keyserver:

gpg2 --keyserver https://pgp.mit.edu/ --search-keys <sender_name_or_address> 
like image 146
user3553031 Avatar answered Sep 21 '22 17:09

user3553031


You need the public key in your gpg key ring. To import the public key into your public keyring, place the public key block in a text file with a .gpg extension, and then issue the following command:

gpg --import <your-file>.gpg 

The entity that encrypted the file should provide you with such a block. For example, ftp://ftp.gnu.org/gnu/gnu-keyring.gpg has the block for gnu.org.

For an even more in-depth explanation see Verifying files with GPG, without a .sig or .asc file?

like image 29
interestedparty333 Avatar answered Sep 20 '22 17:09

interestedparty333