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?
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.
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.
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 .
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>
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With