Skip to content

Instantly share code, notes, and snippets.

@drewsberry
Created November 10, 2016 22:05
Show Gist options
  • Save drewsberry/7b2a87b4b78864801386503e0b09d750 to your computer and use it in GitHub Desktop.
Save drewsberry/7b2a87b4b78864801386503e0b09d750 to your computer and use it in GitHub Desktop.
Use keybase command line utility to sign a file and detach the signature into a .sig file.
#!/bin/sh
usage() {
echo "sign INPUT_FILE"
}
keybase_not_found() {
echo >&2 "Keybase command line utilities must be installed to sign files."
exit 1
}
command -v keybase >/dev/null 2>&1 || keybase_not_found
input_file="$1"
if [ -z "$input_file" ]; then
usage "$0"
exit 1
fi
keybase sign --detached --infile "$input_file" --outfile "${input_file}.sig"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment