aboutsummaryrefslogtreecommitdiff
path: root/lib/_ak_gpg
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-07-26 01:44:31 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-07-26 01:44:31 +0300
commitb9f350ee20251746c540ff352e7082e66b9c5ac8 (patch)
tree7a828b33eec8efa8cde06792ea7c92ba075e254a /lib/_ak_gpg
parent00f3e970c39adb28e24a6ac0cdbfffc8bac8ac67 (diff)
downloadarching-kaos-tools-b9f350ee20251746c540ff352e7082e66b9c5ac8.tar.gz
arching-kaos-tools-b9f350ee20251746c540ff352e7082e66b9c5ac8.tar.bz2
arching-kaos-tools-b9f350ee20251746c540ff352e7082e66b9c5ac8.zip
ak-gpg: new flag --verify-file <file>
Diffstat (limited to 'lib/_ak_gpg')
-rwxr-xr-xlib/_ak_gpg17
1 files changed, 17 insertions, 0 deletions
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