This commit is contained in:
Kekskurse 2021-06-01 19:17:35 +02:00
parent c1840caa36
commit c453ea7231
Signed by: kekskurse
GPG key ID: 728ACCB59341E7E4

13
key.go Normal file
View file

@ -0,0 +1,13 @@
package gowgpkg
import "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
func CreatePrivateKey() (publicKey, privateKey string, err error) {
r, err := wgtypes.GeneratePrivateKey()
if err != nil {
return "", "", err
}
privateKey = r.String()
publicKey = r.PublicKey().String()
return
}