Skip to main content

Create UNIX sockets and proxy to the gpg4win agent

Project description

wsl2gpg

wsl2gpg is a small utility making it possible to use gpg in WSL (Windows Subsystem for Linux) with the agent from Gpg4win.

GnuPG's libassuan emulates sockets on Windows by listening on localhost and writing the TCP port number and a key to the "socket" file. This utility will listen on UNIX sockets in ~/.gnupg and proxy connections to the localhost TCP port. The key is automatically sent first.

With this, gpg in WSL can talk to the Gpg4win agent in Windows.

Usage

You can either install wsl2gpg with pip:

pip install wsl2gpg

Or alternatively just copy __init__.py somewhere and make it executable with chmod +x

Then, append a line to your .bashrc (or rc file of your favorite shell) to run wsl2gpg when you log in:

wsl2gpg -q -i &

You should then be able to use gpg in WSL as usual. For example, to show information on a Yubikey / smartcard:

$ gpg --card-status
Reader ...........: Yubico Yubikey 4 OTP U2F CCID 0
[...]

Potential Issues

Should the Windows user detection not work, you can set the username manually:

wsl2gpg -u yourwindowsuername

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wsl2gpg-0.0.2.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

wsl2gpg-0.0.2-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page