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
1 changed files with 13 additions and 0 deletions

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
}