17 lines
425 B
Bash
Executable File
17 lines
425 B
Bash
Executable File
#!/usr/bin/env zsh
|
|
# Sign files with SSH
|
|
|
|
setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL
|
|
|
|
zmodload zsh/zutil
|
|
local -a keyfile=(-f ~/.ssh/id_ed25519)
|
|
local -a namespace=(-n file)
|
|
local -a help=()
|
|
zparseopts -D -K -- f:=keyfile n:=namespace h=help
|
|
if [[ ${#help} -ne 0 ]]; then
|
|
print "Usage: ${0} [-h] [-f KEYFILE] [-n NAMESPACE] <file> …"
|
|
return 0
|
|
fi
|
|
|
|
ssh-keygen -Y sign -f ${keyfile[2]} -n ${namespace[2]} ${@}
|