aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-zblock-manipulator
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-03-27 03:49:27 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-03-27 03:49:27 +0200
commit28717aded7df4ac4842fa308e67c1c15e1de4ffa (patch)
tree64a93db7a952dabf5c2af3b7776bdcf0d050e181 /bin/ak-zblock-manipulator
parentabdfe0a5c2a86f19aafe12ae70663ddcf83a6e39 (diff)
downloadarching-kaos-tools-28717aded7df4ac4842fa308e67c1c15e1de4ffa.tar.gz
arching-kaos-tools-28717aded7df4ac4842fa308e67c1c15e1de4ffa.tar.bz2
arching-kaos-tools-28717aded7df4ac4842fa308e67c1c15e1de4ffa.zip
Introduced and applied _ak_gpg library
Diffstat (limited to 'bin/ak-zblock-manipulator')
-rwxr-xr-xbin/ak-zblock-manipulator7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/ak-zblock-manipulator b/bin/ak-zblock-manipulator
index 99583fa..cf67a6e 100755
--- a/bin/ak-zblock-manipulator
+++ b/bin/ak-zblock-manipulator
@@ -17,6 +17,7 @@
# Below, the usage information
PROGRAM="$(basename $0)"
source $AK_LIBDIR/_ak_logit
+source $AK_LIBDIR/_ak_gpg
usage(){
echo "Usage:"
@@ -50,14 +51,14 @@ main(){
# We create a detached and armor signature of it
MESSAGE_SIGN_FILE=$MESSAGE".asc"
- gpg2 --homedir $AK_GPGHOME --detach-sign --sign-with $AK_FINGERPRINT --armor --output $MESSAGE_SIGN_FILE $MESSAGE
+ _ak_gpg_sign_detached $MESSAGE_SIGN_FILE $MESSAGE
# We add the signature to IPFS
MESSAGE_SIGNATURE=$(ak-ipfs-add $MESSAGE_SIGN_FILE)
# We will be using our public key also to put it in the block later
KEY="gpg.pub"
- gpg2 --homedir $AK_GPGHOME --armour --output $KEY --export $AK_FINGERPRINT
+ _ak_gpg_key_self_export $KEY
GPG_PUB_KEY=$(ak-ipfs-add $KEY)
# Acquire last block of information, to chain this one with previous posted
@@ -79,7 +80,7 @@ makeZBlock(){
BLOCK="block"
BLOCK_SIG=$BLOCK".asc"
# We have a block now, so we sign it
- gpg2 --homedir $AK_GPGHOME --detach-sign --sign-with $AK_FINGERPRINT --armor --output $BLOCK_SIG $BLOCK
+ _ak_gpg_sign_detached $BLOCK_SIG $BLOCK
# We now add the signature to IPFS
BLOCK_SIGNATURE=$(ak-ipfs-add $BLOCK_SIG)