Try more gpg fixing

This commit is contained in:
Hans Muendelein 2024-11-02 22:31:21 +01:00
parent 1a615e80ab
commit 15abd61902
1 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,8 @@ pkgs.mkShell {
shellHook = '' shellHook = ''
mkdir -p $HOME/.gnupg mkdir -p $HOME/.gnupg
echo "pinentry-program = ${pkgs.pinentry-curses}/bin/pinentry-curses" > $HOME/.gnupg/gpg-agent.conf echo "pinentry-program = ${pkgs.pinentry-curses}/bin/pinentry-curses" > $HOME/.gnupg/gpg-agent.conf
chmod 700 /root/.gnupg
chmod 600 /root/.gnupg/gpg-agent.conf
# Set the SSH agent socket for gpg-agent # Set the SSH agent socket for gpg-agent
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
@ -20,11 +22,12 @@ pkgs.mkShell {
# Import public key # Import public key
export KEY_URL="$(gpg --card-status | grep URL | cut -d' ' -f6)" export KEY_URL="$(gpg --card-status | grep URL | cut -d' ' -f6)"
echo $KEY_URL
curl $KEY_URL | gpg --import curl $KEY_URL | gpg --import
gpg --card-status gpg --card-status
gpgconf --kill gpg-agent
gpg-agent --daemon
touch dummy touch dummy
gpg -r hans --encrypt dummy gpg -r hans --encrypt dummy
gpg --decrypt dummy.gpg gpg --decrypt dummy.gpg