I read through the snapd
source code to figure this out. The command snap create-key
doesn’t show up in snap help --all
and I couldn’t find documentation for it.
snap create-key
will create a gpg key named “default” in $SNAP_GNUPG_HOME
which is $HOME/.snap/gnupg
. This is what the doc means by the “default key”. You can also create a key with snapcraft-create key <key-name>
, but it doesn’t use “default” by default.
snap create-key <key-name>
will create a key with a different name. You can then use this key name with snapcraft edit-validation-sets --key-name <key-name>
.
And before you can successfully edit a validation set with Snapcraft, you first must call snapcraft register <key-name>
to register the key with the store.