From 6fd9f45ac8e3443116196edbdac737090cdf6630 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sun, 1 Aug 2021 01:39:50 +0300
Subject: [PATCH] Manage GnuPG as well.

---
 .bashrc         | 1 -
 .gnupg/gpg.conf | 5 +++++
 Makefile        | 6 ++++++
 3 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 .gnupg/gpg.conf

diff --git a/.bashrc b/.bashrc
index ea11707..c09355c 100644
--- a/.bashrc
+++ b/.bashrc
@@ -20,7 +20,6 @@ export CLOUDSDK_ACTIVE_CONFIG_NAME='shore'
 export DOCKER_BUILDKIT=1
 export EDITOR=vim
 export GITLAB_BASE_URL='https://git.shore.co.il/api/v4'
-export GNUPGHOME="$HOME/Documents/.gnupg"
 export GOPATH="$HOME/.local/golang"
 export HELM_HOME="$HOME/.helm"
 export HISTCONTROL=ignoreboth:erasedups
diff --git a/.gnupg/gpg.conf b/.gnupg/gpg.conf
new file mode 100644
index 0000000..c24c896
--- /dev/null
+++ b/.gnupg/gpg.conf
@@ -0,0 +1,5 @@
+use-agent
+default-key D3B913DE36AB5565DCAC91C6A322378C61339ECD
+personal-digest-preferences SHA256
+cert-digest-algo SHA256
+default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
diff --git a/Makefile b/Makefile
index 7c00f8f..5cde15e 100644
--- a/Makefile
+++ b/Makefile
@@ -93,3 +93,9 @@ all: .aws/credentials
 	echo '[smile]' > '$@'
 	echo "aws_access_key_id = $$(ph show --field 'UserName' 'Smile/AWS CLI')" >> '$@'
 	echo "aws_secret_access_key = $$(ph show --field 'Password' 'Smile/AWS CLI')" >> '$@'
+
+all: .gnupg/trustdb.gpg
+.gnupg/trustdb.gpg: Documents/Database.kdbx
+	ph show --field 'Notes' 'GPG/D3B913DE36AB5565DCAC91C6A322378C61339ECD' | gpg --import
+	echo 'D3B913DE36AB5565DCAC91C6A322378C61339ECD:6:' | gpg --import-ownertrust
+	chmod 600 '$@'
-- 
GitLab