Python bindings for WireGuard's wg
utility.
python3 setup.py install
In the following, the most common use cases are briefly explained.
For a full documentation, please refer to help(wgtools.<function>)
.
private_key = wgtools.genkey()
public_key = wgtools.pubkey(private_key)
keypair = wgtools.keypair()
or
public_key, private_key = wgtools.keypair()
The keypair
object is a named tuple an can be unpacked
public_key, private_key = keypair
or accessed by atributes
public_key = keypair.public
private_key = keypair.private
psk = wgtools.genpsk()