gpg: no valid OpenPGP data found

11,933

From the file name I read that what you try to import is not a key, but a signature on a file pig-0.16.0.tar.gz. You cannot import a signature, but verify it instead:

gpg --verify pig-0.16.0.tar.gz.asc

You need to fetch the key before verification. The required key ID will be printed when not found during verification, and can be fetched from key servers by running

gpg --recv-keys [key-id]

Be aware that if you don't validate the key against a trusted source, it could be issued by anybody. Key servers don't perform any verification, and an attacker could have just created a key using a fake name and mail address and issued the signature you just try to verify.

Share:
11,933
x-man
Author by

x-man

Updated on September 18, 2022

Comments

  • x-man
    x-man almost 2 years

    I am trying to import the following key:

    https://www.apache.org/dist/pig/pig-0.16.0/pig-0.16.0.tar.gz.asc

    Trying to import using:

    gpg --import pig.sig
    

    But getting the following error:

    gpg: no valid OpenPGP data found.
    gpg: Total number processed: 0
    

    I have tried removing line breaks but the error is still there. How can fix it? I am interested in finding out the fingerprint.

  • x-man
    x-man over 7 years
    Basically I want to find out the id of the key and run gpg --keyserver <keyserver> -recv-keys. How can I find the key id from the ".asc" file?