2022-04-08 20:11:49 +02:00
|
|
|
#!/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)
|
2022-04-08 22:26:12 +02:00
|
|
|
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
|
2022-04-08 20:11:49 +02:00
|
|
|
|
|
|
|
ssh-keygen -Y sign -f ${keyfile[2]} -n ${namespace[2]} ${@}
|