Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aca3d0fba1 | |||
| fa32b2bf37 | |||
| f41678fb72 | |||
| 9fcb2c0c54 | |||
| 0bbd07e074 | |||
| b6c02292e2 | |||
| 9ad90339ba | |||
| 37f3f1586e | |||
| d6d240b6b2 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
./key
|
||||
./key.pub
|
||||
17
functions
17
functions
@ -6,5 +6,22 @@ get_stack () {
|
||||
fi
|
||||
}
|
||||
|
||||
# Generar una llave privada ECDSA si no existe
|
||||
generate_private_key () {
|
||||
test -f "$private_key" && return 1
|
||||
|
||||
ssh-keygen -t ecdsa -f "$private_key" -N "" -C "$@"
|
||||
}
|
||||
|
||||
# Firmar el archivo usando la llave privada.
|
||||
#
|
||||
# Uso: sign_file archivo.json
|
||||
# Devuelve: La firma
|
||||
sign_file () {
|
||||
local _file="$1"
|
||||
|
||||
test ! -f "$_file" && return 1
|
||||
test -f "$_file.sig" || ssh-keygen -Y sign -f "$private_key" -n file "$_file" 2>&1 >/dev/null
|
||||
|
||||
cat "${_file}.sig" | grep -v SIGNATURE | tr -d "\n"
|
||||
}
|
||||
|
||||
@ -14,3 +14,4 @@ stack=$install_dir/stack
|
||||
historical=$install_dir/historical
|
||||
log=$install_dir/errors.log
|
||||
corrupt=$install_dir/corrupt
|
||||
private_key=$install_dir/key
|
||||
|
||||
Reference in New Issue
Block a user