From b9f350ee20251746c540ff352e7082e66b9c5ac8 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 26 Jul 2024 01:44:31 +0300 Subject: ak-gpg: new flag --verify-file --- lib/_ak_gpg | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/_ak_gpg') diff --git a/lib/_ak_gpg b/lib/_ak_gpg index af65fcb..b381067 100755 --- a/lib/_ak_gpg +++ b/lib/_ak_gpg @@ -149,6 +149,23 @@ _ak_gpg_encrypt_for_self(){ fi } +_ak_gpg_verify_clear_signature(){ + if [ ! -z $1 ] && [ -n "$1" ] && [ -f "$1" ] + then + fingerprint="$(cat $1 | _ak_gpg 2>&1 | grep RSA | awk '{print $5}')" + if [ $? -ne 0 ] + then + _ak_log_error "Could not verify signature" + exit 1 + fi + _ak_log_debug "$1 signed with $fingerprint" + cat $1 | _ak_gpg 2> /dev/null + else + _ak_log_error "Failed to verify detached signature $1 against $2" + exit 1 + fi +} + _ak_gpg_verify_signature(){ if [ ! -z $1 ] && [ -n "$1" ] && [ -f "$1" ] && [ ! -z $2 ] && [ -n "$2" ] && [ -f "$2" ] then -- cgit v1.2.3