dotfiles/scripts/firmador
2024-02-07 16:32:16 -06:00

25 lines
482 B
Bash
Executable file

#!/bin/sh
PASSWORD_STORE_DIR="$HOME/.local/share/password-store"
FIRMADOR="$HOME/.local/share/firmador/firmador.jar"
DOCUMENTOS="$@"
firmar() {
DOC="$1"
NOM="${DOC%.*}"
EXT="${DOC##*.}"
PIN="$(pass personal/firma-digital | head -n 1)"
[ -z "$PIN" ] && exit 1
echo "$PIN" | java -jar "$FIRMADOR" \
-dargs "$DOC" "$NOM-firmado.$EXT"
PIN=""
}
for DOC in $DOCUMENTOS ; do
firmar "$DOC"
done
PIN=""
rm -rf "$HOME/.pdfbox.cache" "$HOME/.ase"