Skip to content

Instantly share code, notes, and snippets.

@nougad
Last active September 14, 2019 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nougad/8bee7874ce4de0a5ea5056e09c5ca85a to your computer and use it in GitHub Desktop.
Save nougad/8bee7874ce4de0a5ea5056e09c5ca85a to your computer and use it in GitHub Desktop.
Update GPG expiry date

Update GPG expiry date

config:

GPGKEYID="0x..."
GITEA_URL="https://..."
GITEA_TOKEN=".." # for API access
KEYBASE_USER="..."
GITHUB_USER="..."
EMAIL=".."
  • https://keys.openpgp.org

    • update: gpg --export "${GPGKEYID}" | curl -T - https://keys.openpgp.org
    • verify: curl -s "https://keys.openpgp.org/vks/v1/by-keyid/${GPGKEYID}" | gpg --import-options show-only --import
  • sks keyserver

    • update: gpg --keyserver hkp://pool.sks-keyservers.net --send-keys ${GPGKEYID}
    • verify: curl -s "http://www.sks-keyservers.net:11371/pks/lookup?op=get&search=${GPGKEYID}" | gpg --import-options show-only --import
  • Gitea (requires deleting old key first if only expiry changes)

    • update: https://${GITEA_URL}/user/settings/keys
    • via API: jq -n --arg v "$(gpg --armor --export $GPGKEYID)" '{"armored_public_key": $v}' | curl -X POST "https://${GITEA_URL}/api/v1/user/gpg_keys?access_token=${GITEA_TOKEN}" -H "accept: application/json" -H "Content-Type: application/json" -d @-
    • verify: curl -s "https://${GITEA_URL}/api/v1/user/gpg_keys?access_token=${GITEA_TOKEN}" -H "accept: application/json" | jq ".[].expires_at"
  • keybase.io

    • update: keybase pgp update -- not possible via web ui
    • verify: curl -s https://keybase.io/${KEYBASE_USER}/pgp_keys.asc | gpg --import-options show-only --import
  • WKD

    • update: gpg --no-armor --export ${GPGKEYID} > ../.well-known/openpgpkey/hu/...
    • verify: gpg -v --auto-key-locate clear,wkd,nodefault --locate-key ${EMAIL}
  • update github.com (requires deleting old key first if only expiry changes)

    • update: https://github.com/settings/keys
    • via API: jq -n --arg v "$(gpg --armor --export $GPGKEYID)" '{"armored_public_key": $v}' | curl -H "Content-Type: application/json" -X POST -d @- https://api.github.com/user/gpg_keys
    • verify: curl -s https://api.github.com/users/${GITHUB_USER}/gpg_keys | jq ".[].expires_at"
  • update facebook.com

  • refresh OpenKeyChain on android

  • refresh all other computers via gpg -v --locate-external-keys "${EMAIL}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment