I am trying to install Jenkins on Ubuntu 13.10 and I am getting the above mentioned error when i try to run the following command:
wget -q -O - http://pkg.je
In my case, the problem turned out to be that the keyfile was behind a 301 Moved Permanently redirect, which the curl command failed to follow. I fixed it by using wget instead:
wget URL
sudo apt-key add FILENAME
...where FILENAME is the file name that wget outputs after it downloads the file.
Update: Alternatively, you can use curl -L to make curl follow redirects.