mirror of
https://github.com/Kiritow/image-station.git
synced 2024-03-22 13:30:54 +08:00
13 lines
389 B
Python
13 lines
389 B
Python
# -*- coding: utf-8 -*-
|
|
import sys
|
|
import subprocess
|
|
|
|
|
|
if __name__ == "__main__":
|
|
prik = subprocess.check_output(["wg", "genkey"])
|
|
print("[PrivateKey]: {}".format(prik.strip()))
|
|
subp = subprocess.Popen(["wg", "pubkey"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
|
pubk = subp.communicate(input=prik)[0]
|
|
print("[Public Key]: {}".format(pubk.strip()))
|
|
subp.wait()
|