firmar con ssh-keygen
This commit is contained in:
parent
9fcb2c0c54
commit
f41678fb72
1 changed files with 4 additions and 5 deletions
|
@ -21,11 +21,10 @@ sign_file () {
|
||||||
local _file="$1"
|
local _file="$1"
|
||||||
|
|
||||||
test ! -f "$_file" && return 1
|
test ! -f "$_file" && return 1
|
||||||
|
if test -f "$_file.sig" ; then
|
||||||
if ! openssl dgst -sha512 -sign "$private_key" "$_file" | base64 | tr -d "\n" > "$_file.sign" ; then
|
echo "$_file.sig"
|
||||||
rm -f "$_file.sign"
|
return 0
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$_file.sign"
|
LC_ALL=C ssh-keygen -Y sign -f ~/.ssh/id_ed25519 -n file "$_file" 2>&1| grep Write | cut -d " " -f 4
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue