mirror of
https://github.com/0x5eal/wg-lua.git
synced 2024-12-12 04:40:36 +00:00
Erica Marigold
666a5f79e8
`Wireguard:generatePublicKey` now accepts the privateKey as a base64 encoded string, which gets decoded internally to produce the raw bytes.
9 lines
358 B
Lua
9 lines
358 B
Lua
local wg = require("../out/").wireguard
|
|
|
|
local PRIVATE_KEY = "iIWrphmeEnCLZFjdN17RQfEq8ND1MX+qAdIpRJdRhEA="
|
|
local PUBLIC_KEY = "lYnVoKy9rzIapS0zPoLHskf4B+L3FouFXWwddKhRa3s="
|
|
|
|
local publicKey = wg:generatePublicKey(PRIVATE_KEY)
|
|
|
|
assert(#publicKey == 44, "expected public key to be 44 bytes")
|
|
assert(publicKey == PUBLIC_KEY, "expected the correct public key")
|