Skip to content

Instantly share code, notes, and snippets.

@mz0
Created October 23, 2025 13:18
Show Gist options
  • Select an option

  • Save mz0/05df8dbb1ce8eca71cfd9b3414a1e06e to your computer and use it in GitHub Desktop.

Select an option

Save mz0/05df8dbb1ce8eca71cfd9b3414a1e06e to your computer and use it in GitHub Desktop.
[email protected] OpenPGP public key get/check

Get a PGP key and check validity

MySQL PGP pubkey bug of 2025-10-22

export KEY16=B7B3B788A8D3785C
gpg --no-default-keyring --keyring /tmp/keyring.gpg --keyserver keyserver.ubuntu.com --recv-key $KEY16 \
  && gpg --export --no-default-keyring --keyring /tmp/keyring.gpg --output /tmp/$KEY16.gpg 

### Or ###
export GNUPGHOME=$(mktemp -d)
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $KEY16

# gpg: keybox '/tmp/xx/pubring.kbx' created
# gpg: /tmp/xx/trustdb.gpg: trustdb created
# gpg: key B7B3B788A8D3785C: public key "MySQL Release Engineering <[email protected]>" imported
# gpg: Total number processed: 1
# gpg:               imported: 1

gpg -k $KEY16

# pub   rsa4096 2023-10-23 [SC] [expired: 2025-10-22]
#       BCA43417C3B485DD128EC6D4B7B3B788A8D3785C
# uid           [ expired] MySQL Release Engineering <[email protected]>
@mz0
Copy link
Author

mz0 commented Oct 23, 2025

gpg-show() {  # POSIX forbids '-', Bash and Zsh are liberal
  if [ -z "$1" ]; then
    echo "File path is missing."
    return 1
  fi

  if [ -e "$1" ] && [ ! -d "$1" ]; then
    gpg --show-keys --full-timestrings "$1"
  else
    echo "'$1' does not exist or is not a file."
  fi
}

gpg-show /usr/share/keyrings/mysql-build.gpg 
# pub   rsa4096 2023-10-23 17:26:50 [SC] [expires: 2027-10-23 12:03:47]
#       BCA43417C3B485DD128EC6D4B7B3B788A8D3785C
# uid                      MySQL Release Engineering <[email protected]>
# sub   rsa4096 2023-10-23 17:26:50 [E] [expires: 2027-10-23 12:03:57]

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