14 lines
289 B
Go
14 lines
289 B
Go
|
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
|
||
|
}
|