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
|
2022-04-10 03:16:40 +02:00
|
|
|
local -a o_keyfile=(-f ~/.ssh/id_ed25519)
|
|
|
|
local -a o_namespace=(-n file)
|
|
|
|
local -a o_help=()
|
|
|
|
zparseopts -D -K -- f:=o_keyfile n:=o_namespace h=o_help
|
|
|
|
if [[ ${#o_help} -ne 0 ]]; then
|
|
|
|
print "usage: ${0} [-h] [-f KEYFILE] [-n NAMESPACE] <FILE> …"
|
2022-04-08 22:26:12 +02:00
|
|
|
return 0
|
|
|
|
fi
|
2022-04-08 20:11:49 +02:00
|
|
|
|
2022-04-10 03:16:40 +02:00
|
|
|
ssh-keygen -Y sign ${o_keyfile} ${o_namespace} ${@}
|