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.