I'm trying to make PGP keys sharing from Windows 10 to WSL 2 with Ubuntu 20.04.
I'm using this tool: https://github.com/BlackReloaded/wsl2-ssh-pageant
My current situation is that with gpg-connect-agent 'keyinfo --list' /bye
all my Windows GPG keys are listed, but with gpg --list-keys
an empty list is returned.
$ gpg-connect-agent 'keyinfo --list' /bye
S KEYINFO 9BD09C... D - - - P - - -
S KEYINFO BBF58D... D - - - P - - -
S KEYINFO D62ED0... D - - - P - - -
OK
Signing attemps fails with 'No secret key', but I think this is spected, as gpg --list-keys are empty: echo "test" | gpg --sign -u mail@none.com
Any clues why is this happenning?
What is the relation with gpg and gpg-connect-agent?
Setup:
setsid socat UNIX-LISTEN:$GPG_AGENT_SOCK,fork EXEC:"${WSL_TOOLS}/wsl2-ssh-pageant.exe --gpg S.gpg-agent",nofork &
You need to import your public key to WSL.
As stated here https://wiki.gnupg.org/AgentForwarding:
It is important to note that to work properly GnuPG on the remote system still needs your public keys.
Steps:
gpg --export -a 'mail@none.com' > public.key
;gpg --import public.key
.