Support direct URLs for APT repository keys

Current Snapcraft requires a keyserver and a key ID to add a GPG key for an APT repository. This can be hard to use if the remote APT repository doesn’t publish their GPG key to a keyserver, and only has it hosted via a URL.

appimage-builder (see link below) seems to solve this approach just fine, and simply allows specifying a URL to fetch the GPG key from, without it needing to be hosted on a keyserver (though it indirectly ends up supporting that way as well anyway).

I’m mainly needing this so I can add some APT repositories during the building of my Snap. The only other way I’m thinking of right now is building via an AppImage and then copying that into the Snap, but I’d like to avoid that if I could.

Sorry for the link below thing, but the forum was only allowing me two links in a post. Here’s the link for appimage-builder though.

You can also copy the actual key into <project>/snap/keys/E00F4C82.asc for a key id of 590CA3D8E4826565BE3200526A634116E00F4C82 as documented on https://snapcraft.io/docs/package-repositories

1 Like

That’ll work, I’ll give that a try in a little bit. Thanks!