Can't check signature: public key not found

codelikeprogrammerwoman picture codelikeprogrammerwoman · Aug 1, 2014 · Viewed 112.4k times · Source

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?

Answer

user3553031 picture user3553031 · Aug 1, 2014

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>