Skip to content

Instantly share code, notes, and snippets.

@vpetrigo
Created December 9, 2020 21:01
Show Gist options
  • Save vpetrigo/7efd477ce4a5d74b38e3519a6e6ebfc5 to your computer and use it in GitHub Desktop.
Save vpetrigo/7efd477ce4a5d74b38e3519a6e6ebfc5 to your computer and use it in GitHub Desktop.
Verify file signature with a GPG ASC file
#!/bin/bash
# usage: verify.sh <ASC file name without extension> <signature filename> <file to verify>
# verify.sh 18A9236D file.sig file.txt
asc_filename="$1"
sig="$2"
file_to_verify="$3"
gpg -o ${asc_filename}.gpg --dearmor ${asc_filename}.asc
gpg --no-default-keyring --keyring ./${asc_filename}.gpg --verify "$sig" "$file_to_verify"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment