On Wed, 25 Oct 2023 10:54, Felix E. Klee said:

> Thank you! I modified that a bit, to make it more readable to me and fix
> a little bug: The second `$1` doesn’t expand to the file name. Also, I

Upoi caught me, I didn't test the posted version.

>     gpg: decryption failed: No secret key
>
> I wonder how to get rid of that.

grep -v on stderr ;-).

I think it is time to make things like this easier.  Actually re-encrypt
support has been on our feature list for many years.  Every time I want
to tackle this I stop at the descsion on whether to to also handle the
large file on server shall be re-encrypted ot on teh simple re-encrypt a copy.

>
> My version:
>
>     #/bin/sh
>
>     filename=$1
>     enc_sub_key=04FDF78D1679DD94
>
>     gpg --decrypt \
>         --pinentry-mode cancel \
>         --status-fd 1 \
>         --quiet \
>         --output /dev/null "$1" |
>         awk -v filename="$filename" \
>             -v enc_sub_key="$enc_sub_key" \
>             '
>             $1=="[GNUPG:]" &&
>             $2=="ENC_TO" &&
>             $3==enc_sub_key {
>                     print filename
>                     exit 0
>             }'
>
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users@gnupg.org
> https://lists.gnupg.org/mailman/listinfo/gnupg-users

-- 
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein

Attachment: openpgp-digital-signature.asc
Description: PGP signature

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to